I am working on a library to allow apps to self-update, for those that are being distributed outside of the Android Market.
My original plan was to include code that
I agree with Jules analysis, and I would add concrete precisions :
In PackageInstallerActivity
, which is called by ACTION_VIEW on an apk, there is this in the onCreate()
method:
315 String apkPath = mPackageURI.getPath();
316 File apkFile = new File(apkPath);
And before that, this method from PackageUtil
is called:
73 public static PackageParser.Package getPackageInfo(Uri packageURI) {
74 final String archiveFilePath = packageURI.getPath();
75 PackageParser packageParser = new PackageParser(archiveFilePath);
76 File sourceFile = new File(archiveFilePath);
77 DisplayMetrics metrics = new DisplayMetrics();
78 metrics.setToDefaults();
79 return packageParser.parsePackage(sourceFile, archiveFilePath, metrics, 0);
80 }
All this tends to confirm that the PackageManager do expects only File Uris.
The log you have, Skipping dir:
is found in packageParser.parsePackage
, which tests whether the path given in the Uri is a file or not.