gApps
  • Home
  • Directory
  • Articles
  • News
  • Resources
  • Services
  • Advertise
  • Search
  • Menu Menu
  • Link to X
  • Link to LinkedIn
Sencha Touch

How to install, use and build Sencha Touch 2.1 apps on Windows

5 Comments

Sencha Touch is a Javascript Framework used for building high performance cross platform mobile apps. My experience with installing Sencha Touch was horrible. The docs are severely lacking with outdated and conflicting information. With much experimentation, web searching and thanks to some help on the Sencha forum I managed, finally to get it installed. This post deals with installing Sencha Touch, generating your first app and ‘building’ it so it’s ready for production web use. It doesn’t cover coding a Touch app or packaging your app for iOS and Android which I expect to cover in another post.

This was a piecemeal process and very much a learning experience. There may be errors in my recommendations or assumptions but the end result works for me. If I were to do it again I’d most likely choose a more ordered folder structure for the various installations just for the sake of good housekeeping.

Briefly, if like me you struggled to cut through the marketing hype, these are the core Sencha Products and what they do:

  • Ext JS – Javascript framework for developing desktop apps.
  • Touch – Javascript framework for developing mobile apps.
  • Architect – Standalone product for developing Ext JS or Touch apps using a GUI (as oppose to hand coding)

For the record, I am only concerned with Touch. I tried Architect but found the documentation so lacking that I gave up and decided to just use Touch instead. Unless you are an OEM, Touch is free to use. Architect is a paid product.

Installing and using Sencha Touch 2.1

What you need – I provide specific download links in the instructions below:

  • Sencha Touch 2.1
  • Sencha Command 3.0
  • Ruby
  • SASS
  • Compass
  • JRE
  • Ant
  • Apache (or similar local web server)

1. Apache

First up, if you don’t have a local webserver installed, do it now. Because I’ve used it before, I chose Uniform Server, a WAMP server (Windows Apache MySQL PHP). Uniform Server downloads as an exe (Coral_8_7_2.exe in my case). Run the exe and point it to the folder you want to work from. I chose:

C:\Users\Gareth\Documents\Sencha

So the path to my web root is:

C:\Users\Gareth\Documents\Sencha\UniServer\www

Next we need to allow other devices on your network to access the new Apache installation. This assumes the IP address used by your network is 192.168.1.X. If it’s different, you will need to change the input below accordingly. In the above folder there should be an .htaccess file. Open it in a text editor and change line 9 from:

Allow from 127.0.0.1

To

Allow from 127.0.0.1 192.168.1.0/24

192.168.1.0/24 allows any device using an IP in 192.168.1.X range to access your server.

Click Start_as_program.exe form C:\Users\Gareth\Documents\Sencha\UniServer folder. Don’t worry about passwords if prompted. From the interface click ‘Start Apache’ and it should open a browser window with the Uniform Server homepage.

To access your server from another device (i.e. your mobile or tablet) you need to enter the IP address of the machine you installed Uniform Server on in the web browser. To find your IP Address, open a command prompt (start > type ‘cmd’in the search box and press enter) and type ipconfig. In the first few entries you will see a line that says IPv4 address. Make a note and type this in your mobile browser address bar and you should see the Uniform Server homepage.

Note: Your IP Address could change every time you restart your machine so you will need to know it to be able to see it from your mobile or tablet.

2. JRE

Next install JRE – Java Runtime Environment. Download from:

http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html

I chose Windows x64 ( jre-7u10-windows-x64.exe at the time), you should choose the correct version for your system. I left the default install options which made the install path:

C:\Program Files\Java

3. Ant

Install Ant. Download from:

http://ant.apache.org/bindownload.cgi

Ant is a library used by other tools when building applications. Download, unzip and move the files to the folder of your choice. I chose c:\ant because that what’s mentioned in the install guide. Assuming you used c:\ant, you should have the folders C:\ant\bin, C:\ant\etc and so on.

Now, open a command prompt. At the prompt type:

set ANT_HOME=c:\ant
set PATH=%PATH%;%ANT_HOME%\bin

Close the command prompt window.

4. Ruby

Install Ruby. Download from:
http://rubyinstaller.org/downloads/

I used the defaults which installed to C:\Ruby193 and checked all 3 options:

Once Ruby is installed, open a command prompt. Type:

ruby -v

This should display a line which looks similar to:

Ruby 1.9.3p362 (2012-12-25) [i386-mingw32]

5. Compass and SASS

Assuming the above works, in the same command prompt or a new one, enter the following 4 commands, waiting for each to complete before typing the next. These commands install items, including Compass and SASS which Sencha relies on when building apps:

  1. gem install haml
  2. gem install haml-edge
  3. gem install compass
  4. gem install sass

6. Sencha Touch

Install Sencha Touch. Download from:

http://www.sencha.com/products/touch/download/

At certain points in their documentation, Sencha refer to this is the Sencha Touch SDK (not to be confused with the obsolete Sencha Touch SDK Tools). I downloaded the GPL version sencha-touch-2.1.0-gpl.zip and extracted the contents to:

C:\Users\Gareth\Documents\Sencha\UniServer\www\sencha-touch-2.1.0-gpl

So I have the following example folders:

C:\Users\Gareth\Documents\Sencha\UniServer\www\sencha-touch-2.1.0-gpl\builds

C:\Users\Gareth\Documents\Sencha\UniServer\www\sencha-touch-2.1.0-gpl\cmd

C:\Users\Gareth\Documents\Sencha\UniServer\www\sencha-touch-2.1.0-gpl\docs

Etc

7. Sencha Command

Install Sencha Command. Download from:

http://www.sencha.com/products/sencha-cmd/download

(SenchaCmd-3.0.0.250-windows.exe.zip for me). I used the default install directory which was C:\Users\Gareth\bin so ended up with the following example directories:

C:\Users\Gareth\bin\Sencha\Cmd\3.0.0.250\ant

C:\Users\Gareth\bin\Sencha\Cmd\3.0.0.250\lib

C:\Users\Gareth\bin\Sencha\Cmd\3.0.0.250\phantomjs

Etc

That should be it. Close all command prompts and then open a new one and type the following. You will need to change the paths to the correct ones. The first path is the path to where you installed Sencha Touch, the second is where you want your app folder:

sencha –skd C:\Users\Gareth\Documents\Sencha\UniServer\www\sencha-touch-2.1.0-gpl generate app FirstTest C:\Users\Gareth\Documents\Sencha\UniServer\www\FirstTest

This will create a folder in the www directory called FirstTest which contains all the files for a basic Sencha Touch app. If you visit http://localhost/FirstTest (using Chrome) you should see the app:

My local IP Address is 192.168.1.96 so if I visit http://192.168.1.96/FirstTest on my iPhone I see:

Finally, to ‘build’ your app, that is, to export it in a format optimised for a particular environment, open a command prompt, change directory to the one we created for your FirstTest, and type:

sencha app build production

Your output should look like the screen shot below and your FirstTest folder should contain a new folder tree of ‘build/FirstTest/production’. Now, if you navigate to the address below you will be viewing the optimised, production ready version of your app:

http://192.168.1.96/FirstTest/build/FirstTes/production

That’s it. You should be up and running. The following resources where used by me and might help you if you get stuck:

http://www.ladysign-apps.com/developer/sass/installing-sass-compass-for-windows-os-x/ installing compass and sass on windows.

http://ant.apache.org/manual/install.html#windows – installing ant on windows

http://www.sencha.com/forum/showthread.php?252680-Docs-appalling-how-to-actually-get-started – my forum thread where Brice Mason provided a concise list of requirements.

 

Share this entry
  • Share on Facebook
  • Share on X
  • Share on WhatsApp
  • Share on LinkedIn
  • Share on Reddit
  • Share by Mail
5 replies
  1. saurus says:
    February 2, 2013 at 11:43 am

    You helped me allot with this tut ! tnx

  2. Nheily says:
    February 2, 2013 at 8:08 pm

    Thanks man.. this must work, let me try out
    will get back if i find any ore problems

  3. sdaban says:
    March 5, 2013 at 12:16 pm

    Thank you very much for your help!
    I really appreciate it!

  4. Tom Andersen says:
    March 7, 2013 at 12:20 pm

    Wow! After hrs of struggling I found your tutorial… it probably saved my cat’s life! He sensed my frustration and was hiding! I had to fiddle a bit with the final path, but finally got things to work. I strongly suspect you saved me about 2 days of frustration… and Phoebe the Cat Thanks you as well!!!!

    • Genetic Digital says:
      March 7, 2013 at 12:22 pm

      Our main aim in writing these articles is to prevent cat cruelty so you’re very welcome :)

Comments are closed.

Featured Articles

  • EU MDR postponed to May 2021
    Medical Device Regulation (MDR) is postponed until 2021July 15, 2020 - 1:23 pm
  • Avoiding app store rejection – the importance of using a medical app development specialistMay 5, 2020 - 4:48 pm
  • Tips for designing a medical device
    Tips for designing a medical app – is connectivity on your list?August 2, 2016 - 11:20 am

App Developer Directory

Search or Get Listed
App developer directory

About

gApps is the UK’s leading resource for all things relating to health and medical app development.
About us

Contact us

Write for us

Directory Listing

Featured Article

  • EU MDR postponed to May 2021
    Medical Device Regulation (MDR) is postponed until 2021July 15, 2020 - 1:23 pm

Advertise

Learn more about advertising opportunities and getting listed in our app developers directory

Newsletter Sign-Up

© DGR Enterprises Ltd 2025 | Privacy Policy | Cookie Policy | Legal
  • Link to X
  • Link to LinkedIn
Scroll to top Scroll to top Scroll to top

This website or its third-party tools process personal data (e.g. browsing data or IP addresses) and use cookies or other identifiers, which are necessary for its functioning and required to achieve the purposes illustrated in the cookie policy. By continuing to use this site you agree to our use of cookies.

Close

Cookie and Privacy Settings



How we use cookies

We may request cookies to be set on your device. We use cookies to let us know when you visit our websites, how you interact with us, to enrich your user experience, and to customize your relationship with our website.

Click on the different category headings to find out more. You can also change some of your preferences. Note that blocking some types of cookies may impact your experience on our websites and the services we are able to offer.

Essential Website Cookies

These cookies are strictly necessary to provide you with services available through our website and to use some of its features.

Because these cookies are strictly necessary to deliver the website, refusing them will have impact how our site functions. You always can block or delete cookies by changing your browser settings and force blocking all cookies on this website. But this will always prompt you to accept/refuse cookies when revisiting our site.

We fully respect if you want to refuse cookies but to avoid asking you again and again kindly allow us to store a cookie for that. You are free to opt out any time or opt in for other cookies to get a better experience. If you refuse cookies we will remove all set cookies in our domain.

We provide you with a list of stored cookies on your computer in our domain so you can check what we stored. Due to security reasons we are not able to show or modify cookies from other domains. You can check these in your browser security settings.

Google Analytics Cookies

These cookies collect information that is used either in aggregate form to help us understand how our website is being used or how effective our marketing campaigns are, or to help us customize our website and application for you in order to enhance your experience.

If you do not want that we track your visit to our site you can disable tracking in your browser here:

Other external services

We also use different external services like Google Webfonts, Google Maps, and external Video providers. Since these providers may collect personal data like your IP address we allow you to block them here. Please be aware that this might heavily reduce the functionality and appearance of our site. Changes will take effect once you reload the page.

Google Webfont Settings:

Google Map Settings:

Google reCaptcha Settings:

Vimeo and Youtube video embeds:

Other cookies

The following cookies are also needed - You can choose if you want to allow them:

Privacy Policy

You can read about our cookies and privacy settings in detail on our Privacy Policy Page.

Privacy Policy
Accept AllDecline AllUse Only Selected
Open Message Bar Open Message Bar Open Message Bar