3 Star 5 Fork 2

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

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or Download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

HMS Ads Demo for Java

English | 中文

Table of Contents

Introduction

The hms-ads-demo-java program demonstrates how to integrate the HMS Core 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.

Configuration

No additional configuration is required.

Supported Environments

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

Sample Code

The hms-ads-demo-java program integrates the HMS Core Ads SDK and provides the pages for displaying banner, native, rewarded, interstitial, splash ads, and roll ads respectively. The following classes in the demo are used for loading and displaying ads and collecting user comments:

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

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

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

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

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

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

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

8). InstreamActivity.java Loads and displays roll ads.
Code location: app\src\main\java\com\huawei\hms\ads\sdk\InstreamActivity.java

Result

Banner Ads         Interstitial Ads        Native Ads

Reward Ads         Instream Ads        Splash Ads

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

hms-ads-demo-java is licensed under the Apache License, version 2.0.

Repository Comments ( 0 )

Sign in to post a comment

About

华为广告服务流量变现服务为您提供了Banner广告、原生广告、激励广告、插屏广告、开屏广告、贴片广告六种广告形式。此工程指导如何将HUAWEI Ads SDK集成到您的Android应用中。 expand collapse
Cancel

Releases

No release

hms-ads-demo-java

Contributors

All

Activities

Load More
can not load any more
Java
1
https://gitee.com/hms-core/hms-ads-demo-java.git
git@gitee.com:hms-core/hms-ads-demo-java.git
hms-core
hms-ads-demo-java
hms-ads-demo-java
master

Search

182229 41614e54 1850385 182230 7885ed45 1850385