# Secure Web Containers on Android
source: https://developer.mastercard.com/open-finance-au/documentation/connect/integrating-with-connect/android/websdk-android/index.md

The following section explains the steps to load your WebApp via the Connect WebSDK in your mobile App utilizing Chrome Custom Tabs. The FI's OAuth login page will use the same Chrome Custom Tabs when the FI's app is not installed on the user's device, or it will redirect to the FI's mobile app if the app is present on the user's mobile device. This documentation also includes the App Link/Deep Link configuration.

These are the steps which occur when launching:

* Launch your web app (integrated with the Connect WebSDK) URL address in a secure web container inside your mobile app.

* Select an option or link which will open the Connect experience in same Secure Container (Note this option should have redirectUrl code integrated already)

* After successful FI OAuth account addition control returns to the your app's Activity via AppLink/DeepLink of the `redirectUrl` declared in the `AndroidManifest.xml` file.

The following scenarios need to be handled:

* Scenario 1: FI's app is installed - the FI's app will launch and the OAuth session will occur in the FI's app.

* Scenario 2: FI's app is not installed - the FI OAuth login page will open in Chrome Custom Tabs.

## Android project setup {#android-project-setup}

Modify your app-level Gradle file (build.gradle) as follows:

```groovy
dependencies {
    // ...
    implementation 'androidx.browser:browser:<insert latest version>'
}
```

You can find the latest version of the library here: <https://developer.chrome.com/docs/android/custom-tabs/guide-get-started>

The Android App needs Internet permission to access the WebView. Include this permission in the `AndroidManifest.xml` file.

```xml
<?xml version="1.0" encoding="utf-8"?>
<manifest
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools">

  <uses-permission android:name="android.permission.INTERNET"/>

  <application>
    .....
  </application>

</manifest>
```

## Loading your Web URL inside the secure web container {#loading-your-web-url-inside-the-secure-web-container}

To open Chrome Custom Tabs, use the `openLinkInChromeCustomTabs` function. This function takes the String URL as a parameter and relies on a context instance typically representing your `Activity`.
* Java
* Kotlin

```java
// pass your web url here for example "https://example.com"
private void openLinkInChromeCustomTabs(String url) {
  try {
    // To open Chrome Custom Tabs
    CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
    CustomTabsIntent customTabsIntent = builder.build();
    customTabsIntent.intent.setPackage("com.android.chrome");
    customTabsIntent.launchUrl(context, Uri.parse(url));
  } catch (Exception exception) {
    Log.d("Connect", "Something went wrong, please check if Chrome Browser is installed");
  }
}
```

```kotlin
// pass your web url here for example "https://example.com"
fun openLinkInChromeCustomTabs(url: String) {
  try {
    // To open Chrome Custom Tabs
    val builder = CustomTabsIntent.Builder()
    val customTabsIntent = builder.build()
    customTabsIntent.intent.setPackage("com.android.chrome")
    customTabsIntent.launchUrl(this, Uri.parse(url))
  } catch (ignore:Exception) {
    Log.d("Connect","Something went wrong, please check if Chrome Browser is installed")
  }
}
```

