6
votes

I'm excited to learn Sencha Touch and improve my HTML5, CSS3, and JS skills in order to eventually program for all mobile platforms instead of focusing on one-off languages. But I'm having trouble getting started.

Here's my question:

What is actually the bare minimum required for an application?

Here's why I'm confused:

  • I started with the Hello World demo where they use new Ext.Application()
  • Then I looked at Getting Started with Sencha Touch where they use Ext.setup()
  • Then I look at the Intro to Panels screencast where Drew Neil didn't use either!

Why do there seem to be so many different ways to start building a Sencha Touch app? How should I start my apps?

Thanks for setting me straight in advance,

-- Miles

1

1 Answers

6
votes

Ext.setup() is the minimum, I think. It merely creates a page for a mobile device. In the Intro to Panels (or at least the version at http://vimeo.com/15879797), you can see Ext.setup() at 0:54 (?)

new Ext.Application() and Ext.regApplication(config) do what Ext.setup() does, but also create an Application object, which is required to take advantage of various utility methods and things Sencha has created.

From the API docs: "Sencha Applications provide in-app deep linking and history support, allowing your users both to use the back button inside your application and to refresh the page and come back to the same screen even after navigating. In-app history support relies on the Routing engine, which maps urls to controller/action pairs."

Creating an application also automatically registers a new namespace:

//this code is run internally automatically when creating the app
Ext.ns('MyApp', 'MyApp.views', 'MyApp.stores', 'MyApp.models', 'MyApp.controllers');