2

How to communicate mobile device with BLE when an application installs in mobile and trying to get other mobile device battery information where ScanCallback does not return any information on searching BLE device.

  private ScanCallback scanCallback = new ScanCallback() {
         @Override
         public void onScanResult(int callbackType, ScanResult result) {
 //            super.onScanResult(callbackType, result);
             Log.e("scaning result"," :"+result.getDevice().getName());
             bluetoothDevice = result.getDevice();
             deviceAddress.setText(bluetoothDevice.getAddress());
             deviceName.setText(bluetoothDevice.getName());
             progressBar.setVisibility(View.INVISIBLE);
         }

         @Override
         public void onBatchScanResults(List<ScanResult> results) {
             super.onBatchScanResults(results);
         }

         @Override
         public void onScanFailed(int errorCode) {
             super.onScanFailed(errorCode);
             Log.d(TAG, "Scanning Failed " + errorCode);
             progressBar.setVisibility(View.INVISIBLE);
         }
     };
vincrichaud
  • 2,218
  • 17
  • 34
Salman
  • 159
  • 1
  • 2
  • 7
  • What is your question here? It rather seems you are just complaining that the advertising data of some particular device doesn't include battery information? – Emil Apr 20 '18 at 16:38

0 Answers0