Android: Find suitable folder for the app data and debugging
-
Hello I am a beginner with Android.
I need a folder with the following feature.
- accessable from outside (SMTB) -Windows Explorer - debugging - see log files etc.
- Data should be persistent over the app deinstallation
- Full access (read/write/create folder etc.) incl. access to a sqlite database for the app.
After hours of hours dicussion with chat-gpt and a lot of tests I found no working solution.
In the moment, I am in the
/storage/emulated/0/Download/AppName
path.I can put data via Android-Studio in the path. The app can write f.e. my log-file but not access a sqlite database. After some tests I found via QFileInfo, that the DBfile is not readable
If have set the permission READ_EXTERNAL_STORAGE but this changes nothing.What must I do ? How it get the permission ?
Has Android a better folder for this task ? -
Hello I am a beginner with Android.
I need a folder with the following feature.
- accessable from outside (SMTB) -Windows Explorer - debugging - see log files etc.
- Data should be persistent over the app deinstallation
- Full access (read/write/create folder etc.) incl. access to a sqlite database for the app.
After hours of hours dicussion with chat-gpt and a lot of tests I found no working solution.
In the moment, I am in the
/storage/emulated/0/Download/AppName
path.I can put data via Android-Studio in the path. The app can write f.e. my log-file but not access a sqlite database. After some tests I found via QFileInfo, that the DBfile is not readable
If have set the permission READ_EXTERNAL_STORAGE but this changes nothing.What must I do ? How it get the permission ?
Has Android a better folder for this task ?@Andy314 said in Android: Find suitable folder for the app data and debugging:
After hours of hours dicussion with chat-gpt and a lot of tests I found no working solution.
I wonder why :D
/storage/emulated/0/Download/AppName
Why the Download folder?
storage/emulated
is the internal flash memory of your phone (emulated "android" filesystem"). But I don't think "Download" is a suitable place there...READ_EXTERNAL_STORAGE
I would say because the
Download
folder is not in external storage?! -
I figuered out:
The folder is not the problem, the App has full access to it. The problem are rights for the file(s).
If I copy a file via Android Studio, the app has no rights to read it.
Then I have packted the database-file in a resource of the exe and installed it during the app start in a folder. All works fine then.
But every reinstallation of the app removes all rights for the file.
I must activate "deinstall old application befor deployment", because without it I cannot switch between release and debug version.
Whats the common best practise for this problem ?