Push Kit sample code for Android
English | 中文
Table of Contents
Introduction
In this Demo, you will use the Demo Project that has been created for you to call HUAWEI Push Kit APIs. Through the Demo Project, you will:
- Apply for a token from HUAWEI Push Kit.
- Receive notification/data messages from HUAWEI Push Kit.
For more information, please refer to: https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/push-introduction?ha_source=hms1
Getting Started
- Register as a developer Register a HUAWEI account.
- Create an app Create an app and enable APIs.
- Build the demo To build this demo, please first import the demo to Android Studio (3.X or later). Then download the agconnect-services.json file of the app from AppGallery Connect, and add the file to the app directory (\app) of the demo. You should also generate a signing certificate fingerprint and add the certificate file to the project, and add configuration to build.gradle. For details, please refer to Preparations for Integrating HUAWEI HMS Core
Installation
To use functions provided by examples, please make sure Huawei Mobile Service 4.0 has been installed on your cellphone. way 1. You can compile and build the codes in Android Studio. After building the APK, you can install it on the phone and debug it. way 2. Generate the APK file from Android Studio. Use the ADB tool to install the APK on the phone and debug it adb install {YourPath}\pushkit-android-demo\app\release\app-release.apk
Supported Environment
Android SDK Version >= 23 and JDK version >= 1.8 is recommended.
Hardware Requirements
A computer (desktop or laptop) that runs the Windows 10/Windows 7 operating system A Huawei mobile phone with a USB cable, to be used for service debugging
Question or issues
If you want to evaluate more about HMS Core, r/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
Push kit sample code for android is licensed under the Apache License, version 2.0.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

