Open
Conversation
initial commit
Author
|
/ *
importar android.content.Intent class AccountActivity: LoggerActivity () { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
华为帐号服务客户端Java示例代码
中文 | English
目录
简介
环境要求
开发准备
运行结果
授权许可
简介
Android示例代码对华为帐号服务(HUAWEI Account Kit)的客户端接口进行封装,包含丰富的示例程序,方便您参考或直接使用。详情如下:
hmssample:示例代码包,可实现登录、授权登录、静默登录、退出帐号和帐号取消授权功能。 logger:可实现日志记录。
环境要求
推荐使用Android SDK 23及以上版本、JDK 1.8及以上版本。
开发准备
检查Android Studio开发环境是否就绪。在Android Studio中打开“build.gradle”文件所在的示例代码工程目录,并在您已安装最新版华为移动服务(HMS Core)的设备或模拟器上运行测试应用。
注册华为帐号。
创建应用并在AppGallery Connect中配置相关信息。具体请参考开发准备。
构建此示例demo前,请先将demo导入Android Studio(3.0及以上版本)。
配置示例代码: (1)在AppGallery Connect下载您应用的“agconnect-services.json”文件,将该文件拷贝到应用级根目录下。 (2)修改示例工程中应用级“build.gradle”文件中的“applicationid”为您自己的应用包名。
在Android设备或模拟器上运行您的应用。
运行结果
本示例代码提供了以下使用场景:
ID Token模式登录。
Authorization Code模式登录。
静默登录。
退出帐号。
帐号取消授权。
image.png
授权许可
华为帐号服务Android示例代码经过Apache License 2.0授权许可。