let's say I have a class called "MyClass". I need to send it from my server to an Android phone over GCM. Now, I am doing this by sending its all fields seperately and constructing MyClass again on the phone. Is there any way to send an object directly over GCM?
Instead of sending all the fields separately, you can encode them to your favorite serialized format (XML, JSON, etc...) and pass the String representation of the object in a single field. Then your app would need to have a method to deserialize the object from that field.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With