Android 11 in UE4

Since Android 11 provides new Privacy norms to follow this makes it difficult for UE4 games to create folder in Android Environment due to which many users face problem related to writing and reading their .SaveGame.

Their are two ways to get rid of the Problem :
1. To ask user for new Permission which will not only provides the app to access Media Contents but also all files management permissions but the problem with this is that it requires MANAGE_EXTERNAL_FILES for which you have to review your app from playstore whether it already published or not which is a Tedious process(Started 2nd October '21).


DISADVANTAGE:
The Default popup give a bad look to your game as it make your app suspicious when asking user to provide you with permission on their own risk

2. The best way is to modify Engine Code to save your game inside your APP cache folder which if you use Unreal's getcachedirectory() it would provide you with the path which is inside UE4game/{yourproject} therefore you will have to manually add your app's caceh directory which would be

/storage/emulated/0/Android/data/{YOUR_UE4_PACKAGE_NAME}
for example:
/storage/emulated/0/Android/data/com.rearandroid.plugins

STEPS:

1. Open yourUE4 Engine Code in VS
2. Search for savegamesystem.h and edit as follow.you may change the .savegame extention to userspecific name.
3. then compile and you are good to go.
IMPORTANT : these changes to the Engine Code will not affect other Platform.
 

newchange.png

NOTE:
change "/storage/emulated/0/Android/com.udemy.teachandroidue4 -> "/storage/emulated/0/data/Android/YOUR_PACKAGE

pp.jpg

for any query contact us at our RearAndroid
https://discord.gg/QpJubTmPze





Written by Mike Srinivas alias HarshGoda
22th Decemeber , 2021

UE4 - Microsoft Visual Studio 11_24_2021 9_22_09 PM.png