简体   繁体   中英

Activate Bluetooth SPP in Android?

I am trying to use Bluetooth SPP to communicate over it. In some Android phones, SPP profile is not activated. I faced the problem in the application that SPP was not activated and so the connection could not be established over bluetooth and when I started another app that is 3g hotspot which I think activates SPP and I was able to connect over bluetooth in my app.

So, how can we actually activate SPP profile of bluetooth in Android devices? And does all the android devices has SPP profile?

In developer.android.com BluetoothSocket :

The most common type of Bluetooth socket is RFCOMM, which is the type supported by the Android APIs. RFCOMM is a connection-oriented, streaming transport over Bluetooth. It is also known as the Serial Port Profile (SPP).

This might answer your question .. https://source.android.com/devices/bluetooth/services

SPP (or ability to use Java API's to establish RFCOMM channels) is available from Android (2.0/2.1) release (Eclair) onwards

On the Android phone you will probably need to run an application that initiates the service over SPP. **

public BluetoothServerSocket listenUsingRfcommWithServiceRecord (String name, UUID uuid)

** API can be used to create a service with specified UUID to listen, Doing this should make this service visible to other devices which can then connect to it.

I just called Samsung help regarding bluetooth SPP on an S8+ phone. They tell me wait for Android Oreo as it isn't available till then. My previous Sony Xperia used Ntrip Client to talk to an external Geneq GPS to receive corrected coordinates and worked really well. Seems we went backwards somewhere? Ntrip client on the phone collects an internet data stream of GPS corrections every five seconds and sends these to the GPS. The GPS uses the corrections and sends back adjusted coordinates to the phone to use in any application. I would appreciate someone brighter than me pointing out a quick fix I just load and run to bring back this functionality.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM