Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top