PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, October 16, 2022

[FIXED] How to keep shared preference data after clearing the cache of application from settings

 October 16, 2022     android, clear-cache, sharedpreferences     No comments   

Issue

I have observed that when i click on clear cache in settings>apps>particular app, Shared preference data get deleted.

how to keep shared preference data even if i clear the clear the cache? is it possible? if possible means give idea about that


Solution

It is worth noting that there are three types of data clearing in Android, of which your application has no control over:

  • Clear Data
  • Clear Cache
  • Clear Defaults

The only way to have persistent data is to use the SD card, but again, users won't like to have the data on their card after the app is uninstalled or users can un-mount the SD card.

Or you can consider:

  1. Storing the data on a remote server with some kind of authentication to retrieve it
  2. Using Data Backup service


Answered By - Kartheek
Answer Checked By - Willingham (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing