I want to add a non-native shared library to Android so every application on the device would be able to use it. I mean using packaged classes just like a core library as if they were present in the application itself.
I studied Android source code to figure out a way to add a new path to the application ClassLoader
and found out that it is created during startup and there's no way to change the paths later. I can use my own ClassLoader
, but all I will get after loading a class will be a reference to a Class
object. This way I will be bound to work through reflection mechanism, which is slower than the native execution system.
Is there any way to organise a shared library on Android?
Update: just to be clear here, I don't need interaction between applications. I need classes which I can reuse in any application. Also static libraries don't really suit my needs because this will bloat the applications.