Time for action – creating an app from a template
To create an app from a template perform the following steps:
From the dashboard select the Develop option:
On this screen within the Template section click on the New Project button and on the Default Project option. The following screen will appear:
An explanation of the options shown on the New Titanium Project screen is given in the following table:
Value
Optional/required
Description
Project Name
Required
This contains the name of the project. This will be the name that appears in the Project Navigator window, and will also be the name of the base director of the app. It will probably be the intended name of the app when you release it although it doesn't have to be. You can release the app under a different name.
App Id
Required
This contains the unique identifier for the app. The convention is to use the reverse domain name such as
com.domain.project
. The minimum requirement is to have an app ID ofxxx.x
(meaning you must have a dot and something after it). Also note that the app ID does not have to relate to a real domain nor to a domain that you own, although you would be wise to choose a domain you own.Company URL
Optional
This contains the URL of the company that owns the app. This is optional and will not be shown on the app store.
Titanium SDK Version
Required
This contains the version of the Titanium SDK used to build your app. This can be changed later.
Deployment Targets
Required
This contains a list of checkboxes of device types that you intend to release the app on. This can be changed later. Leaving them all checked as the default setting is not an issue and will not get in your way.
Automatically Cloud enable this application
Required
Do you want to connect to the cloud for this application? This should be left unchecked for this first app. We will cover the cloud enabling of apps later in this book.
For this app the settings used are shown in the following screenshot:
Click on Finish. The project will be created and you will be presented with the following screen:
The screen is a summary of the contents of the
tiapp.xml
file. This file contains the project settings and customizations. It's a file you will become familiar with and refer to often when creating Appcelerator apps. We will take a closer look at the contents of this file later in the chapter, but first let's get straight to business and run our first cross-platform app, using the code that was just generated.
What just happened?
We created our first Titanium app. Titanium will have created the project files and directories required to support the development of the app. The main configuration files will have been configured based on the entries specified on the New Titanium Mobile Project screen.
The blank template has created an app with a small amount of code in it. Enough for us to run it to see what we have done. Everything is in place. You have a project, you have configured your emulators, what are you waiting for? Let's run the app!