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

  • What's the difference between curly braces and normal brackets in RxJava with Kotlin
  • Blending two images together with multiply and % opacity
  • Unable to compile NME for Android
  • How do I intercept button presses on the headset in Android?
  • CertPathValidatorException: Trust anchor for certification path not found
  • build.gradle is secured from decompilation?
  • Related posts:

    Android 4.2: back stack behaviour with nested fragments
    Custom converter for Retrofit 2
    What are the main differences between a register-base VM vs a stack-based one?
    Meaning of Android Studio error: Not annotated parameter overrides @NonNull parameter
    How to override (or hide) style attributes defined in the Android library project?
    Android Gallery fullscreen
  • How to Avoid Launching the Android Application Twice ,Running from Eclipse to real device
  • layout_below item inside included layout
  • Android resources by gender
  • Android: can't see ACTION_MOVE/UP in onTouchEvent of a RelativeLayout
  • Android - Google Maps routing
  • How to completly kill/remove/delete/stop an AsyncTask 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.