0

I am creating mobile application using HTML5 (AngularJS, PhoneGap). For local data storage I am using PhoneGap. My application is kind of account management software which required to store lot of relational data on local db. I deployed the application on mobile using command.

cordova run android

I am using following script to data store http://docs.phonegap.com/en/3.0.0/cordova_storage_storage.md.html#Storage

This is working properly but performance is really bad (I having Moto G, Quad Core processor, 1 GB RAM). I fired 3 different select query on local database, and it took almost 2-3 second to process. each 3 table has only 1 rows.

I have seen performance matrices provided here. But to reduce my overall effort I am thinking of using PhoneGap.

So here are my questions

  1. How to improve performance with phoneGap on mobile database?
  2. I checked the db file application creating in emulator. Found that it's sqlite db file. The same database gives very good performance on native android application. How?
  3. Since I am creating mobile application with local database. How suggestive it is to use phonegap database interface?
Community
  • 1
  • 1
Dhiren
  • 592
  • 5
  • 16

1 Answers1

1

Use the Cordova SQLite-Plugin. It should perform much better for your purposes. Native Android also uses SQLite as database.

qefzec
  • 1,360
  • 1
  • 13
  • 13
  • I can be wrong, but I think cordova storage also uses sqlite database (http://docs.phonegap.com/en/3.0.0/cordova_storage_storage.md.html#Storage). – Dhiren Sep 13 '14 at 18:14
  • Nope, as stated on your linked page, they use WebSQL, which is another SQL variant. – qefzec Sep 13 '14 at 18:16
  • I agree to your point but their database creation statement also says "The method creates a new SQL Lite database". – Dhiren Sep 13 '14 at 18:22
  • It does create a Sqlite database. See [here](http://stackoverflow.com/questions/24449640/difference-between-window-opendatabase-and-window-sqliteplugin-opendatabase) for a similar question asked by myself. For Improving the performance why don't you preload the data in the memory? – frank Sep 13 '14 at 18:30
  • Thanks @frank, that answer my 2nd question. It will be great if you help me with 1st and 3rd questions. Please post your answer in answer section. – Dhiren Sep 13 '14 at 18:59