Click or drag to resize

PackageInstallerSelfUpgrade Method

Call this method to upgrade the current application.

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 SelfUpgrade(
	string apk
)

Parameters

apk
Type: SystemString
- String full path of the .apk to be used to upgrade the current application.

Return Value

Type: Int32
intSuccess in case of success, otherwise a possible error code, matching one of the PackageInstallerException error constants.
Exceptions
ExceptionCondition
PackageInstallerException - in case of error, when exceptions are enabled through the ErrorManager singleton.
Remarks

Call this method to upgrade the current application.

Do not suspend the UIThread while waiting for the result of the method otherwise an application’s deadlock can occur. In case of success the intent "android.intent.action.MY_PACKAGE_REPLACED" is fired.

In case of failure:

- if the problem is found before contacting the remote service an error is returned; the error code is one of the PackageInstallerException

error constants, but when exceptions are enabled @throws PackageInstallerException

.

- if the problem is found in the remote service the intent "com.datalogic.app.UPGRADE_ME_STATUS" is fired.

The extra data of the "com.datalogic.app.UPGRADE_ME_STATUS" are:

- "android.content.pm.PackageInstaller.EXTRA_STATUS" int

: a possible error code, matching one of the PackageInstallerException

error constants.

- "android.content.pm.PackageInstaller.EXTRA_STATUS_MESSAGE" String

: an error string message.

- "android.content.pm.PackageInstaller.EXTRA_PACKAGE_NAME" String

: Package Name of the application.

[Android Documentation]

See Also