PackageInstallerSession Class |
To install two applications using a session do the following steps:
- Obtain an instance of PackageInstaller with [!:Com.Datalogic.Device.App.PackageInstaller.PackageInstaller(Context)].
-
- Obtain an instance of IPackageInstallerListener that will be used to handle the
result of the commands invoked on the session.
-
- Create a PackageInstallerSession calling CreateSession(IPackageInstallerListener).
The CreateSession(IPackageInstallerListener) method takes as parameters the instance of IPackageInstallerListener created at the previous step.
-
- Start a session calling OpenSession.
-
- Call [!:Com.Datalogic.Device.App.PackageInstallerSession.install(java.lang.String,%20boolean)] to install the first application.
-
- Call [!:Com.Datalogic.Device.App.PackageInstallerSession.install(java.lang.String,%20boolean)] to install the second application.
-
- Close and commit the session calling CloseSession.
-
- The method onResult of the listener will be called when the execution of all the commands of the transaction
are completed, either with success or failure. It contains the result of each command.
-
Inheritance Hierarchy Object
Com.Datalogic.Device.AppPackageInstallerSession
Namespace:
Com.Datalogic.Device.App
Assembly:
datalogic-xamarin-sdk (in datalogic-xamarin-sdk.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax public class PackageInstallerSession : Object,
IServiceConnection, IJavaObject, IDisposable, IJavaPeerable
Public Class PackageInstallerSession
Inherits Object
Implements IServiceConnection, IJavaObject, IDisposable, IJavaPeerable
The PackageInstallerSession type exposes the following members.
Constructors Properties Methods Remarks PackageInstallerSession gives developers the ability to group the execution of a sequence of install, uninstall and
upgrade commands.
Once the session is created, the commands install, uninstall, upgrade must be called inside a transaction.
A transaction is opened calling
OpenSession and closed and commited calling
CloseSession.
To install two applications using a session do the following steps:
- Obtain an instance of PackageInstaller with [!:Com.Datalogic.Device.App.PackageInstaller.PackageInstaller(Context)].
-
- Obtain an instance of IPackageInstallerListener that will be used to handle the
result of the commands invoked on the session.
-
- Create a PackageInstallerSession calling CreateSession(IPackageInstallerListener).
The CreateSession(IPackageInstallerListener) method takes as parameters the instance of IPackageInstallerListener created at the previous step.
-
- Start a session calling OpenSession.
-
- Call [!:Com.Datalogic.Device.App.PackageInstallerSession.install(java.lang.String,%20boolean)] to install the first application.
-
- Call [!:Com.Datalogic.Device.App.PackageInstallerSession.install(java.lang.String,%20boolean)] to install the second application.
-
- Close and commit the session calling CloseSession.
-
- The method onResult of the listener will be called when the execution of all the commands of the transaction
are completed, either with success or failure. It contains the result of each command.
-
[Android Documentation]
See Also