Handling user settings on file, how?


#1

Ok, I created my first APP, it runs on the Virtual and also a Real phone. :slight_smile: Now I added the properties file but it doesn’t get saved or maybe even created. I tried to search the file but couldn’t find it… maybe is the way Android works, so I need to learn that…

PropertiesFile::Options propOptions;
propOptions.applicationName = "7 Segments";
configFile = File(File::getSpecialLocation(File::SpecialLocationType::commonDocumentsDirectory).getFullPathName() + "Seven Segments Settings.xml");
userSettings = new PropertiesFile(configFile, propOptions);

#2

To access files outside the sandbox, the app needs to ask for permission using the RuntimePermissions class. On most folders I was using, including userDocumentsDirectory and userMusicDirectory I needed to request RuntimePermissions::writeExternalStorage

I would try different locations, if you can find some inside the app’s sandbox, maybe userApplicationDataDirectory, but I am not an Android expert.


#3

Oh yeah, thank you so much!