Help Needed with Bluetooth Server/Client Setup on Android 12 and 13

Help Needed with Bluetooth Server/Client Setup on Android 12 and 13

Hi everyone,

I'm facing some issues with my Bluetooth Server/Client setup using MIT App Inventor. I have tried everything I could think of and read through numerous posts, but I'm still stuck. Here are the details:

Devices:

  • Android 12 phone (Bluetooth Server)
  • Android 13 tablet (Bluetooth Client)

Problems:

  1. On the Android 12 phone (Server):

    • I get Error 908: The permission BLUETOOTH_CONNECT has been denied. Please enable it in the Settings app.
    • Even after enabling the permission in the settings, I still get the error or sometimes a runtime error.
    • Screenshot:
  2. On the Android 13 tablet (Client):

    • I get Error 515: Not connected to a Bluetooth device.
    • The List Picker intended to show available devices shows nothing.

I've gone through the following posts but still couldn't resolve the issue:

And many more could not list them here, I was only allowed to Links.
I have also tried incorporating extensions without success.

Any help or suggestions would be greatly appreciated. Maybe I'm overlooking something simple?

Thank you!

My Aia Files
Robotic_updated.aia (19.6 KB)
Remote_updated.aia (4.4 KB)

This from Robotic_Timer can't be right:

You have lots of empty sockets in the client:

Empty sockets are always a problem.

Time to look for a good client/server sample.

How about

?

1 Like

Also it looks like you forgot to ask for permission
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:

See Bluetooth liste of devices deosn't work anymore - #7 by Anke
Special note for Xiaomi devices:
I have an error with bluetooth on android 12, Xiaomi Poco X3 NFC - #20 by Patryk_F

1 Like

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