PackageInstallerSessionUninstall Method |
Call this method to unistall an application installed on the device.
Namespace:
Com.Datalogic.Decode
Assembly:
datalogic-xamarin-sdk (in datalogic-xamarin-sdk.dll) Version: 1.0.0.0
(1.0.0.0)
Syntax
public virtual int Uninstall (string packageName);
Public Virtual Integer Uninstall (String packageName);
Parameters
- packageName
- Type: System.String
String package name of the application to be uninstalled.
Return Value
Type: System.Int32
int PackageInstallerException.SUCCESS in case of success,
otherwise a possible error code, matching one of the PackageInstallerException error constants.
Exceptions
| Exception |
Condition |
| PackageInstallerException |
in case of error, when exceptions are enabled through the ErrorManager singleton. |
Remarks
Call this method to unistall an application installed on the device.
The method must be called after having called the
openSession().
The method is queued internally and executed when the
closeSession() is called.
The result of the command is received through the listener method
PackageInstallerListener.onResult(java.util.List<com.datalogic.device.app.PackageInstallerResult>).
Example:
PackageInstaller packageInstaller = new PackageInstaller(context);
PackageInstallerListener listener = new PackageInstallerListener{public void onResult(List results) {...}};
PackageInstallerSession session = packageInstaller.createSession(listener);
session.openSession();
session.uninstall("com.example.helloandroid");
session.closeSession();[Android Documentation]
See Also