Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

319
Views
BLE : onConnectionStateChange Status 8 on Samsung phones

I am developing a heart rate monitoring app where I am reading data from BLE device, for all other phones there is no issue but for Samsung mobile like Note 8, which uses Bluetooth version 5.0 It is auto disconnect after some time and I am getting status 8

Code :

For connect

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
      mGattClient = device.connectGatt(this, false, mGattCallbacks, TRANSPORT_LE)
    } else {
      mGattClient = device.connectGatt(this, false, mGattCallbacks)
    }

// Connection state change

override fun onConnectionStateChange(gatt: BluetoothGatt, status: Int, newState: Int) {
      when (newState) {
        BluetoothProfile.STATE_CONNECTED -> {
//           this sleep is here to avoid TONS of problems in BLE, that occur whenever we start
//           service discovery immediately after the connection is established
           mGattClient?.discoverServices()
        }
        BluetoothProfile.STATE_DISCONNECTED -> {
          Log.d(TAG,"Disconnected status"+ status)
        }
      }
    }

    // New services discovered
    override fun onServicesDiscovered(gatt: BluetoothGatt, status: Int) {
      when (status) {
        BluetoothGatt.GATT_SUCCESS -> mListener?.deviceConnected(MESSAGE_CONNECTED, status)
        else -> Log.w("BLE", "onServicesDiscovered received: $status")
      }
    }

I have posted this on google issue tracker

https://issuetracker.google.com/issues/122856771

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

This issue has nothing to do with Android OS itself or your software. The error code 8 means Connection Timeout according to the Bluetooth specification. It means the Bluetooth hardware in the phone lost connection to the device. There are mainly three reasons: bad antenna / radio reception, clock drift between the two devices so they lose synchronization, too many scheduling conflicts (if you have multiple connections).

Is you experience that your Note 8 has significantly worse performance than other phones, send an issue report to Samsung.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!