The question of local storage
Christian Karasiewicz 270005XS4E Visits (5597)
This blog post is contributed by Megan Irvine, WebSphere Education Course Deve
If you want to create mobile applications that perform well, one thing to consider is how to store data on the client side. This is particularly important for mobile applications because they rely on slower connections and might even need to work in offline mode (not connected to a network). Another requirement is that data must be structured and stored in a way that the mobile application can handle.
In any case, having an efficient mechanism for local storage, or caching, can greatly improve the speed and capability of your application. For example, you can use it to:
Most web developers are familiar with the concept of caching, and a common method in web application development is to use a cookie. However, cookies have limitations. They only allow up to 4 KB of storage, and they pose an issue for security-conscious people and organizations that turn them off.
There are a number of other options to consider for handling local storage in a mobile application, especially if you need to store more than 4-KB chunks at a time. I will describe a couple of them here.
HTML5 local storage
The JSONStore API is currently supported for hybrid applications that run on Android and iOS devices. If you are targeting these platforms, consider using it instead of the Worklight encrypted offline cache feature (EOC). EOC is a good option for cross-platform development, but it uses HTML5 cache, which is not guaranteed to be supported in future versions of iOS. JSONStore uses the same encryption level as EOC, and it provides more advanced capabilities, as I mentioned here.
In summary, Worklight JSONStore is another great tool to have in your arsenal for creating mobile applications with a better user experience.
Megan Irvine is a WebSphere Education Course Deve