Available blutooth devices not showing

I created an app which is used to connect to bluetooth module hc-05 but my app didn't even showing available blutooth devices. With the same code that previously executed i created a new one but after installing the code was not showing bluetooth devices.

This user just posted what worked for him for adding permissions to BlueTooth.

Could you try it and tell us if it worked for you?

Hello Dhanush

Welcome to the grey hair club :grin:

In your code
Replace this:

With this:

Or This:

In your code, I can't see devices being scanned for? It is best to give the scan a bit of time to complete, so put the Block in a Clock Timer. Same for Connect.

Set the Clock Timer intervals in the Blocks where you can tweak them easily while running your App on your Device (phone) via the Companion.

Make sure your phone and the device you wish to connect to have Bluetooth switched on. Your phone may need to have Location switched on too, depending on Android version. It's a Google Android security measure, I just switch it on regardless of which Android version I'm using.


Thanks but it's not working. Is mit app inventor facing any issues.

My guess is, you did not follow the advice from @ABG and without asking for necessary permission it will not work...


Expanded boiler plate:

(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:

These blocks can be dragged into your Blocks Editor to request permission(s) for Bluetooth non-BLE scanning and connecting. All three parts are needed.

You also will need to pull in TinyDB into your project.

When Permission Granted (@Patryk)

Thanks to @Anke for the original code.
My changes include

  • use of the Screen1 permission blocks to avoid the possibility of a typo
  • using a TinyDB tag particular to BT permissions and only for BT permissions.

(Thanks to @Patryk_F for correction to grant order)
Special note for Xiaomi devices:

Thank you very much fellow. Now it's working.

Which road did you take?

  • the easy road
  • the hard road

the easy one buddy

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

Possible typo in API level procedure call

This answer seems to have a typo in the API level procedure.

It will return an API level of 3 for Android 11 instead of 30 as shown in the list:


Might save a bit of head-scratching for someone.