I want to implement a plugin system for an Open Source app, because it has become really large, with many features that only a few users need. Releasing different apps is not a good solution, because userA wants feature7 and feature24 whilst userB wants feature39 and feature24.
The main parts would be:
- A way for developers to create plugins, including their metadata
- A kind of official repository where approved plugins are made available. This could be a specially-crafted HTTP site, or an FTP server, or Play Store (in which case there is nothing special to do for this part), or anything else.
- A way for users to download/enable/disable plugins, either from the official repository or directly as a file
Is there a sort of library or framework (or at least a collection of code snippets) to ease up the construction of such a system?
Here is what I would like a plugin to be able to do:
- Redefine the layout of a particular screen (load deflated XML?)
- Redefine a method of a class (load dex class?, AOP?)
For instance, one of the plugins must add a button on a particular screen, and clicking this button increments a value in the app's database. This is not doable with Content Providers and Intents, as far as I know. In every answer, please describe how the proposed solution would deal with this scenario, thanks!
I want to avoid making the core app's code complex with hooks for everything.
Solutions must be free, and any resulting code/files should be releasable as open source.