Introducing the App Gallery. Create a developer account



What happens, who is to blame and what to do



Google recently ended its partnership with Huawei . This led to the fact that Huawei on its new devices can no longer use Google services (app store, geolocation, maps, push notifications, analytics, etc.), which turns the device into a brick for the user. If it were not for a Chinese company, then, most likely, its Android business would have simply stopped there. But the company is Chinese, big and they took the path of import substitution, quickly implementing functionality similar to Google services.



Huawei Mobile Services , Google Mobile Services (Firebase Analytics), . , . โ€” .



  1. , , . โ†
  2. Huawei Analytics.
  3. Huawei.
  4. Huawei maps. Google maps AppGallery.


, โ€” !





, Google Huawei. . , .



. :



  1. 2 APK โ€” Google Play, Google, โ€” AppGallery, Huawei.
  2. Firebase Analytics. Huawei.
  3. . .
  4. . , , .. Huawei .


:



  1. . ( โ€“ ?). - , Clean.
  2. Google , . / Google . , , , .
  3. DI. . , DI .
  4. . , .




Google, , , .



  1. https://developer.huawei.com. / + . - , . - ( - ) โ€“ . Google Play โ€“ .
  2. . , )
  3. , ( ApplicationId).
  4. โ€” : ) ) ) ) . โ€” e-mail . โ€” , . , Huawei โ€” , . . โ€” )
  5. . , , .
  6. SHA-256 , . .. .
  7. google-services.json, Huawei agconnect-services.json
  8. flavors Google Huawei. - :


build.gradle (module app) flavors , src/google/kotlin, src/google/res, src/huawei/kotlin, src/huawei/res .



android {
  ...
  sourceSets {
      google.java.srcDirs += 'src/google/kotlin'
      google.res.srcDirs += 'src/google/res'
      huawei.java.srcDirs += 'src/huawei/kotlin'
      huawei.res.srcDirs += 'src/huawei/res'
  }

  flavorDimensions "store"

  productFlavors {

      google {
          dimension "store"
      }

      huawei {
          dimension "store"
      }
  }
}


src/huaweiDebug src/huaweiRelease. agconnect-services.json



apply plugin: 'com.huawei.agconnect' build.gradle (module app).



, build.gradle :



buildscript {
    ...
    repositories {
        ...
        maven {url 'https://developer.huawei.com/repo/'}
    }
    dependencies {
        ...
        classpath 'com.huawei.agconnect:agcp:1.2.1.301'
    }
}

allprojects {
    repositories {
        ...
        maven {url 'https://developer.huawei.com/repo/'}
    }
}


โ€“



We are now fully prepared. We have 2 different build options - for Huawei and Google. We have the necessary dependencies connected. Created folders where our code will be. A developer account has been created and the necessary steps have been taken to create an application project. We even have some kind of technical specification. And we have already completed the first point from the TK! An excellent reason to end this article. And already in the next - to build in analytics not from Google, but from Huawei.



All the code that is in this series of articles you can see in the repository on GitHub. Here is the link .




All Articles