SQLitePlugin does not work in development


#1

I need to use a local database and I found SQLitePlugin. The problem is than I can’t use it in development because cordova.js is not really loaded.

Is there a solution?

Thanks!


#2

What do you mean “development”? Are you referring to testing in a web browser?

When you start adding plugins or other native device features into your application, I strongly encourage you to start doing all your testing in a simulator or on a physical device.

Since the SQLite plugin was based on the WebSQL API, here is a little solution to add functionality to the web browser:

You basically check if cordova.js exists (it won’t in a web browser). If it doesn’t exist use WebSQL, otherwise use the SQLite plugin.

Regards,


#3

I cannot use WebSQL because I have to load data from a local database. It its not possible with WebSQL. I will try to use an emulator for now.


#4

me too same problem… did you find a solution ? cause to compile every time is really hard…
thanks


#5

I changed for a native app. I have no solution for you. Sorry.