Package | com.distriqt.extension.packagemanager |
Class | public final class PackageManager |
Inheritance | PackageManager flash.events.EventDispatcher |
This class represents the PackageManager extension.
Property | Defined By | ||
---|---|---|---|
canRequestApplicationInstalls : Boolean [read-only]
Checks whether the calling package is allowed to request package installs through package installer. | PackageManager | ||
implementation : String [read-only]
The implementation currently in use. | PackageManager | ||
isSupported : Boolean [static] [read-only]
Whether the current device supports the extensions functionality
| PackageManager | ||
nativeVersion : String [read-only]
The native version string of the native extension. | PackageManager | ||
service : PackageManager [static] [read-only]
The singleton instance of the PackageManager class. | PackageManager | ||
version : String [read-only]
The version of this extension. | PackageManager |
Method | Defined By | ||
---|---|---|---|
Constructor
You should not call this directly, but instead use the singleton access
| PackageManager | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void [override]
| PackageManager | ||
dispose():void
Disposes the extension and releases any allocated resources. | PackageManager | ||
getInstalledApplications(flags:int = 0):Array
Return an Array of all application packages that are installed for the
current user. | PackageManager | ||
getInstalledApplicationsAsync(callback:Function = null, flags:int = 0):void | PackageManager | ||
getInstallerPackageName():String
Retrieve the package name of the application that installed a package. | PackageManager | ||
getPackageInfo(packageName:String, flags:int = 0):PackageInfo
Retrieves the package information for the specified package name
Note: You will need to add the package name to the queries node in your manifest additions
| PackageManager | ||
installApplication(applicationPath:String):Boolean
Launch application installer
| PackageManager | ||
killProcess(processName:String):Boolean
Attempts to force terminate or "kill" a running process / activity with the given processName. | PackageManager | ||
Show settings to allow configuration of trusted external sources
| PackageManager | ||
validateSignature(signature:String):Boolean
Checks if the apk signature is valid
| PackageManager | ||
wasInstalledFromPlayStore():Boolean
Verifies if the application was installed using the Google Play Store. | PackageManager |
Event | Summary | Defined By | ||
---|---|---|---|---|
PackageManager |
Constant | Defined By | ||
---|---|---|---|
EXT_CONTEXT_ID : String = com.distriqt.PackageManager [static] | PackageManager | ||
VERSION : String = 3.4.1 [static] | PackageManager |
canRequestApplicationInstalls | property |
canRequestApplicationInstalls:Boolean
[read-only] Checks whether the calling package is allowed to request package installs through package installer. Apps are encouraged to call this API before launching the package installer Starting from Android O, the user can explicitly choose what external sources they trust to install apps on the device. If this API returns false, the install request will be blocked by the package installer and a dialog will be shown to the user with an option to launch settings to change their preference. An application must target Android O or higher and declare permission Manifest.permission.REQUEST_INSTALL_PACKAGES in order to use this API.
public function get canRequestApplicationInstalls():Boolean
implementation | property |
implementation:String
[read-only]
The implementation currently in use. This should be one of the following depending on the platform in use and the functionality supported by this extension:
Android
iOS
default
unknown
public function get implementation():String
isSupported | property |
isSupported:Boolean
[read-only] Whether the current device supports the extensions functionality
public static function get isSupported():Boolean
nativeVersion | property |
nativeVersion:String
[read-only]
The native version string of the native extension.
public function get nativeVersion():String
service | property |
service:PackageManager
[read-only] The singleton instance of the PackageManager class.
public static function get service():PackageManager
Error — If there was a problem creating or accessing the extension, or if the key is invalid
|
version | property |
version:String
[read-only]
The version of this extension.
This should be of the format, MAJOR.MINOR.BUILD
public function get version():String
PackageManager | () | Constructor |
public function PackageManager()
Constructor You should not call this directly, but instead use the singleton access
addEventListener | () | method |
override public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Parameters
type:String | |
listener:Function | |
useCapture:Boolean (default = false )
| |
priority:int (default = 0 )
| |
useWeakReference:Boolean (default = false )
|
dispose | () | method |
public function dispose():void
Disposes the extension and releases any allocated resources. Once this function
has been called, a call to init
is neccesary again before any of the
extensions functionality will work.
getInstalledApplications | () | method |
public function getInstalledApplications(flags:int = 0):Array
Return an Array
of all application packages that are installed for the
current user.
Parameters
flags:int (default = 0 ) — unused
|
Array — An Array of PackageInfo objects or
null if the functionality is not supported
|
See also
getInstalledApplicationsAsync | () | method |
public function getInstalledApplicationsAsync(callback:Function = null, flags:int = 0):void
Parameters
callback:Function (default = null )
| |
flags:int (default = 0 )
|
getInstallerPackageName | () | method |
public function getInstallerPackageName():String
Retrieve the package name of the application that installed a package. This identifies which market the package came from.
This may be null or an empty string in situations where the application was side loaded.
For applications installed from the Google Play Store this will be equal to com.android.vending
.
String — The package name of the installer application
|
getPackageInfo | () | method |
public function getPackageInfo(packageName:String, flags:int = 0):PackageInfo
Retrieves the package information for the specified package name Note: You will need to add the package name to the queries node in your manifest additions
Parameters
packageName:String — The package name of the application to query
| |
flags:int (default = 0 ) — unused
|
PackageInfo — PackageInfo representing the queried application package or null if the application isn't installed or access was denied o
|
installApplication | () | method |
public function installApplication(applicationPath:String):Boolean
Launch application installer
Parameters
applicationPath:String — Path at which the application can be retrieved
|
Boolean — |
killProcess | () | method |
public function killProcess(processName:String):Boolean
Attempts to force terminate or "kill" a running process / activity with the given processName.
Parameters
processName:String — The name of the process to terminate
|
Boolean — true if the process name was found and termination attempted
|
showManageUnknownAppSourcesSettings | () | method |
public function showManageUnknownAppSourcesSettings():void
Show settings to allow configuration of trusted external sources
validateSignature | () | method |
public function validateSignature(signature:String):Boolean
Checks if the apk signature is valid
Parameters
signature:String — The certificate signature
|
Boolean — true if the signature is valid and false otherwise
|
wasInstalledFromPlayStore | () | method |
public function wasInstalledFromPlayStore():Boolean
Verifies if the application was installed using the Google Play Store.
This is the equivalent of checking the installer package name is com.android.vending
.
Boolean — true if the application was installed using Google Play and false if not.
|
See also
packagemanager:packageremoved | Event |
com.distriqt.extension.packagemanager.events.PackageManagerEvent
com.distriqt.extension.packagemanager.events.PackageManagerEvent.PACKAGE_REMOVED
EXT_CONTEXT_ID | Constant |
public static const EXT_CONTEXT_ID:String = com.distriqt.PackageManager
VERSION | Constant |
public static const VERSION:String = 3.4.1