Question: Is it possible to use shared preferences on a Samsung Tab E, Android 7.1.1, API 25. Here is my state, results and research so far...
SharedPreferences are not reading from Samsung Tab E, Android 7.1.1, API 25 but works on HUAWEI T377W, Android 10, API 29.
In OnCreate...
SharedPreferences sharedPreferences =
PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
geoCount = sharedPreferences.getInt("geoCount", 0);
In public void finish...
SharedPreferences sharedPreferences =
PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putInt("geoCount", geoCount);
editor.apply();
Followup question: Are OnCreate and finish the best places for this code?
In the both devices the preferences file is not findable...
internal storage/Android/data/gmd.com.mickwebsite.metaquest/files/MetaQuest "nothing"
In Android Studio, Electric Eel, File Explorer... Found it with a correct value in the Huawei phone at... /data/data/gmd.com.mickwebsite.metaquest/shared_prefs
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<int name="geoCount" value="53" />
</map>
Samsung Tablet. Not findable here... /data/data/gmd.com.mickwebsite.myapplication "run as: could not set capabilities: operation not permitted" <- in RED print
There are other file paths that lead to my app but all have the same error message. I googled the error message - I guess I am just unlucky having a Samsung device. Is there a way to get the preferences working? I am assuming that this condition causes my preferences problem in addition to the problems posted by many others about "run as".