Can Android support Zeroconf/Bonjour over Bluetooth? How about TCP/IP?

后端 未结 3 1339
予麋鹿
予麋鹿 2021-02-04 02:27

On iPhone if I create custom service for example \"_test._tcp.local.\" in Bonjour I can seek/broadcast this service through WiFi or/and Bluetooth.

It is possible on Andr

3条回答
  •  梦如初夏
    2021-02-04 02:44

    You can use BluetoothSocket and BluetoothServerSocket to create TCP like sockets over Bluetooth.

    Here is a sample of android dnssd : https://github.com/twitwi/AndroidDnssdDemo

    You may need to modify the jmdns library such that it creates bluetooth sockets if bluetooth is ON, otherwise creates simple sockets. Encapsulate the socket communication in a different class that creates socket conditionally.

提交回复
热议问题