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


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

Summary

Nested types

public final class MobileApplication.Builder

Builder class for MobileApplication.

Public methods

@NonNull List<String>

Returns alternative names of the application.

@Nullable String

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

@Nullable String

Returns the display name of the app.

@Nullable Uri

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

@NonNull String

Returns the package name this MobileApplication represents.

@NonNull byte[]

Returns the SHA-256 certificate of the application.

long

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

Inherited methods

From androidx.appsearch.builtintypes.Thing
long

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

@Nullable 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.

@NonNull String

Returns the unique identifier for this item.

@Nullable String

Returns the URL for an image of this item.

@Nullable String

Returns the name of this item.

@NonNull String

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

@NonNull List<PotentialAction>

Returns the actions that can be taken on this object.

@Nullable String

Returns the deeplink URL of this item.

Public methods

getAlternateNames

public @NonNull List<StringgetAlternateNames()

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
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-alpha07
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-alpha07
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-alpha07
public @NonNull String getPackageName()

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

getSha256Certificate

Added in 1.1.0-alpha07
public @NonNull byte[] getSha256Certificate()

Returns the SHA-256 certificate of the application.

getUpdatedTimestamp

Added in 1.1.0-alpha07
public long getUpdatedTimestamp()

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