This is not possible for applications other than the platform (third-party): you must make a request to install PackageManager directly.
PackageManager has a non-public API, installPackage () (line 2584 at the time of this writing):
public abstract void installPackage( Uri packageURI, IPackageInstallObserver observer, int flags, String installerPackageName);
where one of the possible INSTALL_ALLOW_DOWNGRADE flags is:
public static final int INSTALL_ALLOW_DOWNGRADE = 0x00000080;
All of these APIs are hidden and inaccessible to third-party applications. Now you can try to think, but I'm pretty sure that the platform will still restrict their access.
ozbek
source share