5 Star 4 Fork 2

华为移动服务 / hms-ads-demo-kotlin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 3.35 KB
一键复制 编辑 原始数据 按行查看 历史
chenqiuwei 提交于 2022-12-15 14:10 . Update README.md

Petal Ads Demo for Kotlin

English | 中文

Table of Contents

Introduction

The HuaweiAdsSdk_Demo program demonstrates how to integrate the Petal Ads SDK into an Android app and display ads.

Installation

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

Supported Environments

HMS Core (APK) 4.0.0 or later has been installed on Huawei Android phones.

Sample Code

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:

  1. BannerActivity.kt Loads and displays banner ads.
    Code location: HuaweiAdsSdk_Demo\app\src\main\java\com\huawei\hms\ads\sdk\BannerActivity.kt

  2. NativeActivity.kt Loads and displays native ads.
    Code location: HuaweiAdsSdk_Demo\app\src\main\java\com\huawei\hms\ads\sdk\NativeActivity.kt

  3. RewardActivity.kt Loads and displays rewarded ads.
    Code location: HuaweiAdsSdk_Demo\app\src\main\java\com\huawei\hms\ads\sdk\RewardActivity.kt

  4. InterstitialActivity.kt Loads and displays interstitial ads.
    Code location: HuaweiAdsSdk_Demo\app\src\main\java\com\huawei\hms\ads\sdk\InterstitialActivity.kt

  5. SplashActivity.kt Loads and displays splash ads.
    Code location: HuaweiAdsSdk_Demo\app\src\main\java\com\huawei\hms\ads\sdk\SplashActivity.kt

  6. ConsentActivity.kt Collects user consent.
    Code location: HuaweiAdsSdk_Demo\app\src\main\java\com\huawei\hms\ads\sdk\ConsentActivity.kt

  7. ProtocolActivity.kt Collects user consent on privacy terms.
    Code location:HuaweiAdsSdk_Demo\app\src\main\java\com\huawei\hms\ads\sdk\ProtocolActivity.kt

Question or issues

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:

  • Stack Overflow is the best place for any programming questions. Be sure to tag your question with huawei-mobile-services.
  • Huawei Developer Forum HMS Core Module is great for general questions, or seeking recommendations and opinions.

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.

License

HuaweiAdsSdk_Demo is licensed under the Apache License, version 2.0.

Kotlin
1
https://gitee.com/hms-core/hms-ads-demo-kotlin.git
git@gitee.com:hms-core/hms-ads-demo-kotlin.git
hms-core
hms-ads-demo-kotlin
hms-ads-demo-kotlin
master

搜索帮助