I have permission issue on Android 6.0 and above.
The game I'm working on uses permission WRITE_EXTERNAL_STORAGE. On Android 6.0 and above, a warning is issued that asks the user to allow it.
I received a request to get rid of this warning, which means that the game can no longer use WRITE_EXTERNAL_STORAGE.
Technically, the game does not write or read external storage anywhere now. All saved and cached files are stored in the application directory (/storage/emulated/0/Android/data/com.company.productname) But the game must read (and sometimes load) the OBB file, which is stored in the / storage / emulated / 0 directory /Android/obb/com.company.productname.
The game has access to this directory, even without WRITE_EXTERNAL_STORAGE or READ_EXTERNAL_STORAGE on devices:
- Motorola Nexus 6
- LG Nexus 5
But it seems he does not have access to this directory:
- Samsung Galaxy S5, S6 and S7
- Nvidia Shield Tablet
I even tested it with Alpha Tests to simulate downloading a game from a store.
When permission is granted for storage (through the application settings), everything works fine.
How is OBB mounted?
In Unreal Engine 4, which I use, uses the C open () function to process the OBB file:
int32 Handle = open(LocalPath, O_RDONLY);
Where LocalPath is the full path to the obb file: /storage/emulated/0/Android/obb/com.company.productname/main.10003.com.company.productname.obb
Questions:
- Do you need READ / WRITE _EXTERNAL_STORAGE to read and download the OBB file?
- If so, how can I get rid of the warning that asks the user for permission.
- If not, why is the Samsung Galaxy S Series creating such problems?
android android-permissions android-expansion-files
zompi
source share