Sasank Sunkavalli Sasank Sunkavalli - 1 year ago 116
Android Question

How to Clear the localStorage of a Cordova app for Android Platform

Im using localStorage(Key-value pairs) for saving the data in my Cordova app. Is there any way to clear the app's localStorage programmatically. One way is to clear the App's Data in Application Manager Settings, But i want to Clear the localStorage programmatically. Instead of using the Clear Data , I'm using ManageSpaceActivity( in my application . Once the Manage Space button is clicked , I have to clear the localstorage. The problem is I don't have WebView instance in ManageSpaceActivity

Answer Source

For this, first you have to find which platform you are..for this read more for this plugin

By this command you will get to know which device you are using

var string = device.platform;

When you will get on which platform you are, you can start working towards.

To clear localStorage of Android platform, use this


For more detail about this, read here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download