# Storage

For **WebView** in native Android apps, storage must be enabled explicitly.

### Enable localStorage & sessionStorage

```kotlin
val webView = WebView(context)
webView.settings.domStorageEnabled = true
webView.settings.javaScriptEnabled = true
```

### Enable Cache for WebView

To persist storage across sessions and increase LiSA Player performance, caching must be enabled.

```kotlin
webView.settings.databaseEnabled = true
webView.settings.cacheMode = WebSettings.LOAD_DEFAULT
```

### Handle Storage Across Sessions

To persist `localStorage` across app restarts:

```kotlin
CookieManager.getInstance().setAcceptCookie(true)
CookieManager.getInstance().setAcceptThirdPartyCookies(webView, true)
```


---

# 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://docs.hello-lisa.com/developers/guides/integration-guide/app-integration/android/storage.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.
