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

The UI structure


Before we start placing UI elements on the screen, we need to have a coherent vision of how the controls will be placed on the screen. Since Titanium Studio does not provide us with a visual editor (as of writing this book), we need to determine where the controls will be placed (x and y coordinates) and how big they will be (width and height).

Our application's user interface will comprise of a single window and will be divided into three sections (views). Inside these views, we will place controls such as labels, buttons, and a scrolling list view.

The following figure is a visual representation of how the user interface elements will be stacked atop one another:

Why do we use views?

Views act as containers; they are usually used to group controls together and can be more easily moved around the screen if needed. One very simple example for this would be a toolbar; it is nothing else than a panel containing buttons when you think of it. Now, if you need to change the location of the toolbar on your screen, you can simply move the container, not every single button. A window is a top-level container that can contain other views. The major difference is that it can be opened and closed. Opening a window will load all of its containing views; closing that same window will automatically remove the views contained in it.

Tip

For developers coming from the Java or .NET world, views would be equivalent to Panels. As for developers more familiar with HTML, they can be considered as DIV tags.