Skip to content

Android

This page guides how to setup the Hive SDK Android payment feature.

Hive Console configuration

To use Hive SDK billing, you need to first configure Payment Provider Setup such as key value registration and market linkage in the Hive Console Billing.

Note

For more details, please refer to Google Market Account Registration.

Add market

You need to add the corresponding external library to the module level build.gradle file. Only add the market (payment provider) you will use.

Below is an example of adding an external library to the module level build.gradle file.

dependencies {
   // IapV4, will be automatically included when adding the Market below.
   implementation "com.com2us.android.hive:hive-iapv4"

   // IapV4 Market, add only the Market you are using.

   // Amazon
   implementation "com.com2us.android.hive:hive-iapv4-market-amazon"

   // Google
   implementation "com.com2us.android.hive:hive-iapv4-market-google"

   // Huawei
   implementation "com.com2us.android.hive:hive-iapv4-market-huawei"

   // Lebi
   implementation "com.com2us.android.hive:hive-iapv4-market-lebi"

   // ONEStore
   implementation "com.com2us.android.hive:hive-iapv4-market-onestore"

   // Samsung
   implementation "com.com2us.android.hive:hive-iapv4-market-samsung"

   // Hive Store
   implementation "com.com2us.android.hive:hive-iapv4-market-hivestore"
}

Additional settings by market

Additional settings are required depending on the market.

Huawei payment setup

This section provides setup instructions for using Huawei payments.


  1. Add agconnect-services.json
    • Add the agconnect-services.json file downloaded from the Huawei console to the Project folder.
  2. Project - build.gradle file configuration
    • Add the AppGallery Connect plugin and Maven address.
      buildscript {
          repositories {
              google()
              jcenter()
              // Huawei HMS Core SDK.
              maven {url 'https://developer.huawei.com/repo/'}
          }
          dependencies {
              ...
              // Huawei AppGallery Connect plugin
              classpath 'com.huawei.agconnect:agcp:1.9.1.301'
          }
      }
      allprojects {
          repositories {
              google()
              jcenter()
              /// Huawei HMS Core SDK.
              maven {url 'https://developer.huawei.com/repo/'}
          }
      }  
      
  3. App - build.gradle file configuration
    • Add Huawei library and plugin.
      dependencies {
          // Huawei market
          implementation "com.com2us.android.hive:hive-iapv4-market-huawei"
      }
      apply plugin: 'com.huawei.agconnect'
      

Samsung GalaxyStore payment setup

This section provides instructions for configuring Samsung GalaxyStore payments.


  1. In the module-level build.gradle file, set the dependency for the libs folder.

    dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation fileTree(include: ['*.aar'], dir: 'libs')
    }
    
  2. Add the external library samsung_iap_sdk-v6.1.aar from the Hive SDK distribution version to the module-level libs folder.

  3. In the module-level build.gradle file, remove QQ, WeChat, Huawei, and Hive Lebi libraries. If these libraries are included in the app build, the app may be rejected during the Galaxy Store review process.

    dependencies {
    // List of libraries to exclude for Galaxy Store distribution build
    implementation "com.com2us.android.hive:hive-authv4-provider-qq" 
    implementation "com.com2us.android.hive:hive-authv4-provider-wechat"
    implementation "com.com2us.android.hive:hive-authv4-provider-huawei"
    implementation "com.com2us.android.hive:hive-iapv4-market-lebi"
    }
    
  4. Remove the following library files from the build. If these files are included in the app build, the app may be rejected during the Galaxy Store review process.

    • mid-sdk-{VERSION_INFO}.jar
    • mta-sdk-{VERSION_INFO}.jar
    • open_sdk_{VERSION_INFO}_lite.jar

One store payment setup

Set the following in the project level build.gradle.

allprojects {
    repositories {
        ...
        // only for OneStore
        maven { url 'https://repo.onestore.co.kr/repository/onestore-sdk-public' }
        ...
    }
}
Note

If you are using ONE Store SDK V21, you can distribute your app on the ONE Store Global Platform. For more information, please refer to the ONE Store Global Deployment Guide and Test Option Settings for Global Store Deployment.