Use MetaMask SDK with Android
Import MetaMask SDK into your native Android dapp to enable your users to easily connect with their MetaMask Mobile wallet.
See also
Prerequisites
-
MetaMask Mobile version 7.6.0 or later installed on your target device (that is, a physical device or emulator). You can install MetaMask Mobile from Google Play, or clone and compile MetaMask Mobile from source and build to your target device.
-
Android SDK version 23 or later.
Steps
1. Install the SDK
To add the SDK from Maven Central as a dependency to your project, in your app/build.gradle
file,
add the following entry to the dependencies
block:
build.gradle
dependencies {
implementation "io.metamask.androidsdk:metamask-android-sdk:0.2.1"
}
Then, sync your project with the Gradle settings. Once the syncing completes, you can set up the rest of your project.
2. Import the SDK
Import the SDK by adding the following line to the top of your project file:
import io.metamask.androidsdk.Ethereum