How do two android applications talk to each other?

冷暖自知 提交于 2019-12-03 08:46:05

Question is, do the two applications have to go through the Mobile Service Provider to enable communication?

If you want to use 3G, yes. If you want to use WiFi, no. Generally, Android applications do not care where the Internet connection comes from.

or they can just talk to each other directly via some public IP/WIFi etc.

If they have a WiFi connection, they have a WiFi connection. What you do with that WiFi connection is up to you, using Java sockets, and respecting all the normal problems with Internet access (e.g., NATs).

Again, do the two applications have to go through the Mobile Service Provider to facilitate communication? or they just establish a straight TCP/IP communication via some public IP?

You ask for a Java socket. You get a Java socket. You do something with the Java socket. Where that Java socket comes from and how its connection works is generally under the covers: 3G, WiFi, a squadron of very tiny passenger pigeons, etc.

I'd suggest Android – IPC, aidl and IBinder and Grasping Android's IPC mechanism for a start. After that just hunt on Google for 'Android IPC'

Something about sync is here Synchronization in Android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!