LAMW: It is crash when I call jBluetooth1.GetRemoteDevice lazarus / 43-Android ---------------------------------------------------------------------- Ritt · 2019-03-13 08:14 Hi Everyone, I used the the example "AppBluetoothClientSocketDemo1", the BLE device was founded, so I Call:       try          jBluetoothClientSocket1.SetDevice(jBluetooth1.GetRemoteDevice (deviceAddress));          jBluetoothClientSocket1.Connect();        except          on E: Exception do ShowMessage(E.Message);        end; but it was crashed, I try it in the android studio, it was work, how can I solve this probleam? Thanks ---------------------------------------------------------------------- Ritt · 2019-03-23 11:33 I founded that in the jBluetooth.pas: function jBluetooth_GetRemoteDevice(env: PJNIEnv; _jbluetooth: JObject; _macAddress: string): jObject; var   jParams: array[0..0] of jValue;   jMethod: jMethodID=nil;   jCls: jClass=nil; begin   jParams[0].l:= env^.NewStringUTF(env, PChar(_macAddress));   jCls:= env^.GetObjectClass(env, _jbluetooth);   jMethod:= env^.GetMethodID(env, jCls, 'GetRemoteDevice', '(Ljava/lang/String;)Landroid/bluetooth/BluetoothDevice;');   Result:= env^.CallObjectMethodA(env, _jbluetooth, jMethod, @jParams);   env^.DeleteLocalRef(env,jParams[0].l);   env^.DeleteLocalRef(env, jCls); end;    The call the JNI function 'GetRemoteDevice',  but there is no function with name 'GetRemoteDevice' in the jBluetooth.java.   I think this should be change to 'GetRemoteDeviceByAddress'. ---------------------------------------------------------------------- jmpessoa · 2019-03-23 16:05 Fixed  "jBluetooth.java"!!! Thank you!!!