# AppInfo

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/AppInfo.java+class:androidx.car.app.AppInfo) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

*** ** * ** ***


```
@CarProtocol
class AppInfo
```

<br />

*** ** * ** ***

Container class for information about the app the host is connected to.

Hosts will use this information to provide the right level of compatibility, based on the application's minimum and maximum API level and its own set of supported API levels.

The application minimum API level is defined in the application's manifest using the following declaration.

```kotlin
<manifest ...>
  <application ...>
    <meta-data
        android:name="androidx.car.app.minCarApiLevel"
        android:value="1" />
    ...
  </application>
</manifest>
```

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/car/app/CarContext#getCarAppApiLevel()` |   |

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/car/app/AppInfo#MIN_API_LEVEL_METADATA_KEY() = "androidx.car.app.minCarApiLevel"` Application meta-data tag used to define the minimum Car App API level this application is able to handle. |

| ### Public constructors |
|---|
| `@https://developer.android.com/reference/kotlin/androidx/annotation/VisibleForTesting https://developer.android.com/reference/kotlin/androidx/car/app/AppInfo#AppInfo(int,int,java.lang.String)( minCarAppApiLevel: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, latestCarAppApiLevel: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, libraryVersion: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html )` Creates an instance of `https://developer.android.com/reference/kotlin/androidx/car/app/AppInfo` with the provided version information. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/AppInfo#getLatestCarAppApiLevel()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/AppInfo#getLibraryDisplayVersion()()` String representation of library version. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/AppInfo#getMinCarAppApiLevel()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/car/app/AppInfo#toString()()` |

## Constants

### MIN_API_LEVEL_METADATA_KEY

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)

```
const val MIN_API_LEVEL_METADATA_KEY = "androidx.car.app.minCarApiLevel": String!
```

Application meta-data tag used to define the minimum Car App API level this application is able to handle.

If not specified, the library assumes the application can only handle the Car App API level designed by `https://developer.android.com/reference/kotlin/androidx/car/app/versioning/CarAppApiLevels#getLatest()` at the time of compiling.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/car/app/CarContext#getCarAppApiLevel()` |   |

## Public constructors

### AppInfo

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
@VisibleForTesting
AppInfo(
    minCarAppApiLevel: Int,
    latestCarAppApiLevel: Int,
    libraryVersion: String
)
```

Creates an instance of `https://developer.android.com/reference/kotlin/androidx/car/app/AppInfo` with the provided version information.

| Parameters |
|---|---|
| `minCarAppApiLevel: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the minimal API level that can work with an app built with the library Value is one of the following: - `CarAppApiLevels.UNKNOWN` - `CarAppApiLevels.LEVEL_1` - `CarAppApiLevels.LEVEL_2` - `CarAppApiLevels.LEVEL_3` - `CarAppApiLevels.LEVEL_4` - `CarAppApiLevels.LEVEL_5` - `CarAppApiLevels.LEVEL_6` - `CarAppApiLevels.LEVEL_7` - `CarAppApiLevels.LEVEL_8` - `CarAppApiLevels.LEVEL_9` <br /> |
| `latestCarAppApiLevel: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the latest API level the library supports Value is one of the following: - `CarAppApiLevels.UNKNOWN` - `CarAppApiLevels.LEVEL_1` - `CarAppApiLevels.LEVEL_2` - `CarAppApiLevels.LEVEL_3` - `CarAppApiLevels.LEVEL_4` - `CarAppApiLevels.LEVEL_5` - `CarAppApiLevels.LEVEL_6` - `CarAppApiLevels.LEVEL_7` - `CarAppApiLevels.LEVEL_8` - `CarAppApiLevels.LEVEL_9` <br /> |
| `libraryVersion: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | the library artifact version |

## Public functions

### getLatestCarAppApiLevel

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
fun getLatestCarAppApiLevel(): Int
```

Value is one of the following:

- `CarAppApiLevels.UNKNOWN`
- `CarAppApiLevels.LEVEL_1`
- `CarAppApiLevels.LEVEL_2`
- `CarAppApiLevels.LEVEL_3`
- `CarAppApiLevels.LEVEL_4`
- `CarAppApiLevels.LEVEL_5`
- `CarAppApiLevels.LEVEL_6`
- `CarAppApiLevels.LEVEL_7`
- `CarAppApiLevels.LEVEL_8`
- `CarAppApiLevels.LEVEL_9`

<br />

### getLibraryDisplayVersion

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
fun getLibraryDisplayVersion(): String
```

String representation of library version. This version string is opaque and not meant to be parsed.

### getMinCarAppApiLevel

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
fun getMinCarAppApiLevel(): Int
```

Value is one of the following:

- `CarAppApiLevels.UNKNOWN`
- `CarAppApiLevels.LEVEL_1`
- `CarAppApiLevels.LEVEL_2`
- `CarAppApiLevels.LEVEL_3`
- `CarAppApiLevels.LEVEL_4`
- `CarAppApiLevels.LEVEL_5`
- `CarAppApiLevels.LEVEL_6`
- `CarAppApiLevels.LEVEL_7`
- `CarAppApiLevels.LEVEL_8`
- `CarAppApiLevels.LEVEL_9`

<br />

### toString

```
fun toString(): String!
```