Unanswered: Sencha + Phonegap for multiple platforms
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.
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.
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
Generally speaking you will have one version of you functionality, phonegap and sencha will take care which how to scan, how to beep etc.
This is my setup (More or less the same as what your proposed)
- 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.
Tags for this Thread