Book Image

Creating Mobile Apps with Appcelerator Titanium

By : Christian Brousseau
Book Image

Creating Mobile Apps with Appcelerator Titanium

By: Christian Brousseau

Overview of this book

Smartphones and tablets have really changed the technological landscape over the last 3-4 years. Much like the web did in the last decade, these powerful tools have changed the way people communicate and access information. Such a wide market creates opportunities for developers who have the skills to develop mobile applications. "Creating Mobile Apps with Appcelerator Titanium" is a practical, step-by-step guide to building iPhone, iPad, and Android applications using JavaScript. This book will give you a solid grounding of the dos and don'ts of mobile development and also covers a lot of the functionalities offered by the Titanium platform. This book begins with a look at what the Titanium platform has to offer. By taking you through clear tutorials on developing each application step-by-step, it helps you to apply your newly acquired knowledge afterwards. The difficulty level gradually increases along the course of the book. Each application from this book covers different aspects of mobile development. Every chapter starts by defining the application's features as well as the user interface structure. Every single code section is then explained and put into context allowing you to gain a clear understanding of their purpose and functionality. The book takes a “small milestone” approach, allowing you to actually run the application and see the progression. Every step is accompanied by many screenshots so you can see the expected result on screen. You will learn everything you need to know to develop your very own mobile applications. The book takes a laid-back approach to Titanium development and provides information in a way designed to never overwhelm the reader with information and also uses clear diagrams, screenshots, and tips throughout.
Table of Contents (18 chapters)
Creating Mobile Apps with Appcelerator Titanium
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating our project


Since this is the book's very first mobile application, we will go through the whole project creation process. For those of you who are already familiar with Titanium Studio, you can glance over this section in order to get the information you need. As for those of you who haven't delved into Titanium development yet, this will be a good walkthrough. Once you know how to create a project, you will be able to repeat the operation for every application from this book.

Once you have launched Titanium Studio, navigate to File | New | Mobile Project. In the Classic section, select the Default Project template and then click on Next >.

Fill out the Wizard form with the following information:

Field

Value to enter

Project name

StopWatch

Location

You can follow either one of the ensuing steps:

  • Create the project in your current workspace directory by selecting the Use Default Location checkbox

  • Create the project in a location of your choice

App Id

com.packtpub.hotshot.stopwatch

Company/Personal URL

http://www.packtpub.com

Titanium SDK Version

By default, the wizard will select the latest version of the Titanium SDK, which is recommended (as of this writing, we are using Version 3.1.3 GA)

Deployment Targets

Select iPhone and Android

Cloud Settings

Uncheck the Cloud-enable this application checkbox

Here is the new Mobile Project wizard populated with the information that we covered in the preceding table:

Note

Once you have assigned an App ID to a project, you cannot change it. The reason for this is because, during its creation, Titanium generates a guID (a technical key if you will). So if you were to change an application's App ID, it wouldn't match the guID anymore. Therefore, it is recommended that if you ever needed to change an App ID, simply create a new project and move the source files into this newly created project.

What have we here?

The wizard created several files and directories. We will cover what those files are as we go forward, but for now let's just turn our attention to the ones that we will focus on in this chapter:

  • tiapp.xml: It contains the application's metadata. This ranges from description, technical IDs, and custom settings, to name a few.

  • app.js: It contains the source code for our application.

    Note

    Now technically, this is already an application. If we were to run the generated code, we would have a fully functioning application. Of course, at this point in time, it is pretty rudimentary.