You need to create an app in AppGallery Connect. You can create a project first and then add the app to the project. When creating an app, you are required to configure the name, package name, category, and language of your app. After the creation, AppGallery Connect will generate basic configuration information for your app.

  1. Access AppGallery Connect and sign in with your account and password.
  2. Click My projects.
  3. Click Add project. In the dialog box that is displayed, enter the project name, and click OK.
  4. On the Project Setting page that is displayed, click Add app.
  5. On the Add app page, select a platform and device type, enter your app name and package name, select your app's category (app or game), and set the default language based on your needs.
  6. Then you can view app information such as the package name and app ID under My projects.

Create a project in Android Studio. Ensure that the app name used in the project is the same as that set in AppGallery Connect.

  1. Open Android Studio and choose File > New > New Project to create a project.
  2. On the Configure your project page, select Empty Activity and click Next.
  3. Enter the app name (the same as that set in AppGallery Connect), package name (the same as that set in AppGallery Connect), local storage location, and minimum API level, and click Finish.
  1. Add the AppGallery Connect plug-in and configure the Maven repository address in the project-level build.gradle file of your Android Studio project.
    buildscript { repositories { google() jcenter() // Check that you have the following line (if not, add it) maven { url 'https://developer.huawei.com/repo/' } // HUAWEI Maven repository } dependencies { classpath 'com.android.tools.build:gradle:3.5.3' // Add the following line classpath 'com.huawei.agconnect:agcp:1.4.1.300' // HUAWEI agcp plugin } } allprojects { repositories { google() jcenter() // Check that you have the following line (if not, add it): maven { url 'https://developer.huawei.com/repo/' } // HUAWEI Maven repository } }
  2. Open the build.gradle file at the app level (usually app/build.gradle) and add the information shown in the following figure at the beginning of the file.
    apply plugin: 'com.android.application' // Add the following line apply plugin: 'com.huawei.agconnect' // HUAWEI agconnect Gradle plugin android { // ... } dependencies { // ... }
  1. Click Sync now to synchronize the project.
  2. If the message "synced successfully" is displayed, the synchronization is successful. By now, you have completed the preparations for integration in AppGallery Connect.
Code copied