0
votes

I am new in Apps World, and I started developing with Sencha Touch + PhoneGap. I think I installed everything right following these: http://docs.sencha.com/touch/2.3.1/#!/guide/cordova and http://vimeo.com/76568053.

My setup:

  • Windows 7 x64
  • GIT 1.9.4.msysgit.0
  • NODEJS 1.4.9
  • RUBY 2.0.0p481
  • Sencha Touch 2.3.1
  • Sencha Cmd 5.0.0.160
  • Cordova 3.5.0-0.2.4
  • PhoneGap 3.5.0-0.20.4
  • ANT 1.9.4
  • SASS
  • COMPASS
  • ANDROID ADK

Both are the last versions up-to-now. All paths set!

After that I created my new app following both links steps.

  1. sencha -sdk mypath/touch-2.3.1 generate app TestCordova TestCordova
  2. sencha cordova init com.sencha.TestCordova
  3. I opened the app.js and put inside launch: function() the line: alert(device.uuid); So I can access the device UUID that cordova API gives.
  4. Then I entered in the cordovas folder and write in cmd: cordova plugin add org.apache.cordova.device
  5. Finally I returned the folder and write: sencha app build -run native

That works perfectly, it opened the emulator and appears the UUID and then the Sencha default app.

The problem comes when I tried to work with PhoneGap, I did the same steps:

  1. sencha -sdk mypath/touch-2.3.1 generate app TestPhoneGap TestPhoneGap
  2. sencha phonegap init com.sencha.TestPhoneGap
  3. I opened the app.js and put inside launch: function() the line: alert(device.uuid); So I can access the device UUID that phonegap API gives.
  4. Then I entered in the phonegaps folder and write in cmd: phonegap plugin add org.apache.cordova.device
  5. Finally I returned the folder and write: sencha app build -run native

The device UUIDS doesn't appeared. When I use if(Ext.browser.is.PhoneGap) it returns false. What is the problem? Why in cordova works and in phonegap it doesn't?

1

1 Answers

0
votes

Check that cordova.js (probably best now with 3.5.0+) or phonegap.js are being loaded in your app.json file. Needs to load before sencha touch ...

"js": [
    {
        "path": "cordova.js",
        "remote": true
    },
    {
        "path": "touch/sencha-touch.js",
        "x-bootstrap": true
    },
    {
        "path": "bootstrap.js",
        "x-bootstrap": true
    },
    {
        "path": "app.js",
        "bundle": true,  /* Indicates that all class dependencies are concatenated into this file when build */
        "update": "delta"
    }
],

To get you started you might like to try the Sencha Touch Live app I wrote that will create, compile, deploy and run a Sencha Touch + PhoneGap app that you can then "live edit" changes into the device or emulator.

A simple way to get started debugging is to use GenyMotion Android simulator with Android 4.4+ so you can use Chrome's remote debugger from your desktop computer. Just open chrome://inspect and select the active instance of your app on the attached device or emulator. Can do the same with recent Safari/iOS. See installation details below. This should help you to set breakpoints and diagnose the fault.

You might also fine the detailed installation check list helpful.