Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Peter_S_
Beginner
65 Views

Storing locally data retrieved from web

Hi,

I would like to build a simple news app with Intel XDK. I use jQuery function " .load" to retrieve data from a web page. But the matter is to store data in the mobile phone, so that it will still appear even when there is no connection. Could someone help me to do so?

Thanks!

Tags (2)
0 Kudos
5 Replies
PaulF_IntelCorp
Employee
65 Views

There are a variety of options. I would checkout the options in this google search, in particular, this article may be of value > https://www.joshmorony.com/a-summary-of-local-storage-options-for-phonegap-applications/ < written by a developer who is very well acquainted with Cordova.

David_S_15
New Contributor I
65 Views

Hi Peter. There are quite a few options for storing data in HTML5 apps and Cordova apps. This link may be helpful. https://cordova.apache.org/docs/en/latest/cordova/storage/storage.html

The method you end up choosing depends on the format you want to store your data in and the size of the data you want to store.

The solution that works on most devices/platforms without plugins is LocalStorage but has some size restrictions and the format of the data is restricted to text (or json). WebSQL and IndexedDB may not work on all the devices you are targeting but gives you some more flexibility on what you can store and how much. You may get the most luck and cross platform support from using the File Plugin in your Cordova build settings https://github.com/apache/cordova-plugin-file/blob/master/README.md I belevie the File plugin is one of the default options that you can just select as a checkbox in the settings of your build. You will not be able to test a plugin based version well until you build the app for your phone but it should give you the best option for storage.

Peter_S_
Beginner
65 Views

Hi Paul, Hi David. Thank you for your answers, and I apologize for taking too long to answer. After reading your answers and doing some additional research, I retained the plugin intel.xdk.cache and the plugin cordova-file. I would like to know what differentiates them and which would you advise me?

PaulF_IntelCorp
Employee
65 Views

I recommend you find an alternative to intel.xdk.cache (see the suggestions made by David in his post). That plugin is no longer maintained and many of those old xdk plugins have trouble with newer versions of Android and/or Cordova.

The plugin-cordova-file is a core Cordova plugin, so it is regularly updated and maintained by the Cordova project.

Peter_S_
Beginner
65 Views

Thank you for your advise.

Reply