# 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
public final 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.

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

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

## Summary

| ### Constants |
|---|---|
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/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/androidx/annotation/VisibleForTesting https://developer.android.com/reference/androidx/car/app/AppInfo#AppInfo(int,int,java.lang.String)( int minCarAppApiLevel, int latestCarAppApiLevel, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html libraryVersion )` Creates an instance of `https://developer.android.com/reference/androidx/car/app/AppInfo` with the provided version information. |

| ### Public methods |
|---|---|
| `int` | `https://developer.android.com/reference/androidx/car/app/AppInfo#getLatestCarAppApiLevel()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/AppInfo#getLibraryDisplayVersion()()` String representation of library version. |
| `int` | `https://developer.android.com/reference/androidx/car/app/AppInfo#getMinCarAppApiLevel()()` |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/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)

```
public static final String 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.

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

| See also |
|---|---|
| `https://developer.android.com/reference/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
public AppInfo(
    int minCarAppApiLevel,
    int latestCarAppApiLevel,
    @NonNull String libraryVersion
)
```

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

| Parameters |
|---|---|
| `int minCarAppApiLevel` | 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 /> |
| `int latestCarAppApiLevel` | 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 /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html libraryVersion` | the library artifact version |

## Public methods

### getLatestCarAppApiLevel

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

```
public int getLatestCarAppApiLevel()
```

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)

```
public @NonNull String getLibraryDisplayVersion()
```

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)

```
public int getMinCarAppApiLevel()
```

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

```
public String toString()
```