1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    35
    Answers
    2
    Vote Rating
    0
    ericchaves is on a distinguished road

      0  

    Default Unanswered: Sencha + Phonegap for multiple platforms

    Unanswered: Sencha + Phonegap for multiple platforms


    Hi Guys,

    I've being reading about how to use sencha touch + phonegap to build "native" apps. However all references I found so far cover simple setups for one platform only (either android or iOS) and I was wondering if it would be possible to setup a single project to both platforms. Is such thing possible? After all the "promise" of phonegap is to code once, build for all.

    Has anyone done such thing? it would be great to hear from you what kind of troubles and tricks you came-up.

    Best regards,

    Eric

  2. #2
    Sencha User
    Join Date
    Dec 2012
    Posts
    44
    Vote Rating
    3
    Belkin is on a distinguished road

      0  

    Default


    Sencha touch is js framework, in Phonegap you can use javascript. So you can setup sencha to be used from phonegap like JqueryMobile or any other framework, only one think before publish usin sencha command line to minimize js size.
    But i am using native sencha touch publisher, as now sencha supports some camera, location etc.
    One more thing in my oppinion sencha is better for multiplatform. Phonegap just run you javascript code, but you must be responsible for diffrent devices in meanwhile sencha is takin care about platform issues such as Windows phone style and android styles.

    Hope you got my point. I did my application using phonegap + jquery mobile but it was too slow, now i rewrite most of my application using sencha and i would say its fast

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    35
    Answers
    2
    Vote Rating
    0
    ericchaves is on a distinguished road

      0  

    Default


    Hi Belkin,

    Thanks for your reply! It certainly gave me some hints to think about, although it didn't quite answer my question (probably because I wasn't very clear, sorry).

    From ST2 docs it really seems easy enough to package an app natively using ST2, but since my app requires some native functionalities (mainly barcode scanning and push notifications) I'm afraid ST2 won't fit alone into my needs. hence the reason I'm looking into phonegap.

    What still unclear to me is how to best handle development workflow. So far, if I got it right, the process would be something like this:

    - create a base ST2 app with the common functionalities.
    - add a sub-folder for each target platform (e.g.: android, ios)
    - user phonegap to create a project for each target platform under the above sub-directory
    - build ST app redirecting the output for each target platform
    - code the specific functionalities for each platform under the respective dir
    - use phonegap to build and deploy each target

    I'm really not a fan of this workflow since it involves handling at least 03 codebase (the main + one for each target).

    Is there a better or easier approach?

    I would love to hear from others who have already faced this problem and what solutions they came-up to.

    Cheers,

    Eric

  4. #4
    Sencha User
    Join Date
    Dec 2012
    Posts
    44
    Vote Rating
    3
    Belkin is on a distinguished road

      0  

    Default


    Sencha does support push notification http://docs.sencha.com/touch/2-1/#!/api/Ext.device.Push
    But i am not sure about barcode scanner.
    I also didnot try how to run barcode scanner on phonegap but your workflow is probablly wrong

    1. You create sencha touch common functionality.
    2. create phone gap.
    3. Copy sencha functionality to assets/www (for production you should minimize) you also can develop and configure you webserver to be runned from that folder.
    4. make zip and deploy to phonegap build.

    also you can check this link
    http://andidog.de/blog/2012/06/packa...p-for-android/

    Generally speaking you will have one version of you functionality, phonegap and sencha will take care which how to scan, how to beep etc.

  5. #5
    Sencha User
    Join Date
    Sep 2012
    Posts
    3
    Vote Rating
    0
    tling is on a distinguished road

      0  

    Default


    This is my setup (More or less the same as what your proposed)

    project
    - andriod - Android Native
    - ios - iOS native
    - wphone - Windows Phone native project
    - web - Sencha tounch project
    - - ios - platform dependent js for ios
    - - andriod - platform dependent js for andriod

    Basically I start a sencha touch base project and working on it to a point which I want to test it then I start creating each native phonegap project.

    The sencha touch project has a build script (ant file) which build the web project into one js and copy all the needed resources to each phonegap platform's www folder

    You do need to handle 3 code base and I am not sure how you get a round it because
    Each platform has a project, ios, andriod, windows phone all build different I don't think there is a way to reduced that and each cordova.js is different for each platform too. I found the most sensible way is build a core js library and deploy it on each platforms.

Thread Participants: 2

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."