Relative Content

Tag Archive for androidsharedpreferences

Android SharedPreferences: Data accessible but shared_prefs folder missing

I’m using SharedPreferences in my Android application to store information. I can successfully read and retrieve data using SharedPreferences. However, when I access the /data/data/myapplication/* directory with root privileges, I can’t find the shared_prefs folder.
Here’s what I’ve done so far:

What is the bg_startup_tracing shared preference key that always gets populated for my app on a Samsung Galaxy A13?

I work on an Android app that expects empty default shared preferences in certain contexts. On my Samsung Galaxy A13 running Android 14, that never happens. There is always a bg_startup_tracing key with value false. I programmatically remove it using PreferenceManager.getDefaultSharedPreferences(context).edit().clear().apply(), verify that the preferences are empty, relaunch the app, and it’s always back. This does not happen with an emulator.