PackageInstallerUpgrade Method |
Call this method to upgrade an application installed on the device.
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 virtual int Upgrade(
string apk,
IPackageInstallerListener listener
)
Public Overridable Function Upgrade (
apk As String,
listener As IPackageInstallerListener
) As Integer
Parameters
- apk
- Type: SystemString
- String full path of the .apk to be used to upgrade the application already installed that has the same Package Name of this .apk. - listener
- Type: Com.Datalogic.Device.AppIPackageInstallerListener
- IPackageInstallerListener instance that implements
the method [M:Com.Datalogic.Device.App.IPackageInstallerListener.OnResult(System.Collections.Generic.IList`1)] to handle the result of the method.
Return Value
Type:
Int32intSuccess in case of success,
otherwise a possible error code, matching one of the
PackageInstallerException error constants.
Exceptions Remarks Call this method to upgrade an application installed on the device.
The method is executed alone, not grouped together with other methods as we can be done using a PackageInstallerSession
.
The result of the command is received through the listener method [M:Com.Datalogic.Device.App.IPackageInstallerListener.OnResult(System.Collections.Generic.IList`1)]
.
Example:
PackageInstaller packageInstaller = new PackageInstaller(context);
PackageInstallerListener listener = new PackageInstallerListener{public void onResult(List results) {...}};
packageInstaller.upgrade("/dir1/dir11/dir116/pkg1_v2.apk", listener);
[Android Documentation]
See Also