Chapter 10. Deployment in Devices

Sencha Touch apps are by no means limited to live their lives exclusively in a browser; developers can deploy their creations also as native iOS and/or Android applications to their respective marketplaces.

To make the experience richer for the end user, Sencha Touch applications can access a large selection of native device APIs, including connectivity, location, and orientation information. Even better, Sencha Touch applications can detect whether they run in a tablet, a smartphone, or a desktop environment, and change their appearance in a very convenient way, using a feature named “profiles.”

This last chapter will provide an overview of the tasks required to get your applications running as native applications!

Using Profiles

Mobile devices such as tablets and smartphones have different screen sizes, and they are used in different contexts; however, mobile applications have to share code and resources to make them look alike and to have similar and consistent behavior across devices. As such, it is nice to know that Sencha Touch provides profiles, which allow developers to offer different user experiences in different device categories.

Note

Nearly all the applications included in the source code of this book, hosted in Github, use profiles by default and offer different user interfaces in different contexts.

Adding Profiles

Profiles are implemented through the Ext.app.Profile class. Applications use this class in the standard app.js file, as entries ...

Get Sencha Touch 2 Up and Running now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.