Our app shows an HTML flashcard to the user.
We have added several layers of \"filters\" to satisfy different groups of users:
You need a dynamically installed plugin which is not part of your application. I think you have a few options for this.
Ship a scripting language interpreter with your app. (eg. ruby - http://ruboto.org/). Create an interface for executing these scripts. Make a central database of such scripts, or load them from external storage. Now, you can execute these scripts and get the required result.
Use a remote service in the plugin apps. Provide an AIDL for third parties to develop apps with a remote service with that AIDL. Such services should also conform to an intent filter defined by you. Now you can use packagemanager to find such services, select one and connect to it. Now you can call all the AIDL methods. This will be inter process communication using binder, for your application this will be a synchronous call. (see this SO question for details - Access remote service in different application)
Downside to this approach is that all these services need to be running when your app is running, so you have to handle the starting/stopping of these services. It will also affect the power consumption if the services are running in the background.
Third party installed apps that have a broadcast receiver with an intent filter for custom intent defined by you. Also, your app needs to have a broadcast receiver with a custom intent that the plugins can call with the result. Now, say you want to call a third party plugin for some transformation, you have to do this:
Use packagemanager to find all the third party apps conforming to your custom intent. Send a broadcast with extradata about transformation. Handle the transformation in the broadcast receiver of the plugin app. Once transformation is done, send a broadcast with result to the original app.
This option is entirely asynchronous, and it may take any amount of time to execute with no guaranties.