I am implementing a library, and I would like the functionality of this library included in applications that I develop with very little effort. For example, I would like each application I develop to implement a content provider that supplies a path to a file.
At present I identify applications that support the library using a meta-data tag. I would prefer it if I could add the content provider’s tag at compile time, rather than explicitly adding the tag to the manifest of each new application I develop.
My question: Is there a way of inserting code into the manifest at run-time?
No, sorry.
If that is all the
ContentProvideris for, this is akin to swatting a fly with a truck. Just call some method on some class exposed by the library from the application, passing in the path. Or, have the path name be held in some pre-defined resource name (e.g.,R.string.this_is_the_path_yo), and look up that resource by name at runtime from the library. Or, have the file be in some pre-defined location (e.g., withinassets/) and skip the whole resolve-the-path problem.