5 Star 13 Fork 6

华为移动服务 / hms-push-clientdemo-android

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

Push Kit sample code for Android

Apache-2.0 Open Source Love Open Source Love

English | 中文

Table of Contents


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:

  1. Apply for a token from HUAWEI Push Kit.
  2. Receive notification/data messages from HUAWEI Push Kit.

For more information, please refer to Service Introduction.

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 Integrating Push Kit by HMS Toolkit.

Getting Started

  1. Register as a developer Register a HUAWEI account.
  2. Create an app Create an app and enable APIs.
  3. Build the demo To build this demo, please first import the demo to Android Studio (Chipmunk | 2021.2.1) or later. Then download the agconnect-services.json file of the app from AppGallery Connect, and add the file to the app directory (java language is '/javaapp/', kotlin language is '/KotlinApp/') 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.


To use functions provided by examples, please make sure Huawei Mobile Service 4.0 has been installed on your cellphone. There are two ways to install the sample demo:

  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.
  2. Generate the APK file from Gradle. Use the ADB tool to install the APK on the phone and debug it adb install {YourPath/YourApp.apk}.

Supported Environment

Android targetSdk Version >= 29 and JDK version >= 1.8.211 is recommended.

Hardware Requirements

A computer (desktop or laptop) and 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.


Push kit sample code for android is licensed under the Apache License, version 2.0.


华为推送服务(Push Kit)是华为提供的消息推送平台,建立了从云端到终端的消息推送通道。您通过集成推送服务可以实时推送消息到用户终端,构筑良好的用户关系,提升用户的感知度和活跃度。 expand collapse
Java and 2 more languages


No release





Load More
can not load any more


10d9f8b4 4838521 8bde8327 4838521