# Install and set up (/sdk/android/install-and-setup)

Add the PayPal Mobile SDK v3.0.0 to your Android app, configure CoreConfig, and register your return links.



Complete these core setup steps once. Then integrate any payment method, PayPal Checkout or Card, using its guide. Each one starts from the setup here and adds only what is specific to that method.

## Prerequisites [#prerequisites]

You'll need the following before integrating the SDK:

* A PayPal developer account, a client ID, and your merchant ID from the [PayPal Developer Dashboard](/dashboard/).
* A server-side integration that can create and capture orders ([Orders v2 API](/api/orders/v2/)), and, for vault flows, create setup tokens and payment tokens.
* App Links configured for your return URL before testing HTTPS with domain verification.
* Android Studio targeting Android SDK 23+.

## 1. Add the SDK [#1-add-the-sdk]

The SDK ships as per-feature modules. Add only what you use. Every feature module includes `CorePayments` transitively. Add `fraud-protection`, which provides device data used to reduce declines, plus the module for each payment method you integrate:

```groovy
dependencies {
    implementation 'com.paypal.android:fraud-protection:X.Y.Z'      // device data (risk signals)

    // Add the module(s) for the method(s) you integrate:
    implementation 'com.paypal.android:paypal-payments:X.Y.Z'       // PayPal Checkout + Vault
    implementation 'com.paypal.android:payment-buttons:X.Y.Z'       // PayPal buttons
    // implementation 'com.paypal.android:card-payments:X.Y.Z'     // Card (ACDC)
}
```

Replace `X.Y.Z` with the current v3 release.

## 2. Initialize CoreConfig [#2-initialize-coreconfig]

Every client (`PayPalClient`, `CardClient`) is built from a single `CoreConfig`. No network calls occur at initialization.

```kotlin
val config = CoreConfig(
    clientId       = "<YOUR_CLIENT_ID>",
    merchantId     = "<YOUR_MERCHANT_ID>",       // Required: encrypted merchant account ID, no default
    coreEnvironment = CoreEnvironment.SANDBOX,   // CoreEnvironment.LIVE for production
    bnCode         = null                        // Partner integrations only
)
```

Reuse this `config` across every method client. Switch `CoreEnvironment.SANDBOX` to `CoreEnvironment.LIVE` for production.

## 3. Register your return links [#3-register-your-return-links]

PayPal checkout sends the buyer to the PayPal app, or an in-app browser, and back to your app through an Android App Link. Register it on the activity that receives the return. One intent-filter matches on host + path prefix, so it covers both your return and cancel URLs:

```xml
<activity android:name=".CheckoutActivity" android:exported="true" android:launchMode="singleTop">
    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="https" android:host="example.com" android:pathPrefix="/merchant-app" />
    </intent-filter>
</activity>
```

App Switch also supports a custom URL scheme as a fallback for when the App Link cannot be delivered. The SDK only requires that at least one of `returnAppUrl` / `fallbackSchemeUrl` be non-blank, but registering both is the safer default, because an unverified App Link would otherwise leave the buyer with no way back to your app. Register the fallback scheme separately:

```xml
<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="merchantapp" />
</intent-filter>
```

Define the matching URL config once to pass to each method's session or checkout call:

```kotlin
val urlConfig = ReturnToAppUrlConfig(
    returnAppUrl      = "https://example.com/merchant-app/return",
    cancelAppUrl      = "https://example.com/merchant-app/cancel",
    fallbackSchemeUrl = "merchantapp://return"   // Recommended: at least one of returnAppUrl / fallbackSchemeUrl must be non-blank
)
```

Verification checklist:

* `android:autoVerify="true"` is set
* your domain serves a valid `/.well-known/assetlinks.json` with your app's SHA-256 fingerprint
* the buyer has *Open supported links* enabled. If the App Link is not verified, Android opens the return in a browser and checkout still completes through the in-browser path.

> **Info:** Card (ACDC) uses a custom-scheme return only for the 3D Secure challenge and does not require App Links.

## Next steps [#next-steps]

With setup done, integrate a payment method:

* [PayPal Checkout](/sdk/android/add-payment-methods/paypal-checkout): One-Time Checkout, save payment methods with or without purchase, Pay Later, and PayPal Credit.
* [Card (ACDC)](/sdk/android/add-payment-methods/card): card payments and saving cards.
