Tutorial: Deploying ELIPS Studio apps to Android phones

Follow this tutorial to learn how to build ELIPS applications and deploy them on Android devices, or sell them through Android Market, on a Windows PC or a Mac.

ELIPS Studio comes bundled with all the tools you need to build and download your app on Android platform. Note that those tools are made available by Android in open source.

 

USB Driver Installation (Windows only)

In order to connect an Android device to test your applications, on Windows, you need first to install the USB driver. Note that on Mac, this is not necessary, as the native USB driver will be used.
USB driver installation (Windows only):

  1. Connect your Android-powered device to your computer's USB port
  2. Windows detects the device and launch the Found New Hardware wizard.
  3. Click "Browse...". The driver is located in the ELIPS Studio framework installation folder (by default under "C:\OpenPlug\My Environments\ELIPS_<version>\Platforms\Android 1.6\Tools\usb_driver).
  4. Click "Next" to install the driver.
NOTE

The generic Android USB driver might not work on some Android-based phones like the HTC Desire for instance. In such a case, please proceed with the installation of the manufacturer custom USB driver provided with the mobile phone.


For the detailed procedure, check the android developer website

 

Android Device Setup (Mac and Windows)

You also need to turn on "USB Debugging" on your device:
On the device, go to the home screen, press MENU, select Applications > Development, then enable USB debugging.

 

Build Configuration (Mac and Windows)

Open your project in ELIPS Studio.
In the Project > Properties window, edit "Elips3 > Targeted Devices".
Check one of the "Generic Android" devices, and click "Edit by Platform" button.

Properties for Android

 

Application settings
Fill in the Android Application settings as follows:

  • Application Icon: if not set, a default icon is used. Check the Android icon design guidelines.
  • Application Name: the name as it will appear on the device
  • Package Name: a single word ex: App Name=TweetMWC and Package Name=OpenPlug will give Namespace=com.OpenPlug.TweetMWC
  • Application Version: your app release version number ex: 1.0
  • Version Code: an incremental integer value that represents the version of the application code, relative to other versions ex: 1
  • Minimum SDK Version: the minimum API level on which the application will run ex: 4 for all versions from Android 1.6 (see Android API Levels guide)

Key settings Introduction
For deploying applications on an Android device and distribute them through Android Market, you need a certificate which consist in a key store file. This certificate is used for signing digitally your applications and identify you as the author of those applications. If you do not have a key, you can generate one using ELIPS Studio. Once you have a key, you can use it for all of your applications

Key settings for a new certificate
Should you need a certificate because you do not have any or you want an additional one, fill the project settings as follows.

  • Two Letter Country Code: ex. FR, EN, US...
  • First and Last name: your first and last name
  • Key Algorithm: algorithm used to encrypt the Key. Here you can chose RSA
  • Key Alias: the name you want to use for your key ex: myandroidkey
  • Key Password: a 6 digits password for your key
  • Key Store File: enter the name and the path of the file where to store physically your key ex: "C:\myandroid.keystore". IMPORTANT: the certificate will be generated here, so remember it to be able to reuse this certificate for your other applications.
  • Key Store Password: can be the same as the Key Password
  • Validity Period in days: choose 10000. Period should be more than 25 years to be able to publish your app
  • City or Locality: your location ex: Nice
  • Organization: your company name ex: OpenPlug
  • Organization Unit: the department you are in ex: DevTeam
  • State or Province: the country/area you are in ex: France

A certificate (a.k.a Key Store file) will be generated during the build process and will be used for signing your app. You can use the same certificate for other applications, see next.

Key settings for an existing certificate
To use an existing certificate (see previously if you do not have one), just fill the key-related information in order to sign your application with it at build time, and leave others blank:

  • Key Alias: the name you entered for your key ex: myandroidkey
  • Key Password: the 6 digits password of your key
  • Key Store File: the physical path of your key ex: C:\myandroid.keystore
  • Key Store Password
For full details, you can refer to the Android signing guidelines.

IMPORTANT NOTE: KEY SETTINGS ARE MANDATORY

You need to enter the key and certificate settings, including the password which should be at least 6 chars. Otherwise the build will fail at the end of the process, with messages such as:

ERROR: the "Key Store File" is missing in the package properties.
ERROR: the "Key Store Password" must be at least 6 characters in the package properties.
ERROR: the "Key Alias" is missing in the package properties.
ERROR: the "Key Password" must be at least 6 characters in the package properties.
Failed to initialize package building

 

Simulating and Building for Android (Mac and Windows)

After selecting one of the "Generic – Generic Android" devices in ELIPS Studio plug-in, you can simulate and debug the application.

You can then build the application from the "Build ELIPS Package" button. The result is an ".apk" application generated in your project "\output\Generic - Generic Android 320x480" folder.

 

Deploying the App on the Device (Mac and Windows)

You can now plug your Android device to your computer.

To upload the application on the device, you need to use the command line tool "adb" from Android, so called "Android Debug Bridge" (if you wish to read more about this tool, you can find a useful explanation in this page.

On Windows

This command line tool is available in the ELIPS Studio Framework folder (by default: "C:\OpenPlug\My Environments\ELIPS_[version]\Platforms\Android 1.6\Tools\bin").

To use it, open a cmd window and run it with the following command:

C:\[path_to_adb_tool] > adb install [path_to_apk]\[appname].apk

 

On Mac

This command line tool is available in the ELIPS Studio Framework installation folder (by default: "/Applications/Elips FB[FB version: 3 or 4].app/Contents/Resources/Android Tools"). In previous versions, you need to get it from the Android SDK

To use it open a terminal, and run the following command:

$> "/Applications/Elips FB[3 or 4].app/Contents/Resources/Android Tools/bin/adb" install [path_to_apk]\[appname].apk

 

That's it! Your application is now installed on the device in the main menu. You can now start it and see it running!