English | 中文
The HuaweiAdsSdk_Demo program demonstrates how to integrate the Petal Ads SDK into an Android app and display ads.
Install the program on Huawei Android mobile phones.
You also can use HMS Toolkit to quickly integrate the kit and run the demo project, as well as debug the app using a remote device for free.
For details, please visit HMS Toolkit。
HMS Core (APK) 4.0.0 or later has been installed on Huawei Android phones.
The HuaweiAdsSdk_Demo program integrates the Petal Ads SDK and provides the pages for displaying banner, native, rewarded, interstitial, and splash ads, respectively. The following classes in the demo are used for loading and displaying ads and collecting user comments:
BannerActivity.kt
Loads and displays banner ads.
Code location: HuaweiAdsSdk_Demo\app\src\main\java\com\huawei\hms\ads\sdk\BannerActivity.kt
NativeActivity.kt
Loads and displays native ads.
Code location: HuaweiAdsSdk_Demo\app\src\main\java\com\huawei\hms\ads\sdk\NativeActivity.kt
RewardActivity.kt
Loads and displays rewarded ads.
Code location: HuaweiAdsSdk_Demo\app\src\main\java\com\huawei\hms\ads\sdk\RewardActivity.kt
InterstitialActivity.kt
Loads and displays interstitial ads.
Code location: HuaweiAdsSdk_Demo\app\src\main\java\com\huawei\hms\ads\sdk\InterstitialActivity.kt
SplashActivity.kt
Loads and displays splash ads.
Code location: HuaweiAdsSdk_Demo\app\src\main\java\com\huawei\hms\ads\sdk\SplashActivity.kt
ConsentActivity.kt
Collects user consent.
Code location: HuaweiAdsSdk_Demo\app\src\main\java\com\huawei\hms\ads\sdk\ConsentActivity.kt
ProtocolActivity.kt
Collects user consent on privacy terms.
Code location:HuaweiAdsSdk_Demo\app\src\main\java\com\huawei\hms\ads\sdk\ProtocolActivity.kt
If you want to evaluate more about HMS Core, HMSCore on Reddit is for you to keep up with latest news about HMS Core, and to exchange insights with other developers.
If you have questions about how to use HMS samples, try the following options:
huawei-mobile-services
.If you run into a bug in our samples, please submit an issue to the Repository. Even better you can submit a Pull Request with a fix.
HuaweiAdsSdk_Demo is licensed under the Apache License, version 2.0.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。