I am struggling with the idea of getting CustomView from another application. Lets say I have two applications A and B. I know package name of CustomView, for example com.applicationb.CustomView. Is it possible to create an Object of this Class in application A at runtime?
My aim is to find a way to create CustomViews and being able to show them in my application. But I want them (views) to be a separate apk, which may be published to Android Market, and downloaded as some kind of extension.
CustomView would only display somekind of animation on screen (for example falling leaves). It would not work on any data in first application.
Edit
I found something like this:
@SuppressWarnings("rawtypes")
Class c = Class.forName(package_name);
Method m = c.getDeclaredMethod(method_name);
m.setAccessible(true);
Canvas can= (Canvas) m.invoke(null, null); // since there are no parameters, and called function is static
I hope this will work. I let you know.
As I promissed here is result.
With this code it is possible to get View from application B from using application A.