Click or drag to resize

PackageInstallerSession Class

PackageInstallerSessionopenSession()closeSession()

To install two applications using a session do the following steps:

  1. Obtain an instance of PackageInstaller with PackageInstaller(Context).
  2. Obtain an instance of PackageInstallerListener that will be used to handle the result of the commands invoked on the session.
  3. Create a PackageInstallerSession calling PackageInstaller.createSession(com.datalogic.device.app.PackageInstallerListener). The PackageInstaller.createSession(com.datalogic.device.app.PackageInstallerListener) method takes as parameters the instance of PackageInstallerListener created at the previous step.
  4. Start a session calling openSession().
  5. Call install(java.lang.String, boolean) to install the first application.
  6. Call install(java.lang.String, boolean) to install the second application.
  7. Close and commit the session calling closeSession().
  8. 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
System.Object
Com.Datalogic.Device.App.PackageInstallerSession

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, 
	IJavaObject, IDisposable, IJavaPeerable

The PackageInstallerSession type exposes the following members.

Constructors
NameDescription
Public methodPackageInstallerSession
Initializes a new instance of the PackageInstallerSession class
Top
Properties
NameDescription
Public propertyJniPeerMembers
To be added.
Public propertyThresholdClass
To be added.
Public propertyThresholdType
To be added.
Top
Methods
NameDescription
Public methodCloseSession
Call this method to execute the commands queued in the session.
Public methodInstall
Call this method to install the application contained within the .
Public methodInstall
Call this method to install the application contained within the .
Public methodOnServiceConnected
Callback implemented to receive the asynchronous result of the bindService request.
Public methodOnServiceDisconnected
Callback implemented to receive the notify that the bind to the service is lost due to a crash of the service.
Public methodOpenSession
Call this method to start a session.
Public methodUninstall
Call this method to unistall an application installed on the device.
Public methodUpgrade
Call this method to upgrade an application installed on the device.
Top
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:

  1. Obtain an instance of PackageInstaller with PackageInstaller(Context).
  2. Obtain an instance of PackageInstallerListener that will be used to handle the result of the commands invoked on the session.
  3. Create a PackageInstallerSession calling PackageInstaller.createSession(com.datalogic.device.app.PackageInstallerListener). The PackageInstaller.createSession(com.datalogic.device.app.PackageInstallerListener) method takes as parameters the instance of PackageInstallerListener created at the previous step.
  4. Start a session calling openSession().
  5. Call install(java.lang.String, boolean) to install the first application.
  6. Call install(java.lang.String, boolean) to install the second application.
  7. Close and commit the session calling closeSession().
  8. 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