4

Just started trying to adapt my html, css, javascript files to iOS using PhoneGap (I've also tried NimbleKit but the result is the same). I have a web app that I originally wrote for the Blackberry Playbook. The app works fine on the Playbook and in Chrome and Safari. However, when I try and run it through XCode with PhoneGap, the app displays on the simulator but does not seem to properly run the database coding (at least I think that is the problem). I do not get any build errors.

From the documentation, NimbleKit seems to just support its own internal SQLite, but PhoneGap seems to support WebDB, which is what my database is written in.

Finally, the simulator doesn't seem to run some global variables I have (I know, I know, don't use global variables) although that could be because they appear just after my DB initialization at the beginning of my javascript file.

Any thoughts or points in the right direction would be very helpful. Even if it is to some documentation which can help me debug the app in the iOS sim.

Thanks in advance.

robert smith
  • 861
  • 2
  • 10
  • 17
  • I am having a similar problem with a mobile app built in jQueryMobile and PhoneGap for Android. Now that I am testing it on iPhone/iPad simulator on a Mac, the app stalls where the first localDb operation should be occurring. In my case the problem may be that I am using PersistenceJS for the localDb operations. – Wytze Mar 15 '12 at 12:56
  • @Wytze Hi, ultimately the solution for me was to change the DB size down to the maximum 5MB for sim purposes. For some reason, the sim is restricted to the common 5MB limitation, whereas the iPad is not. So, the DB initialization was always failing and stalling the rest of the app. I was able to increase the size limit beyond the 5mb for testing on the actual iPad, at which point I stopped using the sim. Hope this helps. – robert smith Mar 15 '12 at 16:21
  • Thanks Robert, my db is programmatically limited to 5MB and is empty when the user first opens the app. So that can't be the problem. – Wytze Mar 15 '12 at 16:32

2 Answers2

0

Cold your problem be related to this? http://phonegap.com/2012/04/18/ios-5-1-and-the-embedded-uiwebview-with-cordova/

Stefano
  • 99
  • 6
0

I was facing a similar problem with PhoneGap and iOS Simulator last week, all the code i wrote seem to have no problem,

anyway i tried this remote web inspector, and tried to create a database remotely using Safari Javascript Console,

bottom line I found that I was not able to create web database using iPhone Simulator, looks like you need to deploy your app onto your device to make use of it.

I might be wrong, but that was what I found.

Anas Nakawa
  • 1,977
  • 1
  • 23
  • 42