RkBlog

Hardware, programming and astronomy tutorials and reviews.

Simple mobile app in Titanium Developer

Creating mobile applications for iPhone and Android with Titanium Developer and JavaScript.

Now it's time to write some simple mobile app using Titanium Developer. Venturing in the APIs we some help - KitchenSink example app and documentation.

Application files and folders

Mobile app created in Developer will look like this:
build  CHANGELOG.txt  LICENSE  LICENSE.txt  manifest  README  Resources  tiapp.xml
Folder build will contain binary builds of your app. Resources folder holds all files and code of your app. File tiapp.xml contains application configuration, including list of windows (2 by default), like this:
<window>
            <id>initial</id>
            <url>index.html</url>
            <backgroundColor>#FFFFFF</backgroundColor>
			<icon>ti://featured</icon>
			<barColor>#000</barColor>
			<fullscreen>false</fullscreen>
        </window>
If we specify only one window - no tabs will be used. In Resources we will find:
about.html  android  index.css  index.html  index.js
index.html is the main window of our application (defined in tiapp.xml). Folders "android" i "iphone" can be used to add specific files or code for selected os (they can overwrite files in Resources).

How do you make an application?

It's quite strange to code a mobile app in HTML/CSS/JS. What you have to do is: You can go with basic web-like apps that doesn't use native widgets, or write a lot of JavaScript code that uses Titanium AVI to create app interface using widgets. Application built with native widgets is presented in Hybrid iPhone Apps with Titanium Mobile.

The Mobile API isn't documented well, and you will have to digg in Kitchen Sink or do a lot of debuging, testing.

Simple mobile application

So we start with an application that will show RSS channel entries from a selected website (in this case filmaster.com). For comparison I'll make two windows - two tabs. One will show RSS entries using native widgets, and second one using HTML. So using web technologies we created simple application, that (nicely finished) can be used to promote the website or serve as a mobile version of it. Now lets try do the same with native widgets. Titanium Developer has some big potential, but it really needs well written documentation (like PyQt4 one?) and short examples of common tasks and code patterns.

Source

Import project in Titanium Developer.
RkBlog

Linux and programming, 25 February 2010,

Comment article