I am new to ionic. Last week i have published my app to android play store. here is some details:
App similar to Instagram (Load image and user can like the image)
I am using LokiJs as data storage
Crosswalk browser to improve the performance a lot,
But after sometimes, i realize that the data storage of the app grow quite fast, from 0MB to about > 100mb in a day. I did some testing by navigate from tab to tab, it looks like everytime i navigate, data storage will increase. Is it normal? anyone have any idea with this behaviour? let me know if need more information.
Even after force quitting the app, the Data is not cleared and will increase further.
Our app also works with lots of images and therefore I think there is some cache mechanism. Maybe coming from Ionic or even crosswalk…
I have seen the same too when using crosswalk, the standard droid webview seems to not exhibit the problem. Kind of rough seeing as using crosswalk fixes issues with app functionality and then shoots the older device in the head by filling storage pretty rapidly.
Will try the onpause fix zwacky linked at some point.
have tried ur solution, i added the code at:
CordovaActivity.java
/**
Called when the system is about to start resuming a previous activity.
*/ @Override
protected void onPause() {
super.onPause();
LOG.d(TAG, “Paused the activity.”);
if (this.appView != null) {
// CB-9382 If there is an activity that started for result and main activity is waiting for callback
// result, we shoudn’t stop WebView Javascript timers, as activity for result might be using them
boolean keepRunning = this.keepRunning || this.cordovaInterface.activityResultCallback != null;
this.appView.handlePause(keepRunning);
this.appView.clearCache(true);
}
}
tried with few android devices 4.4 and 5.0 and working fine so far, data stop growing like mad.