Quick Start for Android

Get CoinmeBridge running in your Android app in 4 steps.

1. Add the dependency

Add the Cloudsmith Maven repository to your project-level settings.gradle.kts (your Coinme integration specialist will provide the entitlement token):

dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven {
            url = uri("https://maven.cloudsmith.io/coinme/coinme-sdk-frontend/")
            credentials {
                username = "token"
                password = "<ENTITLEMENT_TOKEN>"
            }
        }
    }
}

Then add the dependency to your app module's build.gradle.kts:

dependencies {
    implementation("com.coinme:coinme-bridge:1.0.0")
}

2. Add manifest permissions

Camera and location are enabled by default to support the full Coinme experience. Add these to your AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
ℹ️

Opting out:

You can set allowsCamera = false or allowsLocation = false in the config, but be aware of the trade-offs:

  • No camera and photo upload: KYC identity-document workflows are disabled. The widget integration will be unavailable in jurisdictions that require documentary KYC.
  • No location: Users will not see nearby retail locations automatically and must specify their location manually.
⚠️

Important:

You need to communicate your decision about camera access and geolocation to your Coinme business development team so that your ramp can be properly configured. Not doing so may result in poor UX for a subset of your customers.

3. Configure the hosting Activity

The Activity that hosts CoinmeFragment must declare android:configChanges so that the WebView is not destroyed when the keyboard opens or the device rotates:

<activity android:name=".YourActivity" android:configChanges="orientation|screenSize|keyboardHidden|keyboard screenLayout|smallestScreenSize" />
⚠️

Why?

Without this, Android destroys and recreates the Activity on configuration changes. This destroys the WebView and loses the Orchestrator session state, causing UI issues such as sheets opening unexpectedly or inputs losing focus.

4. Add the Fragment

import com.coinme.bridge.CoinmeConfig
import com.coinme.bridge.CoinmeFragment

val config = CoinmeConfig(
    rampId = "your-ramp-id",
    partnerKey = "your-partner-key",
)

val fragment = CoinmeFragment.newInstance(
    orchestratorUrl = "https://widget.coinme.com",
    config = config,
)
fragment.listener = this

supportFragmentManager.beginTransaction()
    .replace(R.id.container, fragment)
    .commit()

5. Handle events

import com.coinme.bridge.CoinmeEvent
import com.coinme.bridge.CoinmeError
import com.coinme.bridge.CoinmeListener

class YourActivity : AppCompatActivity(), CoinmeListener {

    override fun onCoinmeEvent(fragment: CoinmeFragment, event: CoinmeEvent) {
        when (event) {
            is CoinmeEvent.TransactionComplete -> finish()
            is CoinmeEvent.UserCancelled -> finish()
            else -> { }
        }
    }

    override fun onCoinmeError(fragment: CoinmeFragment, error: CoinmeError) {
        Log.e("Coinme", "Bridge error: ${error.message}")
        finish()
    }
}

That's it. The SDK handles the WebView, bridge handshake, and session lifecycle automatically.

Next steps