K kdu300 New Member Nov 15, 2023 #1 Hello everyone, As a B4A newbie, I am overwhelmed by this problem. To fetch a lot of data faster, there is the possibility to increase the priority with the function "requestConnectionPriority" as of version Lollipop. It looks like this in Java: mBluetoothGatt = gatt; if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { gatt.requestConnectionPriority(BluetoothGatt.CONNECTION_PRIORITY_HIGH); gatt.requestMtu(505); } else { gatt.discoverServices(); } How should I call "requestConnectionPriority" in B4A? I would have expected to be able to call something like this. manager.requestConnectionPriority(CONNECTION_PRIORITY_HIGH) Thanks for your help
Hello everyone, As a B4A newbie, I am overwhelmed by this problem. To fetch a lot of data faster, there is the possibility to increase the priority with the function "requestConnectionPriority" as of version Lollipop. It looks like this in Java: mBluetoothGatt = gatt; if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { gatt.requestConnectionPriority(BluetoothGatt.CONNECTION_PRIORITY_HIGH); gatt.requestMtu(505); } else { gatt.discoverServices(); } How should I call "requestConnectionPriority" in B4A? I would have expected to be able to call something like this. manager.requestConnectionPriority(CONNECTION_PRIORITY_HIGH) Thanks for your help
Erel B4X founder Staff member Licensed User Longtime User Nov 16, 2023 #2 Code: manager.As(JavaObject).GetFieldJO("gatt").RunMethod("requestConnectionPriority", Array(1)) '1 = CONNECTION_PRIORITY_HIGH manager.RequestMtu(505) Upvote 0
Code: manager.As(JavaObject).GetFieldJO("gatt").RunMethod("requestConnectionPriority", Array(1)) '1 = CONNECTION_PRIORITY_HIGH manager.RequestMtu(505)
K kdu300 New Member Nov 16, 2023 #3 Hello Erel, thanks for the quick help. I'm going to test it tonight. ? Upvote 0