Huawei Contact Shield is a service that utilizes Bluetooth Low Energy to record nearby people with whom a user has contact with. Developers can implement this technology in Android devices to potentially reduce the spread of COVID-19. If a user is tested positive for COVID-19, the third-party application asks for the user's authorization, obtains the user's shared key, and uploads the key to the diagnosis server. The API returns the risk of getting infected by determining the distance between diagnosed and undiagnosed individuals.
The following is a list of sample source code snippets that matched your search term. Source code snippets are chunks of source code that were found out on the Web that you can cut and paste into your own source code. Whereas most of the sample source code we've curated for our directory is for consuming APIs, we occasionally find something interesting on the API provider side of things. If you know of some sample source code that would be of interest to the ProgrammableWeb community, we'd like to know about it. Be sure to check our guidelines for making contributions to ProgrammableWeb.
This Android example demonstrates how to use Contact Shield in partner applications. Contact tracing is implemented as a background service that exchanges Shared Keys with the Huawei Contact Shield API.