--- title: "Upgrade to Android Components 4.0.0" description: "Find out more about the major changes in this release." url: "https://docs.adyen.com/online-payments/upgrade-your-integration/upgrade-to-android-4-0-0" source_url: "https://docs.adyen.com/online-payments/upgrade-your-integration/upgrade-to-android-4-0-0.md" canonical: "https://docs.adyen.com/online-payments/upgrade-your-integration/upgrade-to-android-4-0-0" last_modified: "2026-11-28T19:13:30+01:00" language: "en" --- # Upgrade to Android Components 4.0.0 Find out more about the major changes in this release. To be able to use Android Components 4.0.0, make sure your integration supports the changes described on this page. ## Checkout API version While Android Components 4.0.0 is backwards compatible with older Checkout API versions, we recommend that you use [Checkout API v67](https://docs.adyen.com/online-payments/release-notes#releaseNote=2021-03-01-checkout-api-67) or later. ## General * Drop-in and Components require that you provide a [client key](https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key?tab=android_3#switch-to-using-the-client-key) in the `Configuration.Builder` constructor. * We migrated from the Android Support Library to AndroidX. * The minimum supported Android API version is now [21](https://developer.android.com/reference/android/os/Build.VERSION_CODES#LOLLIPOP). * We moved our library from [jCenter](https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/) to [Maven Central](https://repo1.maven.org/maven2/com/adyen/checkout/). ### Packages * Replace `com.adyen.checkout.base` imports with `com.adyen.checkout.components`. * Replace `com.adyen.checkout.base.component` imports with `com.adyen.checkout.components.base`. ## Drop-in ### Configuration Remove the `resultIntent` parameter from the `DropInConfiguration.Builder` constructor. You can either remove it completely, or pass it to the `DropIn.startPayment` method instead. Handling the result of the Drop-in depends on whether you specified a `resultIntent` when calling `DropIn.startPayment`: ### Tab: With \`resultIntent\` Call `DropIn.getDropInResultFromIntent` inside `onCreate` within the newly launched activity: ```kotlin class ResultActivity : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) val result = DropIn.getDropInResultFromIntent(intent) } } ``` To handle the error and cancelled by user scenarios, call `DropIn.handleActivityResult` inside `onActivityResult` within the activity that initiated the payment (`DropIn.startPayment`). The result is obtained in the `DropInResult` wrapper class: ```kotlin class CheckoutActivity : Activity() { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) val dropInResult = DropIn.handleActivityResult(requestCode, resultCode, data) ?: return when (dropInResult) { is DropInResult.Error -> handleError(dropInResult.reason) is DropInResult.CancelledByUser -> handleCancelled() is DropInResult.Finished -> { // No need to handle this case, it will not occur if resultIntent is specified } } } } ``` ### Tab: Without \`resultIntent\` Call `DropIn.handleActivityResult` inside `onActivityResult` within the activity that initiated the payment (`DropIn.startPayment`). The result is obtained in the `DropInResult` wrapper class: ```kotlin class CheckoutActivity : Activity() { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) val dropInResult = DropIn.handleActivityResult(requestCode, resultCode, data) ?: return when (dropInResult) { is DropInResult.Finished -> handleFinished(dropInResult.result) is DropInResult.Error -> handleError(dropInResult.reason) is DropInResult.CancelledByUser -> handleCancelled() } } } ``` ### Service * Remove the `android.permission.BIND_JOB_SERVICE` from the `AndroidManifest.xml` entry of `DropInService`, since it is now a regular bound `Service` instead of a `JobIntentService`. * The `SimplifiedDropInService` has been removed. We recommend that you extend the `DropInService` instead, and that you only pass the `action` object to the app, not the whole API response. * Replace `CallResult` with the `DropInServiceResult` sealed class: | Removed | Use instead | | ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- | | `CallResult(CallResult.ResultType.FINISHED, result)` | `DropInServiceResult.Finished(result)` | | `CallResult(CallResult.ResultType.ACTION, actionJSON)` | `DropInServiceResult.Action(actionJSON)` | | `CallResult(CallResult.ResultType.ERROR, reason)` | `DropInServiceResult.Error(reason = reason)` | | `CallResult(CallResult.ResultType.ERROR_WITH_MESSAGE, errorMessage)` | `DropInServiceResult.Error(reason = reason, errorMessage = errorMessage)` | | `CallResult(CallResult.ResultType.ERROR_WITH_MESSAGE, errorMessage, dismissDropIn = true)` | `DropInServiceResult.Error(reason = reason, errorMessage = errorMessage, dismissDropIn = true)` | | `CallResult(CallResult.ResultType.WAIT, result)` | Replaced by [Asynchronous handling](https://docs.adyen.com/online-payments/upgrade-your-integration/upgrade-to-android-4-0-0#asynchronous-handling). | ### Asynchronous handling 1. Remove `makePaymentsCall` and `makeDetailsCall`, and override `onPaymentsCallRequested` and `onDetailsCallRequested` instead. 2. Remove any `CallResult.ResultType.WAIT` occurrences and `asyncCallback` calls. 3. Call the `sendResult` method to perform an asynchronous callback. 4. Make sure to manage the threads manually in `onPaymentsCallRequested` and `onDetailsCallRequested`. Unlike `makePaymentsCall` and `makeDetailsCall`, these methods run on the main thread by default. ```kotlin override fun onPaymentsCallRequested(paymentComponentState: PaymentComponentState<*>, paymentComponentJson: JSONObject) { launch(Dispatchers.IO) { // Send the data to your server. val response = sendPaymentsRequest(paymentComponentJson) } } // This should be wherever you get the response back from your server. fun handleYourPaymentsResponse(response: YourResponse) { // Parse the response, extract the corresponding DropInServiceResult and return it. val result: DropInServiceResult = handleResponse(response) // Replaces the asyncCallback method. sendResult(result) } override fun onDetailsCallRequested(actionComponentData: ActionComponentData, actionComponentJson: JSONObject) { launch(Dispatchers.IO) { // Send the data to your server. val response = sendPaymentsDetailsRequest(actionComponentJson) } } // This should be wherever you get the response back from your server. fun handleYourPaymentsDetailsResponse(response: YourResponse) { // Parse the response, extract the corresponding DropInServiceResult and return it. val result: DropInServiceResult = handleResponse(response) // Replaces the asyncCallback method. sendResult(result) } ``` You can also check the `ExampleAsyncDropInService` for an example implementation. ## Components * Fix your module imports: each payment method has only one module now. The `card-base` and `card-ui` modules have been merged into a single `card` module, and similarly for other payment methods. * Provide a configuration for any Action Component Provider that you are using. * Make note of the `isReady` flag in `ComponentState`: some components (like `CardComponent`) might require some initialization time even if all the inputs are valid. The `isValid` flag is still only valid if both the UI is valid and the component is initialized and ready. Use the `isInputValid` flag if you only want to check if the UI is valid. * By default, payment component providers do not have the `isAvailable` method, and you can treat them as always available. Only providers for payment methods that require an availability check (currently Google Pay and WeChat Pay) have the `isAvailable` method. ### Card In `CardConfiguration.Builder`: * Replace `setHolderNameRequire` with `setHolderNameRequired`. * Replace the `publicKey` with your `clientKey`. Because `publicKey` and `clientKey` are both strings, not making this change will not result in an error in your IDE. The issue will only be picked up during runtime validation. ### 3D Secure * The `Adyen3DS2Component` supports the [new 3D Secure 2 flow](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/android-component#handle-redirect) introduced in [Checkout API v67](https://docs.adyen.com/online-payments/release-notes#releaseNote=2021-03-01-checkout-api-67). The old flow is still supported if you are using an API version earlier than 67. * Use the `Adyen3DS2Component.handleIntent` method to [handle 3D Secure redirects](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/android-component#handle-redirect). When the 3D Secure 2 redirect response is returned to your app, call `threedsComponent.handleIntent` and pass the received `intent` in the parameters. The component will then notify your observer (from `threedsComponent.observe`) with the data that you need to pass to your server. ### Redirect * Replace `handleRedirectResponse` with `handleIntent` in `RedirectComponent`. ### Bancontact * In `BcmcConfiguration.Builder`, replace the `publicKey` with your `clientKey` . Because `publicKey` and `clientKey` are both strings, not making this change will not result in an error in your IDE. The issue will only be picked up during runtime validation. * For Bancontact mobile, if you were using a workaround to replace the `bcmc_mobile` payment method type with `bcmc_mobile_app`, remove the workaround and [handle the action with the QR Code Component](https://docs.adyen.com/payment-methods/bancontact/bancontact-mobile/android-component#handle-the-redirect). ### QR Code * [Use the `QRCodeComponent`](https://docs.adyen.com/payment-methods/bancontact/bancontact-mobile/android-component#handle-the-redirect) to handle actions with a `qrCode` type (for example Bancontact mobile, Swish, and Pix). * Use the `QRCodeComponent.PROVIDER.canHandleAction` to check whether this component can handle the action you received. * Use the `QRCodeComponent.PROVIDER.requiresView` to check whether a view is required: * Some payment methods (currently only Pix) will require a view to be shown. Use `QRCodeView` and `attach` it to the component. * Other payment methods (for example Bancontact mobile) only work as a redirect. ### Google Pay * You can remove `com.google.android.gms:play-services-wallet` from your `build.gradle` file. We added the Google Pay SDK dependency as `api`, so it is also available