Hybrid app database using Cordova

Asked

Viewed 1,837 times

2

What are the possible and most viable solutions to use a database in a hybrid APP (Android/iOS) made on Intel XDK (Cordova)?

2 answers

2


When it comes to Cordova (Android and iOS) the options are as follows:

  • Localstorage
  • Websql
  • Or plugins to store files in memory.

There are other storage methods also possible, if your application uses an Internet connection you can store all the data on a server and receive/send the information via a Webservice.

If you use an external plugin to do this management recommend checking this link

  • Thanks for the answer, exactly what I needed.

1

The most current technology and standard to be adopted for HTML5 development is Indexeddb, although it is not listed on the Cordova website Android and IOS webviews support Indexeddb and support only tends to improve. http://caniuse.com/#feat=indexeddb

I advise you to create a test application and check if the implementations on the devices you need meet your needs.

There are libraries that allow access via the Indexeddb API but in unsupported browsers use Websql to record data, it may be a solution if the device you are developing does not support Indexeddb. An Example is the Pouchdb.

  • Cordova does not yet support Indexeddb on Android and iOS. It is possible to implement, but it causes more problems and it is necessary to adapt the code for each platform. I don’t think he can be considered a hybrid solution =/.

  • @Pedrohenrique You don’t need to use the Cordova API to access Webview native HTML5 resources where the application is running. In this case, you can use a Javascript library to solve data access in a uniform way, which is a viable cross-platform solution. Don’t confuse using Cordova as a packer, and using the Cordova API in the app.

  • Not to confuse this :), I did tests on some applications with Indexeddb and until today only found more problems than advantages, i personally stay away from using implementations dependent on Webkit because I know that one of my users will use an old version of Android without support and also I am not very much in favor of leaving using polyfill’s by the speed of Cordova, whether or not it is slow.

  • Beauty, performance actually suffers when using any kind of polyfill, but still depending on the application I think it can be a good solution. I agree with you that it does not depend on Webkit, but I believe faithfully that Indexeddb will advance as standard. Then I would prefer to use a polyfill and not have to change the sources of the system in the future. In this case it will depend on the use and the developer.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.