Storing data locally

i want to store some information locally in my app.
i have used indexedDb but it support android version upper than 4.3 .
dexie also have some compatibility issue with apache cordova hybrid app.
plz suggest some other database.

There are many options:

like angular-forage --> it checks if indexeddb, websql, etc is available and uses the best one for the device/environment

LokiJS is a lightweight and fast inmemory db. On mobile devices it uses the filesystem to store the data persistent and in the browser it uses localstorage.

And old but stable --> sqlite plugin and store your data in sql-databases/tables on the mobile device.

Or you can use crosswalk to deliver a modern webview to old devices :slight_smile:

And here is an excellent tutorial of you decide to use LokiJS + the corresponding adapter. Click here.

1 Like

in browser how can i check that lokijs is creating Database?
and can you give me link to lokijs tutorials @luukschoen

Hi @karanvirk, if you read carefully, you can see that the link was in my previous post :-). You can find the tutorial here.

Unfortunately you can’t check this in the browser, since this technique can only be used on your device. Using the cordova adapter and plugin makes your local database persist the data on your device, which prevents the device from clearing the data you want to store locally. So you definitely want to develop ‘live’ on your device, also for debugging.

can we check sqlite DB in browser @luukschoen

for android apps db file is stored in data/data/packagename/databases/yourdatabase.db

If you using emulator you can grab this file using adm i.e monitor

but if you want to grab it from device then your device should be rooted !

Once you grab the db file thr are add ons for browser to check the database !

I use sqlite manager addon for mozilla

now i am using PouchDb, i can check it’s database in chrome browser.
but not able to find command to fetch that data. @Sumeet123