Get all SharedPreferences names and all their keys?

Get all the _preferences.xml from

/data/data/(package)/shared_prefs/(package)_preferences.xml

Parse the XML, in the XML there is name for every key. I might misunderstood your question


Use the sharedPreference.getAll(); which returns a Map.


Don't think it is possible, You can't read other apps /data/data/ folder. On the emulator you can read them because you have root access.


Try this:

    Map<String, ?> allPrefs = prefs.getAll(); //your sharedPreference
    Set<String> set = allPrefs.keySet();
    for(String s : set){
        LOG.d(TAG, s + "<" + allPrefs.get(s).getClass().getSimpleName() +"> =  "
                + allPrefs.get(s).toString());
    }