public class PackageServices extends ApplicationContextProvider
Added in daily build 2016.2932.
ApplicationContextProvider
Constructor and Description |
---|
PackageServices(android.content.Context context)
Creates an object that provides easy access to the packages on an Android device.
|
Modifier and Type | Method and Description |
---|---|
PackageState |
getPackageState(String packageName,
int flags)
Gets the state of the provided package on the device.
|
boolean |
isPackageNameInstalled(String packageName)
Determines if the given application exists on the device.
|
getApplicationContext
public PackageServices(android.content.Context context)
context
- Reference to an Android created
Context used to access the
input device system.
Setting this to null will cause an exception to be thrown.
public PackageState getPackageState(String packageName, int flags)
packageName
- The full package name of the application to check for. Cannot be null or empty.flags
- Additional option flags. Use any combination of the following to modify the results.
PackageState
indicating what state the desired package is in.
Returns PackageState.MISSING
if the provided packageName is invalid.
public boolean isPackageNameInstalled(String packageName)
packageName
- The full package name of the application to check for. Cannot be null or empty.