Samsung Bluetooth - Android Versions

lip

Active Member
Licensed User
Longtime User
I have been developing an application on Samsung Tablets which uses Bluetooth. The code I use to connect is based on the Bluetooth Example in the forum. I connect to embedded Bluetooth modules and then communicate text strings (SPP). I use two different types of embedded Bluetooth module.

The first three Samsung Galaxy tablets I bought connect to both types of embedded Bluetooth modules perfectly. However, I have just bought a fourth Samsung tablet which will not connect to either type.

The strange bit is that the new tablet WILL connect to the other tablets using the Bluetooth Example, so it will be difficult for me to say that there is a fault with the tablet's Bluetooth adapter.

The only differences I can see with the new tablet are (a) it is on a slightly older version of Android and (b) it is the only one with 3G (although I have no SIM card so it is not enabled).

Tablet 1 - GT-P5110 - Android V4.1.1 - ok
Tablet 2 - GT-N8010 - Android V4.1.2 - ok
Tablet 3 - GT-P5110 - Android V4.1.1 - ok
Tablet 4 - GT-P5100 - Android V4.0.4 - will not connect

Tablet 4 detects the device and prompts for a PIN. It appears to accept the PIN but then cannot connect. It asks for the PIN again next time you try to connect. I have not made a mistake with the PIN - to prove this I have unpaired and repaired all of the devices using the first 3 tablets using the known PINs without and problem.

If I try to pair with the device in the tablet's Settings it appears to pair OK. The problem comes when you try to connect. Could it be that the New tablet has a problem with SPP?

Anyone got any experience of this?
 

Dave O

Well-Known Member
Licensed User
Longtime User
No direct experience (yet), but from playing with Open Garden (mesh networking) and researching WiFi Direct and BT for getting tablets to talk to each other in a classroom, the Android 4.0.x version of both protocols is reportedly very buggy. Apparently improved somewhat in Android 4.1+. Seems to match up with your report, but hopefully a guru on this forum will jump in with some real knowledge. ;)
 
Upvote 0

lip

Active Member
Licensed User
Longtime User
No direct experience (yet), but from playing with Open Garden (mesh networking) and researching WiFi Direct and BT for getting tablets to talk to each other in a classroom, the Android 4.0.x version of both protocols is reportedly very buggy. Apparently improved somewhat in Android 4.1+. Seems to match up with your report, but hopefully a guru on this forum will jump in with some real knowledge. ;)

I'm downloading 4.1.2 and will let you know if that fixes it...
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The higher the version the better. Bluetooth is even more problematic in Android 2.x.

Check the unfiltered logs. There are usually related messages there. From my experience with B4A-Bridge bluetooth implementation and testing, newer devices work reliably. This is not always the case with older devices or low end devices.
 
Upvote 0

lip

Active Member
Licensed User
Longtime User
Unfiltered Logs

The higher the version the better. Bluetooth is even more problematic in Android 2.x.

Check the unfiltered logs. There are usually related messages there. From my experience with B4A-Bridge bluetooth implementation and testing, newer devices work reliably. This is not always the case with older devices or low end devices.

Tried upgrading Android (spoke to Samsung) but 4.0.4 is the latest for this model.

The unfiltered log is below. Does this mean anything to you?

B4X:
...connect(55, RFCOMM) = 111 (errno 111)
java.io.IOException: Connection refused
   at android.bluetooth.BluetoothSocket.connectNative(Native Method)
   at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:242)
   at anywheresoftware.b4a.objects.Serial$1.run(Serial.java:152)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
   at java.util.concurrent.FutureTask.run(FutureTask.java:137)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
   at java.lang.Thread.run(Thread.java:856)
enqueueToast()
Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@41facac8 (uid=1000 pid=3523)
Starting input on non-focused client mCurClient info is ClientState{41756748 uid 10115 pid 3816}
java.io.IOException: Connection refused
showStatusIcon on inactive InputConnection
Flushing caches (mode 1)
releaseWakeLockLocked flags=0x0 tag=BluetoothPairingDialog myUID=1000 myPID=215 myTID=416
enqueueTosetHidden false
releaseWakeLockLocked flags=0x0 tag=BluetoothPairingDialog myUID=1000 myPID=215 myTID=383
cancelNotification - pkg:com.android.settings, id:17301632, tag:null
onReceive() - RSSI_CHANGED_ACTION, WIFI_STATE, NETWORK_STATE
setHidden false
setHidden false
setHidden false
acquireWakeLock flags=0xa tag=KEEP_SCREEN_ON_FLAG uid=1000 pid=215   myUID=1000 myPID=215 myTID=215
setHidden false
GC_FOR_ALLOC freed 2294K, 27% free 8122K/11015K, paused 31ms
setHidden false
Grow heap (frag case) to 9.826MB for 1899536-byte allocation
setHidden false
setHidden false
GC_CONCURRENT freed 31K, 10% free 9945K/11015K, paused 6ms+1ms
setHidden false
setHidden false
closing mini mode apps panel
stopOutput() output 1, stream 1, session 100
changeRefCount() stream 1, count 0
getNewDevice() selected device 0
setOutputDevice() output 1 device 0 delayMs 184 force 0
setOutputDevice() setting same device 0 or null device for output 1
setHidden false
ast()
 
Upvote 0
Top