2009
04.07

What’s this TiApp.xml you speak of?

There hasn’t been much discussion of what’s in the tiapp.xml file since PR1 of Titanium.
Since this file controls a lot of how your program starts up and acts initially, it is important to know what it does.
The tiapp.xml file is generated automatically when your project is created via the Titanium Developer.
It can, however, be edited manually after that.


Here’s a sample tiapp.xml:



com.makkura.test_application_demo
	test_application_demo
	1.0
makkura
	www.aterism.com
	2009 by makkura
	
		initial

		app://index.html
		700
		3000
		0
		800
		3000
		0
		false
		true
		true
		false
		false
		true
	

The Details:

Most of the code here is self explainitory.
We’ll be going out of order a little in this explaination.
The first couple lines set up the xml version and allow Titanium to parse it correctly.

Publisher Information:

The <publisher> tag gives the name of the publisher of the application. This is usually ‘you’ or ‘your company’.
The <url> tag gives the URL of the publisher.
The <name>, <publisher>, and <url> tags cover the information about you, the publisher.

Application Information:

The <id> tag identifies your application.
It follows the convention of ‘com.<publisher>.<application_name>’.
Data on your program will be stored in a folder with that tag name.
Windows: C:\Documents and Settings\All Users\Application Data\Titanium\appdata
OS-X: /Library/Application Support/Titanium/appdata
Linux: /TitaniumApp/appdata/

The <version> tag shows the version number of your program.
It starts at 1.0 and is not changed automatically. If you keep this number up to date, it can help identify what version your users have and if they need updates.
The <copyright> tag is filled with <current_year> by <publisher> on creation of the project.

Window Information:

The rest of the file specifies things about your application for when it opens.
Notice these are all enclosed by the <window> tags.

Identification:

The <id> tag specifies the window name for the first application window.
This is set by default to ‘initial’.
Using the Titanium API you can refer to this window with Titanium.UI.windows["initial"] or Titanium.UI.windows[0].
You can use either the id name or the index number to refer to your windows.

The <title> tag refers to the title that will be placed on the window.
This is equivalent to the HTML <title> tag.

The <url> tag specifies what file is going to be opened as content for this window.
It is set by default to ‘app://index.html’.
‘app://’ points to your current project’s Resources folder so this is the same as ‘path/application/Resources/index.html’.
In my example’s case that would be ‘/test_application_demo/Resources/index.html’.

Size:

The <min-height> and <max-height> tags control the minimum and maximum height of the window respectively.
Similarly the <min-width> and <max-width> tags control the minimum and maximum width of the window.
By default these are set to extreme values to not interefere with the application’s sizing.

The <height> and <width> tag assign the default size of the window when it opens.

If you need your window to conform to a specific size then these are the values you’ll need to edit.

Control:

The <maximizable>, <minimizable>, and <closable> tags handle the standard actions you expect from the Minimize, Maximize, and Close buttons in the corner of the title bar.
These are all set to ‘true’ by default.
Any that are disabled will be ‘greyed out’ and unusable.
If they are all disabled then they will not appear on the title bar at all.
(Greying out and being removed from the title bar completely may depend on the OS the application is run on.)

The <fullscreen> tag handles if the application is full screen or not.
It is set to ‘false’ by default.
If it is set to ‘true’ the application will take up the whole window and will not have the standard title bar and Minimize, Maximize, Close controls visible.

Chrome:

The <chrome> tag handles what custom chrome is available.
It is set to ‘true’ by default.
If it is set to ‘false’ the title bar will not appear.
The <chrome> tag also contains a value ’scrollbars=”true”‘.  This value handles if there are usuable scrollbars if the content reaches far enough horizontally or vertically.
If it is set to ‘false’ there will be no scrollbars to use.

That covers everything in the TiApp.xml file by default.
There may be additional fields used by the different OS builds or fields the developes have added but not used by default.
I leave it to those more adventurous to handle those.

If you have additional fields that are specific to your OS in your tiapp.xml by default, please let me know and I will add in a refernce to them here.
~makkura

No Comment.

Add Your Comment

You must be logged in to post a comment.