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
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 #2
- Join Date
- Mar 2007
- St. Louis, MO
- Vote Rating
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
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
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 firstname.lastname@example.org
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is 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:
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?
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
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?
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?)
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