MobileApplication
@ExperimentalAppSearchApi
@Document(name = "builtin:MobileApplication")
class MobileApplication : Thing
| kotlin.Any | ||
| ↳ | androidx.appsearch.builtintypes.Thing | |
| ↳ | androidx.appsearch.builtintypes.MobileApplication |
Represents an installed app to enable searching using names, nicknames, and package names.
Summary
Nested types |
|---|
|
Builder class for |
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 |
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 |
||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
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
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
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
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
fun getPackageName(): String
Returns the package name this MobileApplication represents. For example, "com.android.vending".
getSha256Certificate
fun getSha256Certificate(): ByteArray<Byte>
Returns the SHA-256 certificate of the application.
getUpdatedTimestampMillis
fun getUpdatedTimestampMillis(): Long
Returns the last time the app was installed or updated on the device.