Question

Now I make a trial application. I'd like to store IMEI and other info in Android permanently. And I don't want to lose them after uninstalling it.

I tested with shared preference but it deletes after un-installation.

          SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
      SharedPreferences.Editor editor = settings.edit();
      editor.putBoolean("silentMode", true);                  

      // Commit the edits!
      editor.commit();

let me know where to store.

Was it helpful?

Solution

You can do it the way reflog wrote in his comment.

If you are accessing the imei have a remote web service that accepts the imei as an input and supplies your app with informations like trial expired, and stuff like that. In that way the user has to go through some efforts on every start to have the application running if it is expired. There are two problems with this approach

  • Your app wont run if the user has no internet connection. Even if your app does not need network you can't start the app without a data connectin.

  • Some users dislike the idea of their imei being send away to a remote server. The imei is a very private piece of data that identifies this user and could be used for all kind data analysis.

OTHER TIPS

SharedPreferences are removed together with the application. If you target the 2.2 platform, a new 'backup' API is added specifically for this purpose. Otherwise - you are stuck with storing the information on the SD Card.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top