The PackageManager class is a wrapper class for Android's pm executable.
This class provides methods and functions for interacting with the pm executable.
This class is inheritable.
Inheritance Hierarchy
RegawMOD.AndroidPackageManager
Namespace: RegawMOD.Android
Assembly: AndroidLib (in AndroidLib.dll) Version: 1.5.2.0 (1.5.2.0)
Syntax
The PackageManager type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() | PackageManager |
Creates a new instance of this class.
Is only visible within the RegawMOD.Android namespace of the library.
|
Methods
Name | Description | |
---|---|---|
![]() | Clear |
Clears data associated with a package m_package.
This method takes a package (e.g.: com.myapp.application) as an argument.
|
![]() | CreateUser |
Creates a new user profile on the device.
|
![]() | DisableUser |
Disables a user on the device.
|
![]() | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetPackagePath |
Gets and returns the path of a given package.
E.g:
Package: org.telegram.messenger
Path: /data/app/org.telegram.messenger-2/base.apk
|
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | InstallPackage |
Installs an application file (*.apk) that is on the device (internal memory or SD card).
The application can be installed using multiple parameters provided by this method.
It is recommended you query for the file on the device before calling this method.
|
![]() | ListFeatures |
Gets and returns a list of features on the associated Device |
![]() | ListLibraries |
Gets and returns a list of all the libraries the associated device supports.
|
![]() | ListPackages |
Queries for and lists all packages on the associated device (m_device).
|
![]() | ListPermissionGroups | |
![]() | ListPermissions |
Gets a [!:System.Collections.Generic.List] containing all the permissions on the associated Android device.
|
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | RemoveUser |
Removes (deletes) a user from the device.
|
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() | UninstallPackage |
Uninstalls an application from a given device.
This method takes a package (e.g.: com.myapp.application) as the argument to determine the to-uninstall app.
|
Fields
Name | Description | |
---|---|---|
![]() | m_device |
Remarks
Examples
public class MyClass { private readonly AndroidController m_adbController; private PackageManager m_pkgManager; public MyClass() { this.m_adbController = AndroidController.Instance; Init(); } private void Init() { var m_device = m_adbController.GetConnectedDevice(m_adbController.ConnectedDevices[number]); m_pgkManager = m_device.PackageManager; } // Do something with the <c>PackageManager</c> class. }
Public Class MyClass
Private ReadOnly m_adbController As AndroidController
Private ReadOnly m_pkgManager As PackageManager
Public Sub New()
Me.m_adbController = AndroidController.Instance
Init()
End Sub
Private Sub Init()
Dim m_device As Device = m_adbController.GetConnectedDevice(m_adbController.ConnectedDevices(number))
Me.m_pkgManager = m_device.PackageManager
End Sub
' Do something with the <c>PackageManager</c> class.
End Class
See Also