{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-android/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["code-walkthrough","step"]},"type":"markdown"},"seo":{"title":"Installation & Initialization | Android Card Present SDK Reference","description":"Add the Finix PAX MPOS SDK to your Android project, configure permissions, and initialize the SDK.","siteUrl":"https://docs.finix.com/","llmstxt":{"hide":false,"sections":[{"title":"Getting Started","includeFiles":["guides/getting-started/**/*.md"],"excludeFiles":[]},{"title":"Online Payments","includeFiles":["guides/online-payments/**/*.md"],"excludeFiles":["guides/online-payments/payment-features/fsa-hsa-non-healthcare-mcc.md"]},{"title":"In-Person Payments","includeFiles":["guides/in-person-payments/**/*.md"],"excludeFiles":[]},{"title":"Subscriptions","includeFiles":["guides/subscriptions/**/*.md"],"excludeFiles":[]},{"title":"After the Payment","includeFiles":["guides/subscriptions/after-the-payment/**/*.md"],"excludeFiles":[]},{"title":"Managing Operations","includeFiles":["guides/managing-operations/**/*.md"],"excludeFiles":[]},{"title":"Platform Payments","includeFiles":["guides/platform-payments/**/*.md"],"excludeFiles":[]},{"title":"Payouts","includeFiles":["guides/payouts/**/*.md"],"excludeFiles":[]},{"title":"Developers","includeFiles":["additional-resources/developers/**/*.md"],"excludeFiles":[]},{"title":"Plugins","includeFiles":["additional-resources/plugins/**/*.md"],"excludeFiles":[]},{"title":"Industry Considerations","includeFiles":["guides/industry-considerations/**/*.md"],"excludeFiles":[]},{"title":"Regional Considerations","includeFiles":["guides/regional-considerations/**/*.md"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeWalkthrough","attributes":{"__idx":1,"filters":{},"filesets":[{"files":[{"path":"android/card-present/_filesets/installation.kt","content":[{"start":0,"condition":{"steps":["add-dependency"]},"children":["// build.gradle.kts","dependencies {","    implementation(\"com.finix:pax-mpos-sdk-android:3.7.0\")","}"]},"",{"start":7,"condition":{"steps":["add-permissions"]},"children":["// AndroidManifest.xml","// Add INTERNET, ACCESS_WIFI_STATE, ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION.","// For API 30 and below: BLUETOOTH, BLUETOOTH_ADMIN (with maxSdkVersion=\"30\").","// For API 31+: BLUETOOTH_SCAN, BLUETOOTH_CONNECT."]},"",{"start":14,"condition":{"steps":["proguard"]},"children":["// proguard-rules.pro","// -dontwarn com.finix.mpos.sdk.**","// -keep class com.finix.mpos.sdk.** { *; }","// -keep class com.finix.mpos.models.** { *; }","// -keep class com.finix.common.networking.models.** { *; }"]},"",{"start":22,"condition":{"steps":["initialize"]},"children":["val mpos = MPOSFinix(","    context,","    MerchantData(","        merchantId = \"MUxxxxxx\",","        mid = \"\",","        deviceId = \"DVxxxxx\",","        env = Environment.SB,","        userId = \"USxxxxxxxxx\",","        password = \"\"","    )",")"]},"",{"start":36,"condition":{"steps":["connect"]},"children":["mpos.connect(","    deviceName = \"PAX_D135_XXXX\",","    deviceAddress = \"XX:XX:XX:XX:XX:XX\",","    callback = object : MPOSConnectionCallback {","        override fun onSuccess() {","            // device ready — start a transaction","        }","        override fun onError(errorMessage: String) {","            // connection failed","        }","        override fun onProcessing(currentStepMessage: String) {","            // show progress to the user","        }","    }",")"]},"",{"start":54,"condition":{"steps":["device-management"]},"children":["mpos.isConnected()","","mpos.disconnect()","","mpos.resetDevice(object : MPOSConnectionCallback {","    override fun onSuccess() { }","    override fun onError(errorMessage: String) { }","    override fun onProcessing(currentStepMessage: String) { }","})"]},""],"metadata":{"steps":["add-dependency","add-permissions","proguard","initialize","connect","device-management"]},"basename":"installation.kt","language":"kotlin"}],"downloadAssociatedFiles":[]}],"steps":[{"id":"add-dependency","heading":"Add the dependency"},{"id":"add-permissions","heading":"Add permissions"},{"id":"proguard","heading":"ProGuard rules"},{"id":"initialize","heading":"Initialize the SDK"},{"id":"connect","heading":"Connect to a device"},{"id":"device-management","heading":"Device management"}],"inputs":{},"toggles":{}},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"installation--initialization","__idx":0},"children":["Installation & Initialization"]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"add-dependency","heading":"Add the dependency"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add the SDK to your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["build.gradle.kts"]},". See ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://central.sonatype.com/artifact/com.finix/pax-mpos-sdk-android"},"children":["Maven Central"]}," or ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://mvnrepository.com/artifact/com.finix/pax-mpos-sdk-android"},"children":["MVN Repository"]}," for the latest version."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"implementation(\"com.finix:pax-mpos-sdk-android:3.8.0\")\n","lang":"kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"add-permissions","heading":"Add permissions"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add the following to your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AndroidManifest.xml"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"xml","header":{"controls":{"copy":{}}},"source":"<!-- Network communication -->\n<uses-permission android:name=\"android.permission.INTERNET\" />\n<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" />\n\n<!-- Bluetooth communication (API 30 and below) -->\n<uses-permission android:name=\"android.permission.BLUETOOTH\" android:maxSdkVersion=\"30\" />\n<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\" android:maxSdkVersion=\"30\" />\n<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" />\n<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />\n\n<!-- Bluetooth communication (API 31+) -->\n<uses-permission android:name=\"android.permission.BLUETOOTH_SCAN\" />\n<uses-permission android:name=\"android.permission.BLUETOOTH_CONNECT\" />\n","lang":"xml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BLUETOOTH_SCAN"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BLUETOOTH_CONNECT"]},", and location permissions are required for API 31+."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"proguard","heading":"ProGuard rules"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If your build uses ProGuard, add the following to your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["proguard-rules.pro"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"-dontwarn retrofit.**\n-keep class retrofit.** { *; }\n-keepattributes Signature\n-keepattributes Exceptions\n-keepattributes RuntimeVisibleAnnotations\n-keepattributes RuntimeInvisibleAnnotations\n-keepattributes RuntimeVisibleParameterAnnotations\n-keepattributes RuntimeInvisibleParameterAnnotations\n-keepattributes *Annotation*\n\n-keep class okhttp3.** { *; }\n-keep interface okhttp3.** { *; }\n-dontwarn okhttp3.**\n-dontwarn java.nio.file.*\n-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement\n-keep class com.google.gson.stream.** { *; }\n\n-dontwarn com.finix.mpos.sdk.**\n-keep class com.finix.mpos.sdk.** { *; }\n-keep class com.finix.mpos.models.** { *; }\n-keep class com.finix.common.networking.models.** { *; }\n-dontwarn java.lang.invoke.StringConcatFactory\n","lang":"text"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"initialization","__idx":1},"children":["Initialization"]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"initialize","heading":"Initialize the SDK"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MPOSFinix"]}," instance with your ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/android/card-present/credentials"},"children":["credentials"]},":"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"connect-to-a-device","__idx":2},"children":["Connect to a Device"]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"connect","heading":"Connect to a device"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["connect()"]}," with the PAX D135 Bluetooth name and MAC address:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Callback"},"children":["Callback"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Trigger"},"children":["Trigger"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSuccess"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Device connected and ready to process transactions."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Connection failed. Check Bluetooth pairing and device proximity."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onProcessing"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Connection step in progress. Display ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["currentStepMessage"]}," to the user if desired."]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"device-management","__idx":3},"children":["Device Management"]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"device-management","heading":"Device management"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Method"},"children":["Method"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["isConnected()"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Returns whether the device is currently connected."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["disconnect()"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Closes the Bluetooth connection to the device."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["resetDevice(MPOSConnectionCallback)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Resets the device and re-establishes the connection. Accepts the same ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MPOSConnectionCallback"]}," as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["connect()"]},"."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["resetDevice()"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["disconnect()"]}," each provide two overloads:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Suspend overload"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["suspend fun resetDevice()"]},") — no callback required. Use this when calling from within a Kotlin coroutine."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Callback overload"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["resetDevice(MPOSConnectionCallback)"]},") — for traditional asynchronous handling outside of coroutines."]}]}]}]}]},"headings":[{"value":"Installation & Initialization","id":"installation--initialization","depth":1},{"value":"Initialization","id":"initialization","depth":2},{"value":"Connect to a Device","id":"connect-to-a-device","depth":2},{"value":"Device Management","id":"device-management","depth":2}],"frontmatter":{"seo":{"title":"Installation & Initialization | Android Card Present SDK Reference","description":"Add the Finix PAX MPOS SDK to your Android project, configure permissions, and initialize the SDK."},"markdown":{"toc":{"hide":true}},"footer":{"hide":true}},"lastModified":"2026-06-04T00:03:31.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/android/card-present/installation","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}