Skip to content
Advertisement

Tag: bluetooth

Byte array to string conversion

I’m making an Android app that communicates with bluetooth device. I’m writing a specific message to chosen characteristic as follows: My conversion function looks like this: I’m trying to figure out why in this case my conversion output looks like this: D/uploadDataset: Message: �������������������� It is strange, because the same conversion function works perfectly fine when I’m using it to

android 10 is crashed when starting bluetooth service

in a couple of days before, I wrote some lines of code to connect application to a HC-05(a Bluetooth module) via a service. I know that a simple service can not be alive in a android 8+. so I modify my service using some free tutorials available on YouTube channels like the following: https://www.youtube.com/watch?v=BXwDM5VVuKA android 7- don’t have any problem

Android BLE Scan Callback is not called after scanning for BLE devices

I’m creating an Android app that scans all nearby BLE (Bluetooth Low Energy) devices using Android Studio. I think I have implemented all these documentations: https://developer.android.com/guide/topics/connectivity/bluetooth/ble-overview https://developer.android.com/guide/topics/connectivity/bluetooth/permissions#java https://developer.android.com/guide/topics/connectivity/bluetooth/setup#java https://developer.android.com/guide/topics/connectivity/bluetooth/find-ble-devices But as you can see in the log below, (the problem) there are no BLE devices scanned by the app. Here are the logs in the logcat: I think it could

Could not load FFI provider when using module-info.java

my Linux Java application uses bluetooth devices. I use this library in order to communicate with bluez stack : https://github.com/hypfvieh/bluez-dbus. It worked very well until I added module-info.java to my client code. Suddenly I got this error: Exception in thread “main” java.lang.UnsatisfiedLinkError: could not load FFI provider jnr.ffi.provider.jffi.Provider at jnr.ffi@2.1.15/jnr.ffi.provider.InvalidRuntime.newLoadError(InvalidRuntime.java:101) at jnr.ffi@2.1.15/jnr.ffi.provider.InvalidRuntime.findType(InvalidRuntime.java:42) at jnr.ffi@2.1.15/jnr.ffi.Struct$NumberField.(Struct.java:872) at jnr.ffi@2.1.15/jnr.ffi.Struct$Unsigned16.(Struct.java:1240) at jnr.unixsocket@0.33/jnr.unixsocket.SockAddrUnix$DefaultSockAddrUnix.(SockAddrUnix.java:209) at jnr.unixsocket@0.33/jnr.unixsocket.SockAddrUnix.create(SockAddrUnix.java:174)

Buetooth connection failed: read failed, socket might closed or timeout, read ret: -1

I am trying to create a Bluetooth connection. I can search for nearby devices but when I try to connect I get an error I do not understand: LOGCAT I Have two classes for connect, one that receives the device and execute the connection, an other for make connection. ConexionActivity.Java ConnectThread.java Imports Answer Try to use , createInsecureRfcommSocketToServiceRecord(MY_UUID) in place

Difference between 0x0A and 0x0D

I was studying about bluetooth and I was trying to write the code to keep listening to the input stream while connected and i came across this following code snippet: Can someone explain what is the difference between 0x0A and 0x0D. And also give a brief explanation about this code. Kindly share your views. Answer The values starting 0x are

Advertisement