View an Android App's shared preferences?

When I am working on my app in eclipse, is there a way to see the changes I make to the shared preferences of the app while it is debugging in the emulator? Thanks in advance

  • ViewPager as a circular queue / wrapping
  • Android transparent overlay toolbar
  • Is it possible to have multiple styles inside a TextView?
  • Can anyone confirm this issue (limited number of file descriptors on some Android devices)?
  • Android : How to set acceptable numbers and characters in EditText?
  • How to make a Transparent Layer over the CardIView Item?
  • Related posts:

    Is it possible to add an array or object to SharedPreferences on Android
    Properly start Activity from Notification regardless of app state
    Proper way to know whether an Activity has been destroyed
    how to remove shared preference while application uninstall in android
    How to make a custom private plugin in phonegap
    Dial Number Without Prompt
  • Android 'Unable to add window — token null is not for an application' exception
  • Do Google Maps API limits apply to Android applications?
  • CoordinatorLayout overlapping
  • How to use camera flash/led as torch on a Samsung Galaxy Tab?
  • How to layout text to flow around an image
  • Loading an image using OpenCV in Android
  • 2 Solutions collect form web for “View an Android App's shared preferences?”

    Run project in emulator, then from Eclipse choose menu Windows-> open perspective ->DDMS.
    From tab device, choose emulator name, then go to file explorer,expand data->data->yourpackagename, you should see share reference xml file (only work on the emulator or a rooted device). Finally, export this file to windows.
    See http://developer.android.com/tools/debugging/ddms.html

    Update:
    Another way, you can listen shared preference change:

    SharedPreferences.OnSharedPreferenceChangeListener prefListener = 
    new SharedPreferences.OnSharedPreferenceChangeListener() {
      public void onSharedPreferenceChanged(SharedPreferences prefs,String key) {
    if (key.equals("YourKey")) 
         {
              //Get this
         } 
     }
    
    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);          
    preferences.registerOnSharedPreferenceChangeListener(prefListener);
    

    See SharedPreferences.onSharedPreferenceChangeListener not being called consistently

    Running on emulator –> Go to file explorer –> data/data/yourapplication’s package/Sharedpreferences.xml can be seen

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.