I have an Android App and an Android Service -- two separate APKs, managed and released independently. All that needs to be agreed is data interchange format, aka "local API".
Currently, there is quite a lot of packing/repacking going on which costs development time. The Service also communicates with the backend web services using JSON/REST. So whatever the client passes, is often repackaged to JSON when leaving out and vise-versa. I'm trying to see if things can be simplified and cleaned up in the way we exchange data between Android "client-server" apps, taking down-the-road backend communication into perspective.
AFAIK my options for inter-Android data exchange:
- native Java serialization (least preferred naturally)
- native Android Bundle/Parcelable, but then repackage to JSON if going out
- Google protobuffers (or similar IDL-based) when serialized wrapped in a Bundle under one field. If web app speaks binary it would avoid repackaging, plus more compact on the wire and type-safe which helps during development.
- Stringified JSON wrapped in a Bundle. Pro is no need to repackage when communicating with the backend, easy to debug but no compile-time checks nor wire-efficiency.
What do you use and to what level of satisfaction?
