Giter Club home page Giter Club logo

identitykit's Introduction

Huawei Identity Demo

The demo App demonstrates Huawei Identity client APIs and usages.

Documentation can be found at this

link.

Table Of Content

Introduction

The demo implements the HUAWEI Identity API to obtain the user address interface, and assembles and returns the selected address information to the interface.

Getting Started

1. Register as a developer.
Register a [HUAWEI account](https://developer.huawei.com/consumer/en/).
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 (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. For details, please refer to [Preparations for Integrating HUAWEI HMS Core](https://developer.huawei.com/consumer/en/codelab/HMSPreparation/index.html)

Enviroment requirement

Develop requirement

To be able to develop, build and debug this demo, you will need at least the following environment:

  • a connection to Internet, for downloading package dependencies form Huawei and Google

  • a compatible IDE, Android Studio is recommended.

  • a gradle installation will be downloaded when you use command line gradle wrapper or open downloaded folder in compatible IDE

  • an Android SDK installation, API version 28 or above is recommended.

Runtime requirement

To be able to run this demo, you will need an Android device with EMUI 5.0 or above, Android 4.4 and above, with Huawei Mobile Service (HMS) pre-installed.

If the HMS is missing, the device will prompt you to install or upgrade HMS first on calling Identity SDK.

Installation

  1. Clone or download this project and open the downloaded folder in Android Studio or compatible IDE.

  2. use IDE's functionality to install configured project on to your device.

Configuration

This demo come with pre-configured agconnect-services.json, HMS dependencies, signing keys and in-app products. These pre-configured settings are for demo purpose only, please refer to the Documentation for guide of adopting Huawei Identity.

Tutorial

  1. Once you start the demo, you should be able to see the following page.

mainpage

  1. Click to get Huawei User Address button. After selecting the specific address, click OK. The following result will be displayed.

resultpage

Code Examples

Obtaining a User Address

  1. Instantiate the request object by using the new UserAddressRequest method. Then, call the getUserAdddress API. The code location is in the getUserAddress method in the src/app/src/main/java/com/huawei/demo/identitydemo/MainActivity.java file.

  2. Display the address selection page by calling the startActivityResult method of Status. The code location is in the startActivityForResult method in the src/app/src/main/java/com/huawei/demo/identitydemo/MainActivity.java file.

  3. After the user selects an address, call the parseIntent method of UserAddress in onActivityResult of the page and obtain the address from the returned result. The code location is in the onActivityResult method in the src/app/src/main/java/com/huawei/demo/identitydemo/MainActivity.java file.

License

This demo is licensed under the Apache License, version 2.0.

identitykit's People

Contributors

liaoxiaojia avatar houweilong1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.