Reputation: 1653
I've a published game in Unity. Now I want to release an update with Java/Android instead.
The problem is that I want to import the existing game settings. In Unity docs is written:
On Android data is stored (persisted) on the device. The data is saved in SharedPreferences. C#/JavaScript, Android Java and Native code can all access the PlayerPrefs data. The PlayerPrefs data is physically stored in /data/data/pkg-name/shared_prefs/pkg-name.xml.
The question is that Unity saves data in which key? I tried:
SharedPreferences sharedPreferences = this.getSharedPreferences("com.mycompany.app", Context.MODE_PRIVATE);
Map<String, ?> allEntries = sharedPreferences.getAll(); // it returns nothing
also I tried to access that file:
File file = new File("/data/data/com.mycompany.app/shared_prefs/com.mycompany.app.xml");
boolean exists = file.exists(); // it doesn't exist
How to access Unity settings from Java/Android?
Upvotes: 0
Views: 1351
Reputation: 4323
This is how you can take a look at the stored Shared Preferences for yourself.
data/data/your_package_name/shared_prefs
Upvotes: 2