Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

315
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda