android接入穿山甲广告sdk
时间: 2023-09-14 22:03:22 浏览: 347
为了接入穿山甲广告SDK,您需要按照以下步骤进行操作:
1. 首先,您需要在Gradle文件中限制Gradle版本为3.3.3、3.4.3、3.5.4、3.6.4或4.0.1,以支持Android R标签的引入。
2. 在AndroidManifest文件中添加以下代码,用于启动穿山甲广告SDK的SplashActivity,并设置相关的配置属性:
```
<activity android:name="com.unity3d.player.chuanshanjia.CsjSplashActivity"
android:configChanges="keyboard|orientation|screenSize"
android:screenOrientation="sensorLandscape"
android:theme="@style/Theme.Splash">
<!-- android:theme="@android:style/Theme.Black"> -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<!-- 表示在点击app图标的时候启动此Activity -->
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
```
3. 如果您的应用需要在Android 7.0及以上环境中运行,还需要在AndroidManifest文件中添加以下代码,用于适配Android 7.0以上的设备:
```
<provider android:name="com.bytedance.sdk.openadsdk.TTFileProvider"
android:authorities="${applicationId}.TTFileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
```
以上就是接入穿山甲广告SDK的一般步骤,请根据您的具体情况进行配置。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Android 如何接入穿山甲广告?](https://blog.csdn.net/YoungOne2333/article/details/126381155)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [Android 接入穿山甲SDK之开屏广告](https://blog.csdn.net/qq_41973169/article/details/125428479)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文