Reputation: 3
My app needs to install few other apks and I need to exactly know when installation process completes. I am using below to detect package addition, replacement etc.
<receiver android:name=".services.InstallReceiver">
<intent-filter >
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.PACKAGE_ADDED" />
<action android:name="android.intent.action.PACKAGE_CHANGED" />
<action android:name="android.intent.action.PACKAGE_INSTALL" />
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<action android:name="android.intent.action.PACKAGE_REPLACED" />
<data android:scheme="package" />
</intent-filter>
</receiver
Sometimes app installations are failing (because sometimes they are system apps or greater version is already present etc).
Is there a way to detect these failures? logs have details of what happened but I am unable to get these details from packagemanager or InstallAppProgress.java..
W/InstallAppProgress: Replacing package:com.xxxx.xxxx
W/PackageManager: Can't install update of com.xxxx.xxxx update version 308 is older than installed version 312
D/InstallAppProgress: Installation error code: -25
I/InstallAppProgress: Finished installing com.diune.pictures
Upvotes: 0
Views: 713
Reputation: 26
Blockquote Installation error code: -25
This error code identifies that you trying to install the older version of the package that is already installed.
Upvotes: 1