i change my app from 29 to 31 (targetskdversion in manifest)
now, this function return error:
(Exception) java.lang.Exception: java.lang.reflect.InvocationTargetException
now, this function return error:
(Exception) java.lang.Exception: java.lang.reflect.InvocationTargetException
B4X:
Public Sub GetDeviceName As String
Try
Dim adapter As JavaObject
adapter = adapter.InitializeStatic("android.bluetooth.BluetoothAdapter").RunMethodJO("getDefaultAdapter", Null)
'Log("Name device: " & adapter.RunMethod("getName", Null))
Dim N As String
n = adapter.RunMethod("getName", Null)
' Log("Name device: " & n)
Return n
Catch
Log(LastException)
Msgbox("No se puedo obtener device name","Error")
End Try
End Sub
Last edited: