PDA

View Full Version : Using ST2 + PhoneGap 2.3 + Sqlite database



mobileDev1600
27 Feb 2013, 10:55 AM
Hi,

I want to use the Sqlite database in an app created using ST2 + PhoneGap 2.3. I think that PhoneGap provides Storage APIs to access Sqlite database. How do i access data from PhoneGap API and show using ST2.
Please point me to any article or tutorial or sample.
Thank you

JRS
27 Feb 2013, 2:03 PM
Hi
In the Examples section of the forum Shepsil - has a sqlite proxy and demo for this proxy. I have not used it but this is probably the best way to go.

Good luck

shepsii
1 Mar 2013, 3:14 AM
If you want full on sqlite, rather than websql (which has a 5mb limit) you'll also need to compile to native using phonegap and use a phonegap plugin to get the sqlite db.

mobileDev1600
1 Mar 2013, 6:18 AM
Thanks for the reply. Just want to confirm that if
Shepsil sqlite proxy is based on SQlite or web sql?
I can add SQLite plugin to my PhoneGap app but how do i show that data back on the screen which are designed using ST2?
Is there such example any where????
Thank you

shepsii
1 Mar 2013, 7:16 AM
either - the query language is much the same. I haven't seen a working example of it with actual sqlite as opposed to websql

mobileDev1600
1 Mar 2013, 8:00 AM
Thats very strange!!! No example of SQLite with ST2....
Makes me think if using ST2 is correct choice or not.

shepsii
1 Mar 2013, 8:01 AM
I haven't seen one, not one doesn't exist!

You only need sqlite if you need a db larger than 5mb.

There are plenty of examples of sqlite plugin + phonegap. Then just put your sencha touch app in this environment.

squistbe
10 Apr 2013, 9:42 AM
I am using a the PhoneGap SQLitePlugin for iOS and Android. My application is wrapped in PhoneGap with ST2. The plugin is very similar to Web SQL. I have been able to get it to work. The creator has a great tutorial here (http://brodyspark.blogspot.com/2012/12/integrating-sqlcipher-with.html) and here (http://brodyspark.blogspot.com/2012/12/enhancements-to-sqlcipher-db-classes.html). I am also using SQLCipher to encrypt the database.

shepsii
11 Apr 2013, 6:10 AM
squistbe, which version of phonegap and sencha touch were you using? About to be doing the same in the next month or so and would be very useful to know! Did Sencha Touch's proxy work for you or did you use mine (probably now somewhat outdated!) Thanks

squistbe
11 Apr 2013, 6:37 AM
Sencha 2.0.1.1 and PhoneGap 2.3. I tried to upgrade to Sencha 2.1 in January and there was some performance issues with scrolling so I reverted to 2.0.1.1. PhoneGap is very easy to upgrade. They just released 2.6. They seem to come out with a release every month lately. I am not using Sencha Touch's proxy. I am using SQLite to store my data when offline and then I sync the data when online. You can use Web SQL if you know your database won't exceed 5MB.

vadimv
11 Apr 2013, 10:45 PM
Did Sencha Touch's proxy work for you or did you use mine (probably now somewhat outdated!) Thanks
ST's proxy works fine.

shepsii
16 Apr 2013, 9:32 PM
I've since had a chance to play with it myself and it's working great. I like how it can do the filter on stores before loading the data into javascript memory - different from the localstorage proxy which always loads all records in and then filters in javascript (rather than on the sql query)

JRS
17 Apr 2013, 10:53 AM
Hi Shepsil

Would you be able to write up tutorial on your blog about using the Sql proxy? It would be very helpful. I am trying to download ST 2.2, I recall previously they did not have any documentation at all.
I was planning on using your plug in - but it sounds like ST 2.2 has this working.

Thanks in advance
JRS

shepsii
17 Apr 2013, 11:01 AM
Hey JRS,

on it already! It's very simple really. The main thing I'm trying to explain is the difference between sqlite and websql. I'll have it posted on friday.

ssamayoa
22 May 2013, 12:25 PM
Hi Simon.

Recently I get interested on native packaging and sql proxy but as everyone says there is no much information and/or examples.

Before embark my self in a possible nightmare (I have a lead who wants an Android application and I'm thinking on doing it in ST), do you have any idea on how to persist / retrieve complex graphs?

Say orders with their respective details?

Please some directions and/or help here...

shepsii
22 May 2013, 9:34 PM
I'm working non stop on projects now - it is 100% possible - take a leap of faith! The component parts are there, it just needs someone to glue them together.

sudiptagc
27 Mar 2014, 11:12 PM
I want to use SQLite to store my data when offline and then I sync the data when online. I'm using ST 2.3.1 and building application using "Cordova & PhoneGap with Sencha Cmd 4". link: http://vimeo.com/76568053. My phonegap version is 3.4. Could you please help me someone by providing a sample, tutorial to develop my application following the architecture provided by this sencha build, i.e app.js, app.json, main.js etc.