[free/os] Extension For Pairing Bluetooth Asynchronously Without Getting App Freez

When We Try To connect Bluetooth Device using Bluetooth Client . until getting successful connection app freezes. and We will be prompted wait and close by android. So i Make this extension from some combination of sources. and it worked for me. If any One need it you can test and use in your project.

This Extension is Very Simple to use


Simply Add Dragged BluetoothClient and address as shown

Remaining Work can be done With inbuilt BluetoothClient Component.

In this Way We have Solved App Frizzing Problem While Connecting Bluetooth.

Aix File to Download
com.ConnectBluetoothAsynchronously.aix (7.7 KB)

Source
BtAsynConnect.txt (3.2 KB)

6 Likes

Since your extension is free, could you share the code?

2 Likes

BtAsynConnect.txt (3.2 KB)

this is source

1 Like

Hello @Peter Does i make anything wrong ?

1 Like

No, absolutely not. I never had your "error message" while connecting to a Bluetooth device. You or others would have to answer this, but are there also drawbacks using an asynchronous method to connect to an bluetooth device?

At the moment I and others are testing an extension MicroBlocks Test/Demo App that makes it possible to connect to a microcontroller like micro:bit, calliope mini, ESP32, Raspberry Pi Pico W, etc etc that support BLE and is supported by MicroBlocks. That makes working with BLE very easy when working with microcontrollers.

I am just wondering if your code would be useful with this extension. That is why I was asking.

1 Like

From a long time i need this extension. because of app freezing problem . so i tried to develop this

i am tried to develop this as slimier like as

Stored Address in TinyDB and Make Bluetooth Device OFF
Check With Auto connect when screen Initialized...

for Ex disable HC05 of arduino uno and then test Auto connection its getting freezed for long time :cold_face: otherwise when HC05 is ON its connect in second :slightly_smiling_face:

Oh wait a minute. You are talking about Bluetooth and I am talking about BLE. See, it is still early here. :slightly_smiling_face:

image

1 Like

I know. I was talking about the BLE extension from App Inventor.

How can i search paired and unpaired list with bluetooth ? any extension and source?

Great Extension Keep the work up. :+1:

1 Like

Try the Classic Bluetooth extension

Taifun

Hello @Vishal_Nage1,

Thank you for this extension. I will give it a chance and try it out. Maybe it solves a big problem i sometimes have and was not aple to reproduce it see here

Sometimes the error shown in your picture occures and sometimes not. I thought it has something to update my apps very often in time of development. For that reason i clear the app cache very often but i am not sure if this is realy the cause.

Some questions: Should I use your disconnect method (async) or can i also use the method from bluetoothClient1 (standard)? What does your method isConnected does exactly do? I ask because the standard method does not do what I expected. I thought that i can check if the connection is available but that does not work. To check if the connection still is available I have to send every few seconds a haeardbeat information to arduino. If this does not work I get an error which I catch and change the connection status on the screen.

Now - thanks again for your service - I can try it with your extension :slight_smile:

Best regards

I am trying to make slimier thing like this.

please read the documentation and how to use it.

Note : I am beginner in extension development. in some Projects its Works For Me . and in some project it Does not Work. So i provided Source with it . if any one can update then they can update source and re-post in app inventor or this post.

this extension also solved my problem in some projects .
co.sgext_.asyncprocedure.aix (20.7 KB)

Use All Method From BluetoothClient1 For Remaining Purpose. Sync Extension Only Make Smooth Connection. Remaining thins need to do from BluetoothClient1.

1 Like

Thank you for your answer. This is the information i was looking for.

1 Like