开发者

How to communicate two android applications?

i want to sent data from one applications to another androi开发者_运维技巧d application, i am new to this android so please help me...


Look up intents. That's the preferred way to do it.

Apps can support any number of intents, and you can pass any data along with the intent.


While Intents are a good way of doing them, if you want to pass a lot of data across I suggest you look at IPC services. These allow you to open up a communication channel between the two processes and talk. In intents whatever you want to send to an app gets sent to all the apps wanting to listen to that intent, so keep that in mind.


This is pretty old thread but i'll still put this info which might help someone facing the similar issue.

  1. For simple message & less data passing between processes/activities you can use intents.
  2. To pass large amount of data & to expose some functionalities within processes you can use remote services(aidl).
  3. To share data safely & securely within processes & activities the ideal choice would be Content provider.

Cheers..!


For inter thread communicaton(between activity and service/other activity) use intents or handler. But for inter process communication(between 2 different application) use aidl.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜