# Android App Integration

## **Step 1: Create App Interface And WebView Element**

Open res -> layout -> activity\_main.xml, create the application interface and add WebView element to it.

![](/files/-MICq6XxKcpJIzvQyHb_)

## **Step 2: Declare A WebView Variable, Add A Link To Your Site**

Go to src -> package -> MainActivity.java. You will need to declare a WebView variable, enable JavaScript and load the link of your website. You can check the below code screenshot. Do not forget to add link of your website in mywebView\.loadUrl().

![](/files/-MICrVcWgT6Izru6xiD7)

## **Step 3: Set WebView Client**

Next step is to add one line of code in your MainActivity.java class given below. If you do not add this code in your app then clickable links will open in a standard web browser such as Google Chrome. To ensure that the user stays within the app and links open inside your app, you will need to add the below code.

```
mywebView.setWebViewClient(new WebViewClient());
```

## **Step 4: Remove Additional Padding**

If you want to remove the additional spacing, open activity\_main.xml and remove the padding from layouts.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.konverse.ai/app-integration/android-app-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
