This Site Kit sample encapsulates APIs of the HUAWEI Site Kit. It provides many demos for your search reference or usage.
- Register as a developer. Register a HUAWEI account.
- Create an app. Create an app and enable APIs.
- 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. In addition, change the value of the apiKey variable ("API key") of the onCreate function in MainActivity.java or MainActivity.kt to the value of apiKey obtained from agconnect-services.json.
Before using this sample code, check whether the android environment and Java environment have been installed. Decompress the Site Kit sample code package.
Use Android Studio to open the SiteCodelab folder, synchronize it, and compile it after successful synchronization. Then connect a mobile phone running the Android operating system to your PC and click the run icon (green arrow). The APK is successfully installed on the mobile phone.
Android SDK 27 or a later version is recommended. Android Build Tools
To use functions provided by packages in examples, you can to use the agconnect-services.json in the app package. If you want to create your demo, you need to change the agconnect-services.json file.
Site Kit Java sample is licensed under the Apache License, version 2.0.