-
3 Apr 2012 9:25 AM #1
SDK Tools with PhoneGap
SDK Tools with PhoneGap
Can the SDK tools build scripts not handle PhoneGap builds?
If I try to do something as simple as
I get the following error when trying to build for testing.Code:window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess, null);
Error thown from your application with message: ReferenceError: Can't find variable: LocalFileSystem
Is there something special I need to do to use PhoneGap features that are not abstracted by sencha? I understand I am not building a phonegap app with the SDK tools but I need to package it for PhoneGap. Is this possible?
FYI I am on windows 7 64-bit with SenchaSDKTools-2.0.0-beta2 using Cordova 1.5
-
3 Apr 2012 10:39 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,636
- Vote Rating
- 435
The SDK Tools does not build for PhoneGap. The build for native is for the Sencha native wrapper.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
3 Apr 2012 11:09 AM #3
I do completely understand that and I am not trying to build a PhoneGap app WITH the SDK Tools I am trying to package my Sencha app FOR PhoneGap.
I am using:
Once it is packaged I want to copy this into my PhoneGap Android Project (assets/www) and package this using PhoneGap.Code:sencha app build package
Is this not possible with the SDK tools? If not how does one go about using PhoneGap API's with Sencha that are not abstracted, FILE API specifically. How does one package a sencha application for use with phonegap?
thanks
-ross
-
3 Apr 2012 8:47 PM #4
For now I have come up with a workaround. Before doing any calls to Cordova I do a check like this
This way when the "compiler" runs it will not step in there and not throw errors on undefined things, but when the application is deployed into a working phonegap environment everything is peachy keen.Code:Ext.browser.is.WebView && Ext.browser.is.PhoneGap && !Ext.os.is.Desktop
I have also made a quick utility getter to make this faster (cordova.enabled) but that's not as important. This should be enough for me to start working with Sencha touch 2 AND phonegap correctly.
-
4 Apr 2012 2:21 AM #5
I have tried your suggestions, but for some reason, it doesn't work:
Ext.Msg.alert("Info", "webView: "+Ext.browser.is.WebView+" / Phonegap: "+Ext.browser.is.PhoneGap+" / Desktop: "+Ext.os.is.Desktop);
displays an alert, but with following text:
webView: false / Phonegap: undefined / Desktop: undefined
What am I missing?
Thanks!Last edited by jdesmedt; 4 Apr 2012 at 2:23 AM. Reason: typo
-
4 Apr 2012 4:55 AM #6
I have found a way to make the compiler stop complaining, but I'm still not getting everything working.
I want to access the device.platform property, but when I try that, I get an error: ReferenceError: device is not defined.
What am I doing wrong? Could you provide a minimal project that combines Phonegap & Sencha (& is built with the SDK tools?)
Thanks!
-
4 Apr 2012 7:34 AM #7
Whoops! I forgot to include this also sorry I am back and forth between multiple forum issues here.
Cordova 1.5.0 for iOS has broken sencha support. They removed the global PhoneGap object and replaced it with a Cordova object but unlike the Android version of the JS they did not provide a backwards compatibility in the iOS version.
Details on a fix here
http://www.sencha.com/forum/showthread.php?192354-Ext.device-problem&p=771704&viewfull=1#post771704
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote