First, let's get a general item of information about Titanium Appceleratorplatform.
Apart from desktop apps, Titanium Appcelerator allows to write applications for mobile phones. Accordingly, the mentioned kind of application development gets split into 2 big parts: Titanium Desktop and Titanium Mobile.
We have a possibility to write applications for cellphones with such OS as Android, Blackberry, IPhone. There's no doubt with such a choice operation systems one can write applications for, make you impressed. In the article below we'll talk about the process of writing application for OS Android.
In order to write a program for Android, any developer will require the knowledge of JavaScript. The program consists of objects that are inserted into it. Each object will have its unique features and will get its own methods employed. A list of objects gives us possibility to use practically all OS resources.
Titanium Appcelerator platform speeds up application development for Android because it's going to be longer to write program with Java than to write program on Titanium with the help of JavaScript. But programs written on Java will work faster. But here one of eternal questions of choosing program language arises: performance or expenses.
For you to write a simple application you need to know some objects of Titanium. UI section. The most common objects are the following:
- Titanium.UI.Button
- Titanium.UI.ImageView
- Titanium.UI.Label
- Titanium.UI.ScrollableView
- Titanium.UI.View
- Titanium.UI.Window
Now let's look closer at the objects:
First of all it's necessary to clarify all rules of program writing. One of the important aspects of program writing is correct object position. Every object has its value and property.
One of the main objects is Titanium.UI.Window. Creation of object happens with the help ofTitanium.UI.createWindowmethod. An object has a list of its features and methods. Having this long list of features we can set a background color, write its title, place it in the necessary spot (left, right, top, bottom) etc. We also shouldn't forget about methods such as open , add and some other methods.
Example:
var window = Titanium.UI.createWindow({ backgroundColor:'red', title: 'My Root Window' }); window.open();