use PackageManager
to locate apps that should be treated as extensions of yours. you can do this in various ways. For example, you can use PackageManager.queryIntentActivities()
to find all apps containing activities that handle a particular intent. or, you can use PackageManager.getInstalledPackages()
to list all apps on the device and then look for extensions by package name, metadata, whether they hold a permission you define, etc.
once you find your extensions, you need to decide how you're going to interact with them. the most secure mechanism is using intents to call into activities, receivers, or services provided by the other app.
based on the kinds of things you're asking for - arbitrary access to objects and views - you may prefer to use DexClassLoader
to load the code of the other app directly into your process; this lets the other app do whatever it wants, including as you say create views, change appearances, etc. it also lets the other app use all of your package's permissions, so you will definitely want to let the user know that the other app has that kind of access. as i mentioned before, you can define a permission like "act as a plugin for my app" and require the other app to list that permission in order to be loaded.