Is using Parcelable the right way to send data between applications?

前端 未结 3 850
野趣味
野趣味 2021-02-09 10:30

I am trying to understand how to communicate between applications in Android - not just between Activity instances.

I set up a \'client\' that sends a Messe

3条回答
  •  说谎
    说谎 (楼主)
    2021-02-09 11:25

    OK, I found the 'easy way' I was looking for. You can put a Bundle into the Message.obj field. Bundle is Parcelable so can be transported between client and server. There's no issue of the server not knowing what class it's receiving as Bundle is 'built into' Android Java. And Bundle can apparently include 'sub-Bundles' with in. This is simpler than having to deal with ensuring both parties know the definition of a user-defined class. Thanks for the answers above - I certainly appreciated the info!

提交回复
热议问题