Yes, the window popped up like on the HTC and asked to allowing for location permission. As I have said, it works really everything like on the HTC (where it works!), but it does not pop up the list picker to select the device. As I have set up, the text “Scanning…” appears, so it seems the Samsung scans for Bluetooth devices. As the App comes to the point where I should select the scanned device in the list picker, the Samsung phone does nothing and no list pops up! The text rest on Scanning… and no error message or something else shows. It happens only nothing! When I click a second or third time on the bluetoothButton that I have made it happens nothing else too. That is the actual point I am! I have really no idea why it does not work on the Samsung. I thought Sumsung phones have perhaps other commands that I should need?! If I can test this app on a Huawei too, I will give it a chance! But do not know when I can get a Huawei for testing. My brother has his old phone somewhere, but do not find it at the moment :-/ if the app will work on the Huawei too, I really ask me, what Samsung makes special!
But if someone has another idea, please let me know!
By the way, why is the location permission needed for the Bluetooth function? That needs only more battery from the phone! Bluetooth itself does not need a location as I know.
One possible bug in your program, which may or may not be causing issues, is that you call StopScanning in DeviceFound. The DeviceFound event runs multiple times, once for each device encountered while scanning. Maybe there is something the Samsung is reporting that the BLE extension doesn't know how to interpret, so the event fires but the list is empty, and then scanning stops? What if you temporarily disable the StopScanning block?
Location permission and location services are two different things. Because BLE beacons can contain information about the location of the device in the real world, Google decided to make it so that you also have to request location permission so that the user is aware (in theory) that they might be giving away location information, even if you never use other location services. The BluetoothLE extension does not use location services, but it does ask for location permissions in accordance with the Android requirements.
The BluetoothLE extension is also open source, so you're welcome to inspect the sources:
I will give it a try and delete the stopScanning block temporarily. I try it this evening and let you know if something is different.
Thanks for the information about the location permission/services. It sounds interessting, and I will take a look at it, thank you very much!
You can also take a look at the Bluetooth Overview page on the Android Developer site for a more detailed explanation about the permissions:
te voy a pasar mis bloques para que lo adaptes a tu royecto, lo tengo fuccionando actualmente en un samsung
ve a esta pagina, esta en español pero ese metodo fue el que me funciono:
http://kio4.com/appinventor/9C_bluetooth_appinventor.htm
I have tried it, but without luck! It does not show the list to choose the device.
But this is the normal Bluetooth connection, not with the Bluetooth BLE extension! I have a Bluetooth BLE module and this is not working with the normal Bluetooth connection. Thank you anyway!
Could you clarify what you mean by this? Looking at the blocks, I see an Open call, which makes me think that bluetooth_List is a ListPicker object. It will suffer the same problem as stopping the scanning because the ListPicker's list of elements is "frozen" at the point Open is called. ListPicker opens a new activity and it is handed the list of elements at the time it starts. It does not dynamically update while it's open. Instead of opening it, maybe have your "available devices" button also include the length of the elements property to see if it's growing (after disabling the Open block). If you start seeing the number go up, then you know it's gathering device info. If it's always 0, something else is going wrong.
Yes, perhaps I have not said it clear enough. The “_List” is a ListPicker object, “…Button” are buttons.
You mean, I should make the list picker object visible and delete the “set bluetooth_List.Enabled to true” and "set bluetooth_List.Visible to false blocks? I will try it, thanks!
check this on your samsung is in developer options:
Uploading: bluetooth.jpg…]()
What should I check? You have not added a picture. I think it is missed.
If the connection is bad and I can not upload the photo, in Samsung go to settings> developer options> see BLE devices without name. you enable it because it tells you a message “low energy bluetooth devices that have no name will be displayed”
I think there is your problem. Tell us how to see …
I think the important thing here is to make sure that you’re getting all the data first before opening the list picker. Given how the code is structured, you’re likely not getting all of the possible devices (scanning takes time) but you immediately open the picker after the first device is found. My proposed solution just updates the text on the list picker button so you can see that it’s registering new devices, and then when you think it’s settled you click the picker to open it. Alternatively, use a list view and populate it directly in your UI rather than using the list picker (which launches another activity).
I have the exact same issue using a samsung galaxy s9 - I started doing multiple downloads of the app to my phone for testing (running perfectly for around 20 downloads and tests) and all off a sudden, the connection could not be made and nothing was showing in my list… I think it must be something to do with permissions on the actual phone, unless there is a block you can add in MIT to allow all connections on the device?
I have tried it! It seems the Samsung phone does not scans. It shows the text scanning as I have set the block in the app, but when I try it with the list viewer object, it does not shows a list as it should after a device is found!
The “bluetooth_List” is the List Viewer object and “…Button” are buttons. I have tried this here:
I have also set the button from my first app with the list picker object to visible all the time, that I should click to choose the device that was found, but no button is shown in the app! It is not visible on the Samsung phone! Do not know why Means that, I can not use a Bluetooth app on a Samsung phone?
If you could test a Bluetooth connection with list picker or list viewer or both on a newer Samsung phone, that would perhaps help a lot. Then we could take the same blocks to test it first and when it works I could try it to make them into my app. Perhaps we can find an error this way? I think the actual BLE blocks do not work with the Samsung phone!?
If you wouldn’t mind PMing us the project I can see if one of our team members can try it on their Samsung phone (my daily driver is an iPhone so I’m of limited help here).
I’m also curious if you’ve tried the App Inventor + IOT Basic Setup Guide and whether that shows any difference:
http://iot.appinventor.mit.edu/assets/tutorials/MIT_App_Inventor_Basic_Connection.pdf