Android
#
Editor 2019 and above version import#
Step 1: In Project Setting, check the ticked part in the figure below to generate the files required for Android compilation.#
Step 2: Introduce GradlebaseProjectTemplate.gradle
Introduce the required Maven library into the file, and the reference of the Maven library shall be subject to the code generated by the packaging platform#
(1)Example
Developers need to confirm that the integrated SDK is correctly added to the project according to SDK DownLoad Platform.
For example: to access the IronSource SDK, developers need to check the IronSource advertising platform for the packaging platform, and then click to generate code.
- Copy the repository in the Gradle reference repositories to
baseProjectTemplate.gradle
the file. See the sample code below for the specific location.
mainTemplate.gradle
and advertising platform in the file#
(2)Configure Gradle Example
- Copy the Gradle dependencies in the Gradle reference dependencies to
mainTemplate.gradle
the file. See the sample code below for the specific location.
#
Step 3: Configure manifest file#
(1)AndroidManifest.xml- Step 1: Declare permissions. Development can add permissions according to the access platform.
- Step 2: Apache Compatibility
- Step 3: Configure the statement and develop the code generated according to SDK DownLoad Platform to add it (there are screenshots below)
- For example: SDK DownLoad Platform chooses to access Tencent Youlianghui. The AndroidManifest.xml part of the manifest file will generate the providers required by Tencent Youlianghui . Developers can add them directly according to the third step of the sample code.
#
(2)LauncherManifest.xml- Step 1: Add hardware acceleration for video ads
- Step 2: Add Network Security Profile
- Add network_security_config.xml in the Assets\Plugins\Android\res\xml folder of the project, with the following content:
#
Step 4: AndroidX configuration- The AndroidX project needs to be added, and the Support project can be ignored directly.
- Add configuration in the above file gradleTemplate.properties
#
Step 5: Confusing configuration- Add obfuscation configuration in the file proguard-user.txt above
- After minifyEnabled is turned on, TP-related classes and methods can be found normally, otherwise the release package request advertisement will fail.
#
Step 6: Resource OptimizationThe resources of the advertising SDK cannot be confused. If you use a third-party resource optimization framework, please configure the resources of the SDK as a whitelist, for example: