{"id":22441405,"url":"https://github.com/hms-core/hms-awareness-demo","last_synced_at":"2025-08-01T18:32:19.156Z","repository":{"id":44946592,"uuid":"264814067","full_name":"HMS-Core/hms-awareness-demo","owner":"HMS-Core","description":"HUAWEI Awareness Kit provides your app with the ability to obtain contextual information including users' current time, location, behavior, audio device status, ambient light, weather, and nearby beacons. Your app can gain insight into a user's current situation more efficiently, making it possible to deliver a smarter, more considerate user experience.","archived":false,"fork":false,"pushed_at":"2022-04-02T08:17:31.000Z","size":789,"stargazers_count":13,"open_issues_count":1,"forks_count":13,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-04-16T12:54:17.065Z","etag":null,"topics":["android","awareness","consciousness","geofence","hms","java"],"latest_commit_sha":null,"homepage":"https://developer.huawei.com/consumer/en/hms/huawei-awarenesskit?ha_source=hms1","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HMS-Core.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-18T03:19:15.000Z","updated_at":"2024-04-16T12:54:17.066Z","dependencies_parsed_at":"2022-07-17T09:46:21.674Z","dependency_job_id":null,"html_url":"https://github.com/HMS-Core/hms-awareness-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMS-Core%2Fhms-awareness-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMS-Core%2Fhms-awareness-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMS-Core%2Fhms-awareness-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMS-Core%2Fhms-awareness-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HMS-Core","download_url":"https://codeload.github.com/HMS-Core/hms-awareness-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228397819,"owners_count":17913540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","awareness","consciousness","geofence","hms","java"],"created_at":"2024-12-06T02:14:25.663Z","updated_at":"2024-12-06T02:14:26.138Z","avatar_url":"https://github.com/HMS-Core.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HMS AwarenessKit Demo\r\n\r\n## Contents\r\n\r\n- [Overview](#overview)\r\n- [Getting Started](#getting-started)\r\n- [Running Environment](#running-environment)\r\n- [Sample Code](#sample-code)\r\n- [Result](#result)\r\n- [License](#license)\r\n\r\n## Overview\r\n\r\nThe sample code shows how to use the Capture API and Barrier API of HUAWEI Awareness Kit for quick integration.\r\n\r\n[Introduction of HMS Awareness Kit.](https://developer.huawei.com/consumer/en/hms/huawei-awarenesskit)\r\n\r\n## Getting Started\r\n\r\nThis sample uses the Gradle build system.\r\n\r\nFirst download the demo by cloning this repository or downloading an archived snapshot.\r\n\r\nCheck whether the Android studio development environment is ready. Open the sample code project directory with file \"build.gradle\" in Android Studio. \r\n\r\nTo compile and run sample code , you should create an app in AppGallery Connect, change the sample package name to your app package name, and place the agconnect-services.json file and signing certificate under the app directory. For details, please refer to [Preparations](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/config-agc-0000001050033101). \r\n\r\n## Running Environment\r\n\r\nAndroid Studio and JDK 1.8 are used for coding.\r\n\r\nRun the app generated by the sample code on the device which have installed Huawei Mobile Service(HMS).\r\n\r\n## Sample Code\r\n\r\nThe HUAWEI Awareness Kit sample code includes Capture and Barrier API sample code.\r\n\r\nCapture APIs can be called to obtain the time, headset, location, activity, ambient light, weather, bluetooth car stereo, and beacon status.\r\nCapture APIs allow your app to request the status of a user. For example, the getHeadsetStatus() API can be used to obtain connection status of the headset.\r\n\r\nFor details about Capture APIs, please visit the [References of the Capture APIs.](https://developer.huawei.com/consumer/en/doc/development/HMSCore-References/awareness-captureclient-0000001050164395)\r\n\r\nBarrier APIs can be called to implement awareness of the time, headset, location, activity, ambient light, Bluetooth car stereo, and beacon status.\r\nBarrier APIs allow your app to set a series of awareness states. When a user enters a set state, Awareness Kit triggers the corresponding callback to notify the app. For example, the LocationBarrier.enter() API can be used to create a geo-fence.When the user enters the area specified by the geo-fence, Awareness Kit triggers the corresponding callback to notify the app.\r\n\r\nFor details about Barrier APIs, please visit the [References of the Barrier APIs.](https://developer.huawei.com/consumer/en/doc/development/HMSCore-References/awareness-barrierclient-0000001050162440)\r\n\r\n[Other Awareness Kit API References.](https://developer.huawei.com/consumer/en/doc/development/HMSCore-References/awareness-overview-0000001050162436)\r\n\r\n## Result\r\n\u003cimg src=\"Screenshot_1.jpg\" width=40% height=40% \u003e\u003cimg src=\"Screenshot_2.jpg\" width=40% height=40% \u003e\u003cimg src=\"Screenshot_3.jpg\" width=40% height=40% \u003e\r\n\r\n## Question or issues\r\nIf you want to evaluate more about HMS Core, [r/HMSCore on Reddit](https://www.reddit.com/r/HuaweiDevelopers/) is for you to keep up with latest news about HMS Core, and to exchange insights with other developers.\r\n\r\nIf you have questions about how to use HMS samples, try the following options:\r\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/huawei-mobile-services) is the best place for any programming questions. Be sure to tag your question with \r\n`huawei-mobile-services`.\r\n- [Huawei Developer Forum](https://forums.developer.huawei.com/forumPortal/en/home?fid=0101187876626530001) HMS Core Module is great for general questions, or seeking recommendations and opinions.\r\n\r\nIf you run into a bug in our samples, please submit an [issue](https://github.com/HMS-Core/hms-awareness-demo/issues) to the Repository. Even better you can submit a [Pull Request](https://github.com/HMS-Core/hms-awareness-demo/pulls) with a fix.\r\n\r\n## License\r\nHUAWEI Awareness Kit sample is licensed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhms-core%2Fhms-awareness-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhms-core%2Fhms-awareness-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhms-core%2Fhms-awareness-demo/lists"}