This is my scenario:
- I have a “remote” service (local to the Android device but running on another separate process).
- I built an API to interact with this service. It’s based on
Message. - In this API, it is required to pass some object defined by the API, e.g. instances of a custom
Entityclass.
The problem I’m having here is that for Entity subclasses, the service cannot unmarshall them, because obviously he doesn’t know such classes (throws ClassNotFoundException). But all I want is to access Entity class functionality through this subclasses.
Is there any way to acheive this? Thank you in advance!
If you are sending serialized java objects to your remote API, the API must know the object to deserialize it (therefore it must know each subtype of Entity).
Maybe you can try sending your objects as JSON and parse the JSON data to an Entity-Object. I’m not sure if JSON can help you, but you can give it a try. (en.wikipedia.org/wiki/JSON)