I've made an app that receives information from a HC-05 Bluetooth module connected through Arduino. I've made a List Picker to choose my HC-05, but I keep getting Error 515: Not connected to a Bluetooth Device even though it is paired when I check Bluetooth settings in my phone. Here's the code:
You might want to show us the corresponding blocks...
Taifun
(Canned Response ABG - Bluetooth non-BLE SCAN Permission Blocks)
The easiest solution, for immediate relief
(from @Barry_Meaker) ...
I had the same issue. The problem is your app does not have permission to see nearby devices. The solution is to give your app permission on your phone (no code changes in your app).
on your phone,
goto settings
search for your app
in App Info for your app select Permissions
change Nearby Devices from Not Allowed to Allowed
Done
By the way, the very first time you run the app, Android will ask if you want to grant the app this permission. If you say no, or ignore the pop-up, the permission will be set as Denied. Android will not ask again.
A more complex approach, for professional app development: