connectivity-samples
connectivity-samples copied to clipboard
My samsung S10 can't find devices
Hi, this topic is new for me and I have some doubts.
Please help me!!!
I download the project and I run BluetoothLeGatt in a Samsung S10+, but when the scan finish, it doesnt find devices. I have turn on the Bluetooth and I have some devices with Bluetooth on. I need to configure something?
Thank you very much!!!.
I want to know how can I use it, because I need to do a little program whose listen by Bluetooth Low Energy other devices and just take the information.
I find the solution with this.
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
This example get information for the other devices?
Yes, it works on the Samsung Galaxy A51 (after granting it location permission in the settings).
It also works with
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
After adnroid6.0, you must add in AndroidManifest.xml like this:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
and still you have to add in whatever activity you want to use the permission like this
if (ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1);
}
After adnroid6.0, you must add in AndroidManifest.xml like this:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
and still you have to add in whatever activity you want to use the permission like this
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1); }
this code should place in "DeviceScanActivity.class" of ,then app can worked. public void onCreate(Bundle savedInstanceState) { if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1); } ....... ....... ...... }
I have all the permissions set but still: No BLE devices found.
Can you check on the Logcat whether any error is shown? Or better post your complete Logcat for the scan process.