markusfisch / BinaryEye

Yet another barcode scanner for Android
https://play.google.com/store/apps/details?id=de.markusfisch.android.binaryeye
MIT License
1.42k stars 117 forks source link

Add Bluetooth functionality #363

Closed KamaleiZestri closed 1 year ago

KamaleiZestri commented 1 year ago

Per issue #325, here is bluetooth functionality.

It should work with any bluetooth receiver that shares it's UUID of 8a8478c9-2ca8-404b-a0de-101f34ab71ae

markusfisch commented 1 year ago

Great! 👍 Thanks a lot!

DienoX commented 1 year ago

Unfortunately, when I enable this function, the application closes.

Android 13, Samsung Galaxy S20

markusfisch commented 1 year ago

May I ask what version you are using? 1.60.0 or 1.60.1?

DienoX commented 1 year ago

1.60.1 The update was from the Google Play Store. SmartSelect_20230328_120453_Settings

markusfisch commented 1 year ago

Does it close when you enable the option in settings or when you're scanning with it?

DienoX commented 1 year ago

After enabling the feature and selecting the host everything works. The application closes after scanning the code.

KamaleiZestri commented 1 year ago

Not sure if it is related, but I have noticed that it crashes when attempting to connect to a host that is not running a server. Was planning to look more into it further in the week.

DienoX commented 1 year ago

You're probably right. The server was not running. I thought it was HID Bluetooth implementation. I thought it works similar to this app https://play.google.com/store/apps/details?id=io.appground.blek

Is this the server for this application? https://github.com/KamaleiZestri/BinaryReceptor

KamaleiZestri commented 1 year ago

Yes, that is the one I made and use, but really anything will work as long as it uses BinaryEye's UUID.

markusfisch commented 1 year ago

Hm, it's still strange that the app is crashing when the server isn't running because all corresponding exceptions seem to be catched already 🤔

Unfortunately, I don't have a Bluetooth device to test this, and can't run BinaryReceptor (because I'm not running Windows 🙈), so I would really appreciate any help.

KamaleiZestri commented 1 year ago

You're probably right. The server was not running. I thought it was HID Bluetooth implementation. I thought it works similar to this app https://play.google.com/store/apps/details?id=io.appground.blek

Is this the server for this application? https://github.com/KamaleiZestri/BinaryReceptor

The reason this is not an HID implementation is because I didn't even consider it. 🙃 I was too focused on implementing a conversion of HTTP/TCP connection to even consider bluetooth's unique capabilities.

I am unsure how to implement HID profile, but a cursory look shows minSDK at 28. https://developer.android.com/reference/kotlin/android/bluetooth/BluetoothHidDevice

Which coincides with the app you mentioned requiring Android 9. BinaryEye's minSDK is much lower (14 i think) so HID profile(and no bluetooth server software) will not be possible for quite a while.

DienoX commented 1 year ago

It seems to me that @markusfisch will not want to raise the minimum API level. I once talked in another topic that concerned the API level.

markusfisch commented 1 year ago

I will raise the minimum API level at some point later this year, just not now 😉 And not all the way to 28, which really isn't necessary because we can always check the API level at run time and use BluetoothHidDevice only from 28 on.

I want to have a good reason to leave people behind.