Android sample code encapsulates APIs of the HUAWEI Account Kit server. It provides sample program for your reference or usage.
The following describes of Android sample code.
hmssample: Sample code packages. This package contains code that implements Sign, SignInCode and SignOut.
logger: This packages contains code that implements logger View.
- Check whether the Android studio development environment is ready. Open the sample code project directory with file "build.gradle" in Android Studio. Run TestApp on your divice or simulator which have installed latest Huawei Mobile Service(HMS).
- Register a HUAWEI account.
- Create an app and configure the app information in AppGallery Connect. See details: HUAWEI Account Kit Development Preparations
- To build this demo, please first import the demo in the Android Studio (3.x+).
- Configure the sample code: (1) Download the file "agconnect-services.json" of the app on AGC, and add the file to the app root directory(\app) of the demo. (2) Change the value of applicationid in the app-level build.gradle file of the sample project to the package name of your app.
- Run the sample on your Android device or emulator.
Android SDK Version >= 23 and JDK version >= 1.8 is recommended.
This demo provides demonstration for following scenarios:
1. ID-Token Mode Sign In. Sign in and Id-Token verification are both included.
2. Authorization Code Mode Sign In.
3. Sign out.
Account-kit Android sample is licensed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).