I'm trying to load external classes dynamically in an Android app, using a proxy object to intercept calls to the methods. For definition, for use a proxy object, classes must implement an interface. I thought if I create a proxy with an interface I will be able to call classes that not implement it directly. I tried use the same package name and interface implemented in the external class, but it doesn't work.
I have tried some solutions, but I'm not able to load classes dynamically because I receive a ClassCastException.
So I want to intercept object calls and do a function that is implemented in a external apk, using DexClassLoader to load it. I think it is not possible using proxy pattern.
Any ideas?