Friday, December 30, 2016

Sample Android app with Titanium Mobile

Sample Android app with Titanium Mobile

I have been trying to find out various cross platform mobile application development framework. There are couple of them which includes PhoneGap and Titanium Mobile.

These frameworks allows web technologies like html, css and javascript to be used as application development framework for various mobile platforms like android, ios, blackberry etc. Lets try out Titanium Mobile and a sample android app using it.

I have started with installing Android SDK. After installing the base I have to install various packages available for download and install through the Android SDK Manager. We need a target SDK Platform Android, 1.6 API 4. Its being used by Titanium Mobile as default target platform. (not sure about support of other platforms).

We are now ready with The Android SDK, lets download Titanium Developer. You have to register with appcelerator website if you wants to use Titanium Developer.



After login, you would be in the front page of Titanium Developer. Select "New Project" and fill all the basic details related to your project as asked. The project type in our case is "mobile". When You create your project, the basic stub for holding various platform related details is auto-generated. You can find out various files including tiapp.xml, manifest and folder named "Resources" in the Project Directory you provided.

The main purpose of "Titanium Developer" IDE is for building and deploying your application. It helps you with all packaging related stuffs. You can launch the newly created application from "Run Emulator" tab.



Your actual code files should be placed into "Resources" folder. The auto-generated sample "app.js" is found in the same directory. These are the files included and compiled by Titanium to generate native binaries.

Your next question is: How Titanium generates native binaries from javascript code ?? Please check reply of Jeff Haynie for the same question here. Also Checkout this.

So back to the sample project. We can now go to "Run Emulator" tab and launch the application. Titanium automatically creates a new Virtual device depending on the configuration of your project, installs your app and launches it. Once your app is are relatively stable you can directly try that out with your android phone connected to the computer.

Go to link Download