Skip to content

Latest commit

 

History

History

remoteconfig

remoteconfig quickstart

English | 中文

Table of Contents

Introduction

Remote Configuration allows you to manage parameters online. With the service, you can change the behavior and appearance of your app online without requiring users to update the app. Remote Configuration provides cloud-based services, the console, and the client SDK. By integrating the client SDK, your app can periodically obtain parameter values delivered on the console to modify the app's behavior and appearance.

Environment Requirements

  • A computer with Android Studio installed for app development
  • A device or an emulator in Android Studio running Android 4.2 or a later version

Getting Started

  1. Check whether you have a HUAWEI ID. If not, register one and pass identity verification.
  2. Use your account to sign in to AppGallery Connect, create an app, and set Package type to APK (Android app).
  3. Enable Remote Configuration.
  4. Go to Project settings > General information, download the agconnect-services.json file, and copy this file to the app's module directory.

Sample Code

The fetch API is called before app launch and data is used after the fetch operation is successful. src\main\java\com\huawei\agc\quickstart\Test1Activity.java

Data fetched by calling the fetch API is applied upon the next app launch. src\main\java\com\huawei\agc\quickstart\Test2Activity.java

Result

**Click 'FETCH DATA AND APPLY'.
resultpage

**Click 'FETCH DATA AND APPLY NEXT STARTUP'.
resultpage

Technical Support

If you have any questions about the sample code, try the following:

  • Visit Stack Overflow, submit your questions, and tag them with appgallery. Huawei experts will answer your questions.
  • Go to AppGallery in the HUAWEI Developer Forum and communicate with other developers.

If you encounter any issues when using the sample code, submit your issues or submit a pull request.

License

The sample code is licensed under the Apache License, version 2.0.