Android - communicating between two devices

后端 未结 8 1149
栀梦
栀梦 2020-11-29 00:59

What is the best way for an Android app installed on two devices to communicate with each other? Can the devices connect directly without using text messaging?

8条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-29 01:36

    As was already suggested, sockets are the easiest way to accomplish this if your devices are all connected to a network.

    There are things to accomplish here:

    1. Use Network Service Discovery to find devices running your app
    2. Connect to other instances of your app using a socket

    For a complete tutorial you can check this out

提交回复
热议问题