Skip to Navigation | Skip to Content



EDGE UPDATE: Android 1.x Database Storage | December 8th, 2009

I just finished the basic version of Android 1.6 Database Storage for PhoneGap. Unlike Android 2.0, which has a proper implementation of this, Android 1.6 does not. There are definitely numerous bugs that can happen with this implementation of Database Storage, such as mis-formatted numbers being passed into Javascript due to what SQLite sends back to the browser, however I’ve tried to mimic the HTML 5 spec the best I could with Java and JavaScript.

Now, the code being passed is VERY primitive, and it’s not well documented. Android is notorious for having this weird API in the providers that gets in the way of you and your SQLite Database. Providing a mapping from Javascript to the rawQuery seems to have made the most sense. We have yet to add a fail condition to this yet, so when it fails, it will fail silently. That’s somewhat annoying when it comes to errors in SQL syntax, and we’ll try to hammer out that bug later this week.

Posted in Android, phonegap | 7 Comments » | Add to Delicious | Digg It

This entry was posted on Tuesday, December 8th, 2009 at 7:15 pm and is filed under Android, phonegap. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

7 Responses to “EDGE UPDATE: Android 1.x Database Storage”

  1. Mark Darbyshire Says:

    It’s very exciting to hear about your progress on Android.

    Is the stuff you’ve been working on available in Edge? So far I’ve been trying to get stuff working on Android 1.5 by using what I checked out of the android_1.5 branch a week or so ago. I’d love to switch to a more up-to-date version of PhoneGap with support for as much as possible on Android 1.5, but at the moment the default project in Edge crashes when run on Android 1.5. Are you able to advise on what I should check out or when what you’ve been working on will be available to try using?

    Thanks for all the great work you’ve been doing. :)

  2. Joe B Says:

    It’s all in EDGE. The Android 1.5 branch was created before I decided to mess with Java Reflection.

  3. kaptron Says:

    I’m using the latest EDGE as well and it crashes in 1.5 for me too. It says “The application PhoneGap (process com.phonegap) has stopped unexpectedly.Please try again”

    logcat says: “E/AndroidRuntime( 848): Uncaught handler: thread main exiting due to uncaught exception
    E/AndroidRuntime( 848): java.lang.VerifyError: com.phonegap.DroidGap” …

    Not sure if it is related but when the app first pops up in 2.0 it gives an error about application Android Keyboard fail (process com.android.inputmethod.latin).

    Anyway, just reporting what I’ve found. Otherwise I’ve been playing with the latest versions in the 2.0 emulator and it’s been great, keep up the awesome work.

  4. Joe B Says:

    kaptron: Can you let me know how you’re trying to run it? Usually verify errors happen when there’s an error in the AndroidManifest.xml

    That being said, I don’t usually run PhoneGap in the PhoneGap directory EXCEPT for debugging. Instead, I build a jar and run the build.rb ruby script to generate ready-made Android applications that I can customize later. This works very well, and I’ll blog about it when I get the chance.

    As far as keyboard errors, that has nothing to do with us. We don’t mess with any of the input methods on Android, we just catch events from the menu keypress.

  5. Alex Drofa Says:

    Edge version of phonegap used constants which are not present in Android 1.5 , that’s why verification fails
    That’s why we have verification error and can’t start it on 1.5

    if (android.os.Build.VERSION.SDK_INT <= android.os.Build.VERSION_CODES.DONUT)

    Build.VERSION.SDK_INT - starting from 1.6
    Build.VERSION_CODES.DONUT - also seems starting from 1.6

  6. Joe B Says:

    Then why don’t you submit a patch if you feel it’s necessary?

  7. Mare Says:

    Any news on this incompatibility with 1.5??

Leave a Reply