# MobileApplication

Artifact: [androidx.appsearch:appsearch-builtin-types](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/builtintypes/MobileApplication.java+class:androidx.appsearch.builtintypes.MobileApplication) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
@ExperimentalAppSearchApi
@Document(name = "builtin:MobileApplication")
class MobileApplication : Thing
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.appsearch.builtintypes.Thing](https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing) ||
|   | ↳ | [androidx.appsearch.builtintypes.MobileApplication](https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication) |

*** ** * ** ***

Represents an installed app to enable searching using names, nicknames, and package names.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/kotlin/androidx/appsearch/annotation/Document.BuilderProducer class https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication.Builder : https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication.BuilderBase<https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication.Builder!>` Builder class for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication`. |
| `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi class https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication.BuilderBase<T : https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication.BuilderBase<T!>?> : https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase<T!>` |

| ### Public constructors |
|---|
| `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication#MobileApplication(androidx.appsearch.builtintypes.MobileApplication.BuilderBase<?>)(builder: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication.BuilderBase<*>)` Constructor for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication`. |

| ### Public functions |
|---|---|
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication#getAlternateNames()()` Returns alternative names of the application. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication#getClassName()()` Returns the fully qualified name of the Application class for this mobile app. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication#getDisplayName()()` Returns the display name of the app. |
| `https://developer.android.com/reference/android/net/Uri.html?` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication#getIconUri()()` Returns the full name of the resource identifier of the app icon, which can be used for displaying results. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication#getPackageName()()` Returns the package name this `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication` represents. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication#getSha256Certificate()()` Returns the SHA-256 certificate of the application. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication#getUpdatedTimestampMillis()()` Returns the last time the app was installed or updated on the device. |

### Inherited functions

From [androidx.appsearch.builtintypes.Thing](https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getCreationTimestampMillis()()`

Returns the creation timestamp, in milliseconds since Unix epoch, of this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getDescription()()`

Returns a description of this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getDocumentScore()()`

Returns the intrinsic score (or importance) of this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getDocumentTtlMillis()()`

Returns the time-to-live timestamp, in milliseconds since `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getCreationTimestampMillis()`, for this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getId()()`

Returns the unique identifier for this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getImage()()`

Returns the URL for an image of this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getName()()`

Returns the name of this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getNamespace()()`

Returns the namespace (or logical grouping) for this item.
`(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/PotentialAction!>` `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getPotentialActions()()`

Returns the actions that can be taken on this object.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getUrl()()`

Returns the deeplink URL of this item.

## Public constructors

### MobileApplication

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
@ExperimentalAppSearchApi
MobileApplication(builder: MobileApplication.BuilderBase<*>)
```

Constructor for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication`.

| Parameters |
|---|---|
| `builder: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication.BuilderBase<*>` | The builder to construct the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication` from. |

## Public functions

### getAlternateNames

```
fun getAlternateNames(): (Mutable)List<String!>
```

Returns alternative names of the application. These are indexed. For example, you might have the alternative name "pay" for a wallet app.

### getClassName

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

```
fun getClassName(): String?
```

Returns the fully qualified name of the Application class for this mobile app. This would look something like "com.android.vending.SearchActivity". Combined with the package name, a launch intent can be created with `
Intent launcher = new Intent(Intent.ACTION_MAIN);
launcher.setComponent(new ComponentName(app.getPackageName(), app.getClassName()));
launcher.setPackage(app.getPackageName());
launcher.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
launcher.addCategory(Intent.CATEGORY_LAUNCHER);
appListFragment.getActivity().startActivity(launcher);
`

### getDisplayName

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

```
fun getDisplayName(): String?
```

Returns the display name of the app. This is indexed. This is what is displayed in the launcher. This might look like "Play Store".

### getIconUri

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

```
fun getIconUri(): Uri?
```

Returns the full name of the resource identifier of the app icon, which can be used for displaying results. The Uri could be "android.resource://com.example.vending/drawable/2131230871", for example.

### getPackageName

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

```
fun getPackageName(): String
```

Returns the package name this `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/MobileApplication` represents. For example, "com.android.vending".

### getSha256Certificate

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

```
fun getSha256Certificate(): Array<Byte>
```

Returns the SHA-256 certificate of the application.

### getUpdatedTimestampMillis

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

```
fun getUpdatedTimestampMillis(): Long
```

Returns the last time the app was installed or updated on the device.