Using Eclipse
Import Project into Eclipse
If you haven't already, import the "android" directory from your PhoneGap project into Eclipse:
- Open Eclipse
- Go to: File -> Import
- Choose "Existing Android Code Into Workspace" located under "Android", then click Next
- Click Browse and locate the "android" directory of your project (e.g. ~/my_app/platforms/android), then click OK
- Under "Projects to Import", check both boxes, one for your app, and one for "CordovaLib"
- Do not check "copy projects into workspace" and do not check "Add project to working sets"
- Click Finish
App Icons
In your Android project directory, there is a folder called 'res', that is where we will place our app's icon files.
my-android-project/res/drawable/icon.png (96x96)
my-android-project/res/drawable-hdpi/icon.png (72x72)
my-android-project/res/drawable-ldpi/icon.png (36x36)
my-android-project/res/drawable-mdpi/icon.png (48x48)
my-android-project/res/drawable-xhdpi/icon.png (96x96)
We recommend creating a high resolution square image for your mobile app's icon, then saving copies of it using the dimensions listed above.
Export an .APK File
Once you're confident the app is ready for release:
- Open Eclipse
- Right click on your app in the "Project Explorer"
- Select "Export"
- Under "Android", select "Export Android Application", then click Next
- Verify your project is listed in the "Project" field, if it isn't click "Browse" to find it, then click Next
- Select "Use existing keystore" (see the "Create new keystore" section below if you don't have a keystore yet)
- Click Browse and locate your .keystore file
- Then enter the keystore password, then click Next
- Under "Use existing key", verify your .keystore file is selected for "Alias"
- Enter the keystore password again, then click Next
- Specify a destination to save the .apk file (e.g. ~/Desktop/MyApp.apk)
- Click Finish