I am making an app to scan all tags using Bluetooth LE. I have to implement a interval feature where an user can enter seconds for scan delay, but i have not found any method to do so. I tried implementing TimerTask but it still scans more than one device in a second Is there any way to implement a
Tag: bluetooth
BluetoothGattCallback onCharacteristicRead never called back
I’m still trying hard to read from a BLE device (laser meter) from an android (using java) Basically I’m trying to get which fields are those I’m interested into (aka the measures) So far i discovered 5 services (i found the usage here): 3ab10100-f831-4395-b29d-570977d5bf94 (I can’t figure out what is this bad boy usage) 0x1800 -> probably the ones I’m
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
Deprecated method “startActivityForResult()” vs properly bluetooth set up
Hey I try to make bluetooth service according to the information on the official android dev website. But I came across to the deprecate method startActivityForResult(). What should I do to properly turn on bluetooth device? Here is my code with deprecated method: Answer It’s a special AndroidX extension that wraps the startActivityForResult and provide sort of a simpler method.
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