How to create Android build using Eclipse?

This post is ‘on request’. In my earlier post on PhoneGap build, I explained steps to generate ipa files and install test apps on iOS without a MAC. In this post I will explain about Android build using Eclipse and Phonegap. For the first time users, make sure you have installed the following:

  1. Eclipse Classic
  2. Android SDK
  3. ADT Plugin
  4. Latest copy of Cordova

STEPS TO CREATE ANDROID BUILD

  1. Assuming you have already installed Eclipse, Android SDK, ADT plugin and Cordova. Let’s create a new PhoneGap project using Eclipse.
  2. Select Phonegap for Android project from menu.
  3. Select your installed PhoneGap version. You can also include latest Sencha Touch or Jquery Mobile library if you are using these frameworks for your project.
  4. Specify a project name.
  5. Select build target based on your device. You can change build settings based on your device from android properties menu. Android 2.3 or 2.2 works best for me.
  6. Specify application name and package name. Keep in mind that package name is written ulta.
  7. After successful creation of project, the project structure looks like this. www is main folder for your project which contains assets folder. index.html is main file for mobile apps.
  8. You can right click on project and select build for android. If your android device is connected, it will successfully install app in your android device.

Additional useful information:
The android apk is typically saved in

/bin

folder of your application.

To check if Android device and SDK is installed successfully you can use

adb devices

from command prompt. If your device is connected, it will show list of devices connected to your PC. If your device is connected and it doesn’t show any device there’s something wrong. Come back from step 1.

List PackageManager.getInstalledApplications()

will give you a list of the installed applications, and ApplicationInfo.sourceDir is the path to the .apk file.

Happy Android Building

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s