2

I want to connect two android phone only via BLE. Is it possible? because as per my understanding using Android API I can only connect with BLE enabled devices like smartwatches headphones etc. If I run startLescan() method it only shows my fitness band and headphone. It does not show other android phones.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Abubakar
  • 1,022
  • 10
  • 20

2 Answers2

2

Yes its possible. As the hardware equally supports to act as a master or slave, but it depends on whether the OS has provide you the required interface to make a device act as master as well as slave. THe BLE in android phone is equally capabale of becoming a master or peripherical but it depends on whehter android has exposed some interface to make it work ortherwise if not you have to root/reflash your device and make changes at OS level.

Yes, two BLE devices can communicate and has been ever since the original 4.0 release. The change in 4.1 states that a single device can act as both a master and as a slave simultaneously to two different devices. Once device has to act as periphiral and other as master.

See this: http://www.blemobileapps.com/ble-mobile/

For android this link might be helpful for you: https://code.tutsplus.com/tutorials/how-to-advertise-android-as-a-bluetooth-le-peripheral--cms-25426

Reference: Chipsets/Devices supporting Android 5 BLE peripheral mode

Let me know if this answers your question.

Faizan Tariq
  • 351
  • 4
  • 14
1

It is possible to connect to Android phone with BLE.

One of the phones has to be a BLE Server and must advertise itself (a role usually performed by devices like smartwatches and headphones) to be discovered by the other phone.

To advertise itself the app uses the BluetoothLeAdvertiser class.

Such API was added starting from level 21 Lollipop so your server phone should be at least a 5.0 Android device.

Personally I found this tutorial by Andrew Lunsford very useful for understanding how to realize such functionality.

attdona
  • 17,196
  • 7
  • 49
  • 60