Question

Say I have an APK and several addon APKs that provides resources from the res folder for use in the main app.

How would my main app find the addon packages?

I understand that i can use PackageManager to get resources from a known package, but can i query ressources from all packages that starts with com.example.myapp.addons.* or is there some better way to query for supported packages?

Was it helpful?

Solution

can i query ressources from all packages that starts with com.example.myapp.addons.*

No, but you can find out all installed packages via getInstalledPackages() on PackageManager. Iterate over the results and find those whose package names match your regular expression.

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