Question

This is a very precise question about the package installer open source project hosted on google code project: http://android.amberfog.com/?p=98

When I try to compile it, I get a ClassNotFoundException exception for this class: android.content.pm.PackageParser.

I don't really understand what happens as this class is part of android sdk but not documented in android docs.

Did someone use that package before and knows how to compile it?

Was it helpful?

Solution

UPDATED

You are trying to compile the PackageInstaller application, which is the application that Google ships as a part of the Android system, and which uses some API that are hidden from public SDK (like android.content.pm.PackageParser). There are few techniques available for accessing that hidden API, but even if you were able to compile PackageInstaller it won't run because it requires few permissions (like android.permission.INSTALL_PACKAGES) that can be granted to the application only when it's signed with the System certificate. And only vendor of the device can do that.

But let me ask you, why do you need to compile PackageInstaller app? The author of the article at http://android.amberfog.com/?p=98 shows how to install/uninstall the .apk by sending the Intent to Google PackageInstaller application. You don't need to recompile PackageInstaller to be able to do that.

OTHER TIPS

I guess you have to pull out all the android code from the repository and compile it. You can try download only the class you need and all it's dependencies.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top