1. #1
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Brisbane
    Posts
    244
    Vote Rating
    3
    Answers
    10
    SuperRoo is on a distinguished road

      0  

    Default Unanswered: ST2 and PhoneGap

    Unanswered: ST2 and PhoneGap


    Hi,
    am getting very confused here.
    I understand that you can use Sencha Native commands similar to PhoneGap in order to access device specific hardware (i.e. Camera, geoLocation, etc).
    According to the doco,
    When this singleton is instantiated, it will automatically select the correct implementation depending on the current device:
    • Sencha Packager
    • PhoneGap
    • Simulator
    So does this mean I can create an Architect app using the Sencha Ext.device.Camera.Capture command and when I zip it and send it to PhoneGap the app will automatically use the PhoneGap command?

    Also am trying to incorporate ST2 app made from Architect into phonegap...have had a look at this one Barebones-PhoneGap but still can't work it out.

    All the previous example are from ST1 or for Apple on XCode....anything new out there using ST2 on Architect for Android (Windows based)?

  2. #2
    Sencha User
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    508
    Vote Rating
    74
    Answers
    25
    shepsii is a jewel in the rough shepsii is a jewel in the rough shepsii is a jewel in the rough shepsii is a jewel in the rough

      0  

    Default


    Hey SuperRoo,

    Theoretically, yes, Sencha Touch should fine the phonegap camera interface and use it. Haven't tried this myself so I can't vouch for it if works!

    I have packaged up Sencha apps in Phonegap with great success. Just follow the Phonegap tutorials for 2.x not Sencha Touch with phonegap tutorials. They are out of date and mainly irrelevant.... if the app works as a webapp in safari, most likely it will work when it's embedded in phonegap. Just get the phonegap bare html page example working first, then copy over the output of "sencha app build package" from your app's directory.

  3. #3
    Sencha User
    Join Date
    Aug 2012
    Posts
    3
    Vote Rating
    0
    smartwave is on a distinguished road

      0  

    Default


    The main goal of PhoneGap is to provide a way to access native device APIs from javascript (= cordova lib for each device platform)
    Additionally it provide blank projects (with everything set-up) to package app for distribution.


    PhoneGap is not related to ST2. They are both two different things.
    But ST2 tends to provide same functionalities as PhoneGap does (Ext.device for native access and Sencha Cmd for packaging)


    To make your Sencha app work within a PhoneGap bundle app just follow their guides:
    http://docs.phonegap.com/en/2.1.0/gu..._index.md.html


    Basically, follow the instruction, then once you have the Hello World working, replace the www content folder with your ST app. Don't forget to include the proper cordova lib in your index.html and you are good to go.

  4. #4
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Brisbane
    Posts
    244
    Vote Rating
    3
    Answers
    10
    SuperRoo is on a distinguished road

      0  

    Default


    Hi,
    thanks for the advice. I have an added complication in that I am using Architect. This does not make an application directory so when I try and build an application for Android, it gathers all the package.json info and then proceeds to tell me that it is not an application directory and cannot continue.

    Conversley, if I generate a new app that the command line will work with, I can't use it in Architect.

    Seems to be a build problem (in Windows) with Architect and native apps.

Thread Participants: 2