Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Cordova 3.0.0 #12

Open
jonathannaguin opened this issue Aug 28, 2013 · 6 comments
Open

Support for Cordova 3.0.0 #12

jonathannaguin opened this issue Aug 28, 2013 · 6 comments

Comments

@jonathannaguin
Copy link

Any plan to support the new version of Cordova PhoneGap 3.0.0?

Thank you

@marcucio
Copy link
Owner

I won't be making too many changes until we circle back around to updating our windows phone app (it might be a few months). At this time we probably will update for Cordova 3. In the meantime I am willing to take any updates from other people if anyone else wants to tackle this.

@andmar8
Copy link

andmar8 commented Sep 29, 2013

Hey, I'd just like to report that I have succesfully managed to port your code to a cordova 3.0.0 plugin.

Basically the main problems with the current code are....

  • compiling up and deploying the right sqlite library
  • adjusting the SqlitePlugin.cs and sqlitePlugin.js open functions to correctly pass and deserialize JSON

I'm intending to create a new repository soon...

https://github.com/andmar8/Cordova-WP-SqlitePlugin

@marcucio
Copy link
Owner

Thats great, let us know when it is posted so that I can incorporate the changes

On Sep 29, 2013, at 7:56 AM, Andrew Martin [email protected] wrote:

Hey, I'd just like to report that I have succesfully managed to port your code to a cordova 3.0.0 plugin.

Basically the main problems with the current code are....

compiling up and deploying the right sqlite library
adjusting the SqlitePlugin.cs and sqlitePlugin.js open functions to correctly pass and deserialize JSON
I'm intending to create a new repository soon


Reply to this email directly or view it on GitHub.

@andmar8
Copy link

andmar8 commented Sep 29, 2013

The plugin project layout is quite different to the phonegap 2.x plugin as it uses the new plugin system where you create a plugin.xml and have a .js www and .cs src directories, so you may have to wade through it. However, what it does mean is you "could" unify the android, ios and wp8 version of this same plugin into 1 downloadable plugin :)

Thanks for writing this stuff though, never would have gotten this far without it!

@brodycj
Copy link

brodycj commented Sep 29, 2013

@andmar8 first, I would like to express a big thank you on behalf of all community users. I have also spent a lot of the weekend getting this plugin to work with Cordova 3.0 but in a different way:

  • Started with a Cordova 2.7 project, added almost all of the source files from csharp-sqlite_3_7_7_1_71.zip and added a long set of defines to get it to build and run the test program by @marcucio, with an adaptation to print the contents of the data retrieved.
  • Edited the files to build without any extra defines and verified using the test program again.
  • made plugin.xml to include more than 80 files adapted from csharp-sqlite together with SQLitePlugin.cs and a version of SQLite.cs adapted from https://github.com/peterhuene/sqlite-net
  • I encountered an issue with JSON in the open() function on the plugin and for now got around it by just passing the db name as a string.

Then the test ran OK for me.

The positive of this (my) approach is that we can provide a truly compliant sqlite plugin for 3.0. The downside is that this could be a bit messy to maintain. I do plan to share my changes pretty soon but would really rather clean it up a little first.

I had already started to distribute the Android & iOS versions together. @ef4 (Edward Faulkner) had already contributed a fail-safe transaction mechanism for the iOS version, and I get it working also for the Android version. I am planning to get it working with the WP8 version as well and then it should be possible to distribute all three versions together.

Something else: I believe that both of our dependencies sqlite-net and csharp-sqlite were designed to work with both WP7 and WP8. So far I have only tested with WP8.

Chris

@andmar8
Copy link

andmar8 commented Sep 29, 2013

Hi brody bits, I just pushed my plugin code with full instructions to here...

https://github.com/andmar8/Cordova-WP-SqlitePlugin

  • I started out by adapting the @marcucio example and adding a phonegap 2.6 project to the example, I've ended up with a sqlite dll that you add to a phonegap project (i.e. more the correct way round)
  • Have a look at my SQLitePlugin.cs, I hope it's a better way to get the JSON through to the open command, I followed the advice here...

http://docs.phonegap.com/en/3.0.0/guide_platforms_wp8_plugin.md.html#Windows%20Phone%20Plugins_common_pitfalls

I'm glad to hear that the android and ios is already together, hopefully you should (at least) be able to take inspiration from my approach, it may be a little less messy than how you've done it (if I may be so bold!!!)

I very much would like to see this plugin developed against a better sqlite library ( the official microsoft one on nuget would make the most sense??), but I don't understand enough of the code to do it myself.

EDIT: just tested my docs including downloading plugin from git, works perfectly :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants