MYKEY Docs
中文English
English
English
  • Introduction
  • Sign in with MYKEY
    • Verify signature at backend server
    • More detailed tech and process of MYKEY login
  • Integrate with MYKEY
    • Multiple ways to integration with MYKEY
    • Mobile Dapp with H5 pages
      • ETH
      • EOS
      • JS Extensions
    • Integration via MYKEY Android SDK
      • Preconditions
      • Initiate SDK
      • Authorize
      • Sign
      • Transfer
      • Call contracts
    • Integration via MYKEY iOS SDK
      • Preconditions
      • Initiate SDK
      • Authorize
      • Sign
      • Transfer
      • Call contracts
    • Web application with scanning qrcode
    • SimpleWallet Protocol Compatible
    • Deeplink Protocol
  • Dive into MYKEY
    • Dive into MYKEY account
    • Classes and methods
      • Android Classes
      • iOS Classes
    • Error Code
    • Identify MYKEY deposit transaction
      • ETH deposit
      • EOS deposit
    • MYKEY Whitepaper
  • KEY ID
    • KEYID ETH Contracts introduction
      • Account Module
      • Account Storage Module
      • Logic Management Module
      • Logic Module
    • Account recovery mechanism
    • KEYID contract upgrade process
    • KEYID contract upgrade records
      • ETH
        • KEY ID Ethereum Contracts Upgrade Pending Time Adjustment
        • KEY ID Ethereum logic contract module upgrade announcement
        • KEY ID Ethereum Contracts Upgrade Pending Time Adjustment
        • KEY ID Ethereum AccountLogic/DualsigsLogic Contracts Upgrade
        • KEY ID Ethereum DappLogic Contract Upgrade
  • Development Resources
    • Ethereum
    • EOS
  • Join Us
    • DApp submit
    • Developers Community
Powered by GitBook
On this page
  • 1. Add aar file
  • 2. Add libs
  • 3. Add Jni configuration
  • 4. Add MYKEY dependencies
  • 5. Add MYKEY activity
  • 6. Proguard rules

Was this helpful?

  1. Integrate with MYKEY
  2. Integration via MYKEY Android SDK

Preconditions

PreviousIntegration via MYKEY Android SDKNextInitiate SDK

Last updated 5 years ago

Was this helpful?

For Android users, please check the following steps:

1. Add aar file

Download 'MYKEYWalletLib.aar' from following link, copy to libs directory of your app module

2. Add libs

Add following code to file build.gradle

repositories {
    flatDir {
        dirs 'libs'
    }
}

3. Add Jni configuration

In file build.gradle, add config for Jni directory

android {
...
    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }
    defaultConfig {
        ndk {
        abiFilters "armeabi-v7a"
        }
    }
}

4. Add MYKEY dependencies

Add following dependency in file build.gradle

dependencies{
    implementation(name: 'MYKEYWalletLib', ext: 'aar')
    implementation "com.alibaba:fastjson:1.1.70.android"
}

5. Add MYKEY activity

Copy following code to AndroidManifest.xml, and set the callback deeplink, composed by scheme、host and path

<activity android:name="com.mykey.sdk.connect.scheme.callback.MYKEYCallbackActivity">
    <intent-filter>
        <data
            android:scheme="customscheme"
            android:host="customhost"
            android:path="/custompath"/>
        <data/>

        <category android:name="android.intent.category.DEFAULT"/>
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.BROWSABLE"/>
    </intent-filter>
</activity>

6. Proguard rules

-keep class com.mykey.sdk**{*;}
-dontwarn com.mykey.sdk**

-keep class go**{*;}
-dontwarn go**

-keep class mykeycore**{*;}
-dontwarn mykeycore**

This configuration will generate a deeplink for MYKEY callback, which will be used in MYKEK SDK initlization, 。

https://github.com/mykeylab/MYKEY-Client-SDK/tree/master/Android
initSimple