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


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

Summary

Nested types

Builder class for MobileApplication.

Public functions

(Mutable)List<String!>

Returns alternative names of the application.

String?

Returns the fully qualified name of the Application class for this mobile app.

String?

Returns the display name of the app.

Uri?

Returns the full name of the resource identifier of the app icon, which can be used for displaying results.

String

Returns the package name this MobileApplication represents.

ByteArray<Byte>

Returns the SHA-256 certificate of the application.

Long

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

Inherited functions

From androidx.appsearch.builtintypes.Thing
Long

Returns the creation timestamp, in milliseconds since Unix epoch, of this item.

String?

Returns a description of this item.

Int

Returns the intrinsic score (or importance) of this item.

Long

Returns the time-to-live timestamp, in milliseconds since getCreationTimestampMillis, for this item.

String

Returns the unique identifier for this item.

String?

Returns the URL for an image of this item.

String?

Returns the name of this item.

String

Returns the namespace (or logical grouping) for this item.

(Mutable)List<PotentialAction!>

Returns the actions that can be taken on this object.

String?

Returns the deeplink URL of this item.

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-alpha07
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-alpha07
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-alpha07
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-alpha07
fun getPackageName(): String

Returns the package name this MobileApplication represents. For example, "com.android.vending".

getSha256Certificate

Added in 1.1.0-alpha07
fun getSha256Certificate(): ByteArray<Byte>

Returns the SHA-256 certificate of the application.

getUpdatedTimestamp

Added in 1.1.0-alpha07
fun getUpdatedTimestamp(): Long

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