Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hms-core/hms-ads-demo-java

HUAWEI Ads SDK sample code. HUAWEI Ads SDK provides the banner, native, rewarded, interstitial and splash ad formats for integration.
https://github.com/hms-core/hms-ads-demo-java

ads ads-kit ads-sdk hms hms-ads hms-ads-demo

Last synced: 5 days ago
JSON representation

HUAWEI Ads SDK sample code. HUAWEI Ads SDK provides the banner, native, rewarded, interstitial and splash ad formats for integration.

Awesome Lists containing this project

README

        

# Petal Ads Sample Code (Java)
English | [中文](https://github.com/HMS-Core/hms-ads-demo-java/blob/master/README_ZH.md)
## Contents

* [Introduction](#Introduction)
* [Installation](#Installation)
* [Configuration](#Configuration)
* [Environment Requirements](#Environment-Requirements)
* [Sample Code](#Sample-Code)
* [Running Result](#Running-Result)
* [License](#License)

## Introduction
The Java sample code provided by Ads Kit describes how to display ads by integrating the Petal Ads SDK into your Android app.

## Installation
Install the sample code on a Huawei phone.

You can use HMS Toolkit to quickly run the sample code. HMS Toolkit supports one-stop kit integration, and provides functions such as free app debugging on remote real devices.
To learn more about HMS Toolkit, please refer to the [HMS Toolkit documentation](https://developer.huawei.com/consumer/en/doc/development/Tools-Guides/getting-started-0000001077381096?ha_source=hms1).

## Configuration Management
N/A

## Environment Requirements
Your Huawei phone has HMS Core (APK) 4.0.0 or later installed.

## Sample Code
The Java sample code provided by Ads Kit integrates the Petal Ads SDK, which offers a range of ad formats including banner, native, rewarded, interstitial, splash, and roll ads. The sample code contains the following files for you to load and display ads and obtain user consent:

(1) BannerActivity.java
Used to load and display banner ads.

Storage path: app\src\main\java\com\huawei\hms\ads\sdk\BannerActivity.java

(2) NativeActivity.java
Used to load and display native ads.

Storage path: app\src\main\java\com\huawei\hms\ads\sdk\NativeActivity.java

(3) RewardActivity.java
Used to load and display rewarded ads.

Storage path: app\src\main\java\com\huawei\hms\ads\sdk\RewardActivity.java

(4) InterstitialActivity.java
Used to load and display interstitial ads.

Storage path: app\src\main\java\com\huawei\hms\ads\sdk\InterstitialActivity.java

(5) SplashActivity.java
Used to load and display splash ads.

Storage path: app\src\main\java\com\huawei\hms\ads\sdk\SplashActivity.java

(6) InstreamActivity.java
Used to load and display roll ads.

Storage path: app\src\main\java\com\huawei\hms\ads\sdk\InstreamActivity.java

(7) ConsentActivity.java
Used to obtain user consent.

Storage path: app\src\main\java\com\huawei\hms\ads\sdk\ConsentActivity.java

(8) ProtocolActivity.java
Used to obtain users' consent on the privacy statement.

Storage path: app\src\main\java\com\huawei\hms\ads\sdk\ProtocolActivity.java

## Running Result
Banner ads         Interstitial ads        Native ads

Reward ads         Roll ads        Splash ads

## Technical Support
You can visit the [Reddit community](https://www.reddit.com/r/HuaweiDevelopers/) to obtain the latest information about HMS Core and communicate with other developers.

If you have any questions about the sample code, try the following:
- Visit [Stack Overflow](https://stackoverflow.com/questions/tagged/huawei-mobile-services?tab=Votes), submit your questions, and tag them with `huawei-mobile-services`. Huawei experts will answer your questions.
- Visit the HMS Core section in the [HUAWEI Developer Forum](https://forums.developer.huawei.com/forumPortal/en/home?fid=0101187876626530001?ha_source=hms1) and communicate with other developers.

If you encounter any issues when using the sample code, submit your [issues](https://github.com/HMS-Core/hms-ads-demo-java/issues) or submit a [pull request](https://github.com/HMS-Core/hms-ads-demo-java/pulls).

## License
The sample code is licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).