Setup for Android
Introduction#
The Android version of the Antidote SDK is compatible with various Unreal Engine versions:
- 5.3: supported
- 5.2: supported
- 5.1: supported
- 5.0: supported
- 4.27: supported
- 4.26: supported
- 4.25 and older versions might be supported, but these haven't been officially tested
note
Only C++ projects are currently supported. Blueprint projects are not yet supported.
Setup#
Unreal#
Here's how to integrate the Antidote SDK with your Unreal Engine game on Android:
Download the latest version of Antidote SDK for Unreal.
If you don't have a
Pluginsfolder yet, create it.Unzip the downloaded file
Copy the folder
AntidoteSDKinto your project'sPluginsfolder. The result will be:/YourProject/Plugins/AntidoteSDK/.Generate the project Files.
Close the editor.
Recompile the project in Visual Studio.
Add AntidoteSDK as a dependency in your project's build file. Example:
YourProject.Build.csIn your GameMode's
BeginPlay, initialize the SDK with the desired options. Example:Example: YourProjectGameMode.cppvalidate- verify that the player is authorized to launch the game, and terminate if they aren'tshowTouches- display user touches on screenshowWatermark- enable watermarking
To enable Watermarking, one more step is required.
Add the following to each of your
GameModeclasses:YourProjectGameMode.hOn your
GameModebase class add this code:YourProjectGameMode.cpp
note
If you have multiple GameModes in your project, you have to add the watermark initialization code to each.
Shipping your game#
Antidote SDK requires internet connectivity to verify the user session. If you are exporting your game for Android, please make sure to enable android.permission.INTERNET in your AndroidManifest.xml.
Tips & Troubleshooting#
How to create a GameMode Class#
- Go to Unreal Editor.
- Click
File/New C++ Class. - Scroll down, select
GameMode(Base class of the heads-up display). - Click
Next. - Set the name (e.g YourProjectGameMode).
- Click
Create Class. - Go to
ProjectSettings/Maps & Modes. - Set GameMode to your custom GameMode.
Unreal Editor doesn't start or shows an error regarding a plugin is not found#
- Close Unreal Editor.
- Open the project in Visual Studio.
- Clean Solution.
- Rebuild Solution.
- Open the project in Unreal Editor again.
How to enable internet permission on Android#
By default, if Unreal detects that you are using a network API, it will enable the INTERNET permission in your AndroidManifest.xml. Unfortunately this detection sometimes fails. In such cases we can force the permission, following the steps below:
- Go to
Edit/Project Settings. - Under
Platform, selectAndroid. - Go to
Advanced APK Packaging. - Add the extra permission
android.permission.INTERNET.
