# 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")
public class MobileApplication extends Thing
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.appsearch.builtintypes.Thing](https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing) ||
|   | ↳ | [androidx.appsearch.builtintypes.MobileApplication](https://developer.android.com/reference/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/androidx/appsearch/annotation/Document.BuilderProducer public final class https://developer.android.com/reference/androidx/appsearch/builtintypes/MobileApplication.Builder extends https://developer.android.com/reference/androidx/appsearch/builtintypes/MobileApplication.BuilderBase<https://developer.android.com/reference/androidx/appsearch/builtintypes/MobileApplication.Builder>` Builder class for `https://developer.android.com/reference/androidx/appsearch/builtintypes/MobileApplication`. |
| `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi public class https://developer.android.com/reference/androidx/appsearch/builtintypes/MobileApplication.BuilderBase<T extends https://developer.android.com/reference/androidx/appsearch/builtintypes/MobileApplication.BuilderBase<T>> extends https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase<T>` |

| ### Public constructors |
|---|
| `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi https://developer.android.com/reference/androidx/appsearch/builtintypes/MobileApplication#MobileApplication(androidx.appsearch.builtintypes.MobileApplication.BuilderBase<?>)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/MobileApplication.BuilderBase<@https://developer.android.com/reference/androidx/annotation/NonNull ?> builder )` Constructor for `https://developer.android.com/reference/androidx/appsearch/builtintypes/MobileApplication`. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/MobileApplication#getAlternateNames()()` Returns alternative names of the application. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/MobileApplication#getClassName()()` Returns the fully qualified name of the Application class for this mobile app. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/MobileApplication#getDisplayName()()` Returns the display name of the app. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/net/Uri.html` | `https://developer.android.com/reference/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://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/MobileApplication#getPackageName()()` Returns the package name this `https://developer.android.com/reference/androidx/appsearch/builtintypes/MobileApplication` represents. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html byte[]` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/MobileApplication#getSha256Certificate()()` Returns the SHA-256 certificate of the application. |
| `long` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/MobileApplication#getUpdatedTimestampMillis()()` Returns the last time the app was installed or updated on the device. |

### Inherited methods

From [androidx.appsearch.builtintypes.Thing](https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing) `long` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getCreationTimestampMillis()()`

Returns the creation timestamp, in milliseconds since Unix epoch, of this item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getDescription()()`

Returns a description of this item.
`int` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getDocumentScore()()`

Returns the intrinsic score (or importance) of this item.
`long` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getDocumentTtlMillis()()`

Returns the time-to-live timestamp, in milliseconds since `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getCreationTimestampMillis()`, for this item.
`@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/appsearch/builtintypes/Thing#getId()()`

Returns the unique identifier for this item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getImage()()`

Returns the URL for an image of this item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getName()()`

Returns the name of this item.
`@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/appsearch/builtintypes/Thing#getNamespace()()`

Returns the namespace (or logical grouping) for this item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction>` `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getPotentialActions()()`

Returns the actions that can be taken on this object.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/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
public MobileApplication(
    @NonNull MobileApplication.BuilderBase<@NonNull ?> builder
)
```

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

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/MobileApplication.BuilderBase<@https://developer.android.com/reference/androidx/annotation/NonNull ?> builder` | The builder to construct the `https://developer.android.com/reference/androidx/appsearch/builtintypes/MobileApplication` from. |

## Public methods

### getAlternateNames

```
public @NonNull List<String> getAlternateNames()
```

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)

```
public @Nullable String getClassName()
```

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)

```
public @Nullable String getDisplayName()
```

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)

```
public @Nullable Uri getIconUri()
```

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)

```
public @NonNull String getPackageName()
```

Returns the package name this `https://developer.android.com/reference/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)

```
public @NonNull byte[] getSha256Certificate()
```

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)

```
public long getUpdatedTimestampMillis()
```

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