# Frames Android SDK > **Note** > > Frames will be deprecated on June 30, 2026. [Upgrade to Flow for mobile](https://www.checkout.com/docs/payments/accept-payments/upgrade-to-flow-from-frames/upgrade-from-frames-for-android.md), our pre-built, customizable payment user interface. Flow provides a more flexible, scalable, and feature-rich integration, as well as access to additional payment methods. Our Frames Android SDK allows you to accept online payments from all major credit cards and offers multiple levels of customization to suit your requirements. --- ## PCI DSS compliance We stay up-to-date with the latest Payment Card Industry Data Security Standards (PCI DSS). Read our [PCI compliance](https://www.checkout.com/docs/payments/regulation-support/pci-compliance.md) documentation to learn how we can help you to be compliant. Based on these standards, we advise you to use one of our [UI-based solutions](https://www.checkout.com/docs/developer-resources/sdks/frames-sdks/frames-android-sdk/customize-the-frames-android-sdk.md) of the Frames SDKs to remain at the lowest level of compliance (SAQ-A). If you build your own UI, or use the Frames SDKs in another way, you may end up needing to adhere to a higher level of compliance. --- ## How it works 1. [Integrate our Frames Android SDK](#Step_1:_Add_the_SDK_to_your_application's_source_code) into your application's source code. 2. [Display the payment forms](#Step_2:_Configure_your_integration) we provide to collect your customer's payment information and exchange this for a secure token. This is the tokenization step. 3. Use the secure token to [make a payment request](https://www.checkout.com/docs/payments/accept-payments/accept-a-payment-using-the-payments-api.md#Request_a_payment_with_a_token). --- ## Integrate with our Frames Android SDK To integrate with our Frames Android SDK, you must be using Android API level 21 or later. ### Step 1: Add the SDK to your application's source code > **Information** > > You can find more about the installation and available versions on [jitpack.io/frames-android](https://jitpack.io/#checkout/frames-android). Add JitPack repository to the project level `build.gradle` file: ```groovy // project gradle file allprojects { repositories { maven { url 'https://jitpack.io' } } } ``` Add Frames SDK dependency to the module gradle file: ```groovy // module gradle file dependencies { implementation 'com.github.checkout:frames-android:' } ``` ### Step 2: Create a callback for the Payment flow **Kotlin** ```kotlin val paymentFlowHandler = object : PaymentFlowHandler { override fun onSubmit() { // form submit initiated; you can choose to display a loader here } override fun onSuccess(tokenDetails: TokenDetails) { // your token is here } override fun onFailure(errorMessage: String) { // token request error } override fun onBackPressed() { // the user decided to leave the payment page } } ``` **Java** ```java private final PaymentFlowHandler mPaymentFlowHandler = new PaymentFlowHandler() { @Override public void onSubmit() { // form submit initiated; you can choose to display a loader here } @Override public void onSuccess(@NonNull TokenDetails tokenDetails) { // your token is here } @Override public void onFailure(@NonNull String errorMessage) { // token request error } @Override public void onBackPressed() { // the user decided to leave the payment page } }; ``` ### Step 3: Create a configuration object for your Payment form **Kotlin** ```kotlin val paymentFormConfig = PaymentFormConfig( publicKey = PUBLIC_KEY, // set your public key context = context, // set context environment = Environment.SANDBOX, // set the environment paymentFlowHandler = paymentFlowHandler, // set the callback style = PaymentFormStyle(), // set the style supportedCardSchemeList = emptyList() // set supported card schemes, by default uses all schemes ) ``` **Java** ```java PaymentFormConfig paymentFormConfig = new PaymentFormConfig( PUBLIC_KEY, // set your public key context, // set context Environment.SANDBOX, // set the environment paymentFlowHandler, // set the callback new PaymentFormStyle(), // set the style new ArrayList<>() // set supported card schemes, by default uses ); ``` ### Step 4: Create a Payment mediator **Kotlin** ```kotlin val paymentFormMediator = PaymentFormMediator(paymentFormConfig) ``` **Java** ```java PaymentFormMediator paymentFormMediator = new PaymentFormMediator(paymentFormConfig); ``` ### Step 5: Get and show Payment form **Kotlin** **Compose UI** ```kotlin paymentFormMediator.PaymentForm() // Compose function ``` **Activity** ```kotlin class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) paymentFormMediator.setActivityContent(this) } } ``` **Fragment** ```kotlin override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View = paymentFormMediator.provideFragmentContent(this) ``` **Java** **Compose UI** ```java mPaymentFormMediator.PaymentForm(); // Compose function ``` **Activity** ```java public class MainActivity extends ComponentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mPaymentFormMediator.setActivityContent(this); } } ``` **Fragment** ```java @Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState ) { return paymentFormMediator.provideFragmentContent(this); } ``` ### Step 6: (Optional) Customize your payment forms If you want to change the styling of the forms displayed to the customer, you can do so using the `PaymentDetailsStyle`, `BillingAddressDetailsStyle` and `CountryPickerStyle`. You can choose between three different options for [customization](https://www.checkout.com/docs/developer-resources/sdks/frames-sdks/frames-android-sdk/customize-the-frames-android-sdk.md), depending on how much control you need over the forms' UI design. In order of increasing complexity, these are: - default form styling, which allows you to modify the fonts and font colors used in the default forms - themed form styling, which allows you to apply a custom theme to the preset components - custom form styling, which allows you to build and define your own components --- ## Handle 3D Secure When you send a 3D Secure charge request from your server, you will receive a 3D Secure URL in the response's `_links.redirect.href` field. You can pass this URL to a `PaymentFormMediator` in order to handle verification. The redirect URLs, `success_url` and `failure_url`, are set in the Dashboard, but they can be overwritten in the charge request sent from your server. It's important that you provide the correct URLs to ensure a successful payment flow. You can find an example of handling 3DS in `DemoActivity.java` from the SDK's project files. ### Create 3DS result handler **Kotlin** ```kotlin val threeDSResultHandler: ThreeDSResultHandler = { threeDSResult: ThreeDSResult -> when (threeDSResult) { is ThreeDSResult.Success -> { /* Handle success result */ threeDSResult.token } is ThreeDSResult.Failure -> { /* Handle failure result */ } is ThreeDSResult.Error -> { /* Handle error result */ threeDSResult.error } } } ``` **Java** ```java private final Function1 threeDSResultHandler = threeDSResult -> { if (threeDSResult instanceof ThreeDSResult.Success) { /* Handle success result */ String token = ((ThreeDSResult.Success) threeDSResult).getToken(); } else if (threeDSResult instanceof ThreeDSResult.Error) { /* Handle error result */ String errorMessage = ((ThreeDSResult.Error) threeDSResult).getError().getMessage(); } else { /* Handle failure result */ } return null; }; ``` ### Handle 3DS **Kotlin** ```kotlin val request = ThreeDSRequest( container = findViewById(android.R.id.content), // Provide a ViewGroup container for 3DS WebView challengeUrl = redirectUrl, // Provide a 3D Secure URL successUrl = "http://example.com/success", failureUrl = "http://example.com/failure", resultHandler = threeDSResultHandler ) paymentFormMediator.handleThreeDS(request) ``` **Java** ```java private void handleThreeDS(@NonNull String redirectUrl) { ThreeDSRequest threeDSRequest = new ThreeDSRequest( this.findViewById(android.R.id.content), // Provide a ViewGroup container for 3DS WebView redirectUrl, // Provide a 3D Secure URL "http://example.com/success", "http://example.com/failure", threeDSResultHandler ); mPaymentFormMediator.handleThreeDS(threeDSRequest); } ``` --- ## Handle GooglePay Handle a Google Pay token payload and retrieve a token, that you can use to create a charge from your back end. ### Create CheckoutApiService **Kotlin** ```kotlin val checkoutApiClient = CheckoutApiServiceFactory.create( publicKey = PUBLIC_KEY, // set your public key environment = Environment.SANDBOX, // set context context = context // set the environment ) ``` **Java** ```java private CheckoutApiService checkoutApiClient = CheckoutApiServiceFactory.create( PUBLIC_KEY, // set your public key Environment.SANDBOX, // set context context // set the environment ); ``` ### Create a token for GooglePay **Kotlin** ```kotlin val request = GooglePayTokenRequest( tokenJsonPayload = tokenJsonPayload, onSuccess = { tokenDetails -> /* Handle success result */ tokenDetails.token }, onFailure = { errorMessage -> /* Handle failure result */ } ) checkoutApiClient.createToken(request) ``` **Java** ```java private void createGooglePayToken(@NonNull String tokenJsonPayload) { GooglePayTokenRequest request = new GooglePayTokenRequest( tokenJsonPayload, tokenDetails -> { /* Handle success result */ tokenDetails.getToken(); return null; }, errorMessage -> { /* Handle failure result */ return null; } ); checkoutApiClient.createToken(request); } ``` Now that you have the card token, you can [request a payment](https://www.checkout.com/docs/payments/accept-payments/accept-a-payment-using-the-payments-api.md#Request_a_payment_with_a_token). --- ## Complete Data safety form When you submit your app to Google Play, provide the [required responses](https://www.checkout.com/docs/developer-resources/sdks/data-safety-form.md) in your Data safety form. --- ## Related topics - [Customize the Frames Android SDK](https://www.checkout.com/docs/developer-resources/sdks/frames-sdks/frames-android-sdk/customize-the-frames-android-sdk.md): Customize the forms used to collect payment information in your Android app.