API Development

Upgrading Android Modules to 1.8.0.1

As part of the release of Titanium Mobile SDK 1.8, a number of changes were made to our Android platform APIs in order to support multiple Javascript runtimes (V8 and Rhino). Android Modules that have been built with versions of Titanium Mobile SDK prior to 1.8.0.1 will NOT work with applications built using version 1.8.0.1 or newer (and vice-versa). We have converted all of our internally developed modules as well as the publicly available modules to work with release 1.8.0.1. It is necessary to download updated Android modules in order to develop applications with Titanium Mobile SDK version 1.8.0.1.

Application Configuration for Android Modules

Appcelerator modules updated for 1.8.0.1 contain two versions of the Android module, one for use with pre-1.8.0.1 SDKs and one for use with 1.8.0.1 or newer. In your tiapp.xml file, make sure that you specify the version of the module that corresponds to the version of Titanium Mobile SDK that you are targeting. For Appcelerator modules, specify the 1.X version of the module if building for versions of Titanium Mobile SDK prior to 1.8.0.1 and specify the 2.X version of the module if building for versions of Titanium Mobile SDK 1.8.0.1 or newer.

For non-Appcelerator modules, check the module documentation for the specific version required for your application.

Module Development Resources

Porting Guide

If you are a module developer, you will need to update your module source code to build and run with release 1.8.0.1. As part of our internal effort to upgrade our modules we have compiled a list of specific changes that you may have to make to your source code. The Android Module Porting Guide for 1.8.0.1 is a resource to assist you in updating your source code.

Module Packaging

Since not all of the application developers using your Android module will have upgraded to Titanium Mobile SDK 1.8.0.1, it will be necessary to maintain and distribute two versions of your module for a period of time. In distributing your module to application developers you have a couple of choices to consider:

  • Distribute individual module zip files for Titanium Mobile SDK 1.8.0.1 and pre-1.8.0.1. In this scenario, you maintain separate distribution zip files for each version of Titanium Mobile SDK
  • Distribute a single combined module zip file (Recommended). In this scenario, you will first need to assign a unique version number to each version of the module. For Appcelerator modules we decided to set the version number of our upgraded Android modules to 2.0 to indicate that the modules had been upgraded to module API version 2. Our Android modules built with module API version 1 will continue to utilize their 1.X version numbering scheme. After building both versions of the module you can combine the two zip files into a single zip file that contains the modules.

Marketplace Packaging

To distribute your module on the Appcelerator Marketplace you will need to create a single downloadable zip file for each product. The downloadable zip file should contain both versions of your Android module as well as the iOS version of your module (if applicable). The naming convention that we have adopted is module name-iphone-versions-android-versions.zip. For example, the file

ti.barcode-iphone-1.5-android-1.5.zip

contains the 1.5 iOS version and 1.5 Android version of the barcode module. However, with the combining of multiple Android versions in the zip file, the name may change to designate that multiple versions are contained in the file. For example, the updated barcode module is now

ti.barcode-iphone-1.5-android-1.5-2.0.zip

and contains the 1.5 iOS version, the 1.5 Android version, and the 2.0 Android version of the barcode module.

You can also use the following python script to assist with packaging your module:

To use this script, specify the target folder containing the distribution zip file, specify the source folder containing the various versions of your module zip file (should not be the same as the target), and specify the name of the module. For example,

./package.py dist release ti.paint

The script will enumerate the module zip files in the source folder and prompt you for inclusion in the target zip file and will automatically build up the name of the zip file utilizing the selected version numbers. Feel free to use or modify this script to suit your needs. Your combined zip file will be ready for uploading to the Appcelerator Marketplace.