Chrome’s remote debugging (USB debugging) not working for Samsung Galaxy S3 running android 4.3

My devices stopped working as Chrome de-activated the now depracated ADB plugin as it’s built in dev-tools now. I downloaded the SDK and followed the instructions at Chrome Developers. How ever I found the instructions served by Alphonso out not to be sufficient and I did it this way on Windows 8: Download Android SDK … Read more

Is the native Android BLE implementation synchronous in nature?

Samsung recently published a “migration”-document on the same page I linked in my question. They exactly answer my question while comparing the new native BLE API with the Samsung BLE API: The synchronous nature of the stack and F/W hasn’t been affected. That is, if we call for example, writeCharacteristic for a particular characteristic, if … Read more

Communicating between iOS and Android with Bluetooth LE

I’ve already gone through this for at least one week having this same issue. I’ve already asked a question here and I’ve already answered on my own. The main problem is an Android BUG issue. It’s sending a non permitted command on a fixed L2CAP channnel. But when Android is communicating with normal peripheral BLE … Read more

How to get the battery level after connect to the BLE device?

I have solved this problem. public class BluetoothLeService extends Service { private static final UUID Battery_Service_UUID = UUID.fromString(“0000180F-0000-1000-8000-00805f9b34fb”); private static final UUID Battery_Level_UUID = UUID.fromString(“00002a19-0000-1000-8000-00805f9b34fb”); public void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) { if(status == BluetoothGatt.GATT_SUCCESS) { broadcastUpdate(ACTION_DATA_AVAILABLE, characteristic); } } private void broadcastUpdate(final String action, final BluetoothGattCharacteristic characteristic) { final Intent intent = … Read more

Android BLE API: GATT Notification not received

It seems like you forgot to write the Descriptor which tells your BLE device to go in this mode. See the code lines that deal with descriptor at http://developer.android.com/guide/topics/connectivity/bluetooth-le.html#notification Without setting this descriptor, you never receive updates to a characteristic. Calling setCharacteristicNotification is not enough. This is a common mistake. code snipped protected static final … Read more

run-as Package ‘a.b.c’ is unknown – Galaxy S4 Jellybean or Android 4.3

Found success by adding this to the activity: private void startGdbServer() { try { new ProcessBuilder() .command(getFilesDir().getParent() + “/lib/gdbserver”, “tcp:5039”, “–attach” ,”” + android.os.Process.myPid()) .redirectErrorStream(true) .start(); } catch (IOException e) { Log.e(TAG, “IOException failed to start gdbserver”); } } Then I wrapped startGdbServer in an Android service and updating the ndk-gdb script to start the … Read more

Android 4.3 Bluetooth Low Energy unstable

Important implementation hints (Perhaps some of those hints aren’t necessary anymore due to Android OS updates.) Some devices like Nexus 4 with Android 4.3 take 45+ seconds to connect using an existing gatt instance. Work around: Always close gatt instances on disconnect and create a fresh instance of gatt on each connect. Don’t forget to … Read more

IOException: read failed, socket might closed – Bluetooth on Android 4.3

I have finally found a workaround. The magic is hidden under the hood of the BluetoothDevice class (see https://github.com/android/platform_frameworks_base/blob/android-4.3_r2/core/java/android/bluetooth/BluetoothDevice.java#L1037). Now, when I receive that exception, I instantiate a fallback BluetoothSocket, similar to the source code below. As you can see, invoking the hidden method createRfcommSocket via reflections. I have no clue why this method is … Read more