EJTH
EJTH

Reputation: 2219

get package resources without knowing the exact package name

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?

Upvotes: 0

Views: 357

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007584

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.

Upvotes: 1

Related Questions