Tài liệu · AppsKitSDK (AKS) — Hướng dẫn tích hợp Android
2. AndroidManifest.xml
Manifest riêng của AKS chỉ khai báo:
xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />Các quyền này được tự động hợp nhất vào manifest của ứng dụng thông qua trình hợp nhất manifest của Gradle — bạn không cần tự thêm chúng.
Những gì bạn cần thêm vào AndroidManifest.xml của ứng dụng — cả thẻ meta-data chứa AdMob App ID và khai báo lớp con Application tùy chỉnh (xem §5) đều phải nằm trong cùng một phần tử <application>:
xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:name=".YourApplication">
<!-- Required if AdMob/GAM is one of your enabled ad networks. Use your own
AdMob App ID from the AdMob console — it can't be bundled inside AKS
since it's specific to your app. -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-XXXXXXXXXXXXXXXX~YYYYYYYYYY" />
<!-- keep your existing <activity>, <service>, <provider>, etc. declarations here -->
</application>
</manifest>Hãy thêm thuộc tính android:name và thẻ meta-data vào phần tử <application> hiện có thay vì dán đoạn mã này thành phần tử thứ hai — mỗi manifest chỉ được có một thẻ <application>.