> For the complete documentation index, see [llms.txt](https://docs.mapbox.com/android/ja/maps/llms.txt)

# TextureView

![Use TextureView as render surface.](https://docs.mapbox.com/android/ja/assets/ideal-img/maps-examples-textureview.863f9e8.480.png)

This example demonstrates how to display a map using a [`TextureView`](https://developer.android.com/reference/android/view/TextureView) as the render surface. The code snippet includes a class `TextureViewActivity` extending [`AppCompatActivity`](https://developer.android.com/reference/androidx/appcompat/app/AppCompatActivity), where an instance of [`MapboxMap`](https://docs.mapbox.com/android/maps/api/latest/mapbox-maps-android/com.mapbox.maps/-mapbox-map/) is created. The `onCreate` method initializes the `MapboxMap` instance, inflates the layout from `ActivityTextureViewBinding`, sets the content view, and loads the [Mapbox Standard](https://docs.mapbox.com/mapbox-gl-js/guides/styles/#mapbox-standard) map style using [`mapboxMap.loadStyle(Style.STANDARD)`](https://docs.mapbox.com/android/maps/api/latest/mapbox-maps-android/com.mapbox.maps/-mapbox-map/load-style.html).

> **Note: Android Examples App Available**
> 
> This example code is part of the **Maps SDK for Android Examples App**, a working Android project [available on GitHub](https://github.com/mapbox/mapbox-maps-android/tree/v11.35.2/). Android developers are encouraged to run the examples app locally to interact with this example in an emulator and explore other features of the Maps SDK.
> 
> See our [Run the Maps SDK for Android Examples App](https://docs.mapbox.com/help/tutorials/maps-sdk-android-examples-app/) tutorial for step-by-step instructions.

**Kotlin**

Title: `TextureViewActivity.kt`

[View on GitHub](https://github.com/mapbox/mapbox-maps-android/blob/v11.35.2/app/src/main/java/com/mapbox/maps/testapp/examples/TextureViewActivity.kt)

```kt
package com.mapbox.maps.testapp.examples

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.mapbox.maps.MapboxMap
import com.mapbox.maps.Style
import com.mapbox.maps.testapp.databinding.ActivityTextureViewBinding

/**
 * Example of displaying a map using TextureView as render surface.
 */
class TextureViewActivity : AppCompatActivity() {

  private lateinit var mapboxMap: MapboxMap

  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    val binding = ActivityTextureViewBinding.inflate(layoutInflater)
    setContentView(binding.root)
    mapboxMap = binding.mapView.mapboxMap
    mapboxMap.loadStyle(Style.STANDARD)
  }
}
```

**XML**

Title: `activity_texture_view.xml`

[View on GitHub](https://github.com/mapbox/mapbox-maps-android/blob/v11.35.2/app/src/main/res/layout/activity_texture_view.xml)

```xml
<?xml version="1.0" encoding="utf-8"?>
<com.mapbox.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:mapbox="http://schemas.android.com/apk/res-auto"
    android:id="@+id/mapView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    mapbox:mapbox_mapSurface="texture_view"
    tools:context=".examples.TextureViewActivity" />
```