App not responding

I have created a Bluetooth app but when I try to press button for receiving data from Arduino it says app is not responding can someone help me find out the problem.


You provide a screenshot of your block :smiling_face_with_three_hearts:


here it is

1 Like

I think you should first try to connect to your Arduino and then try to send and recieve data, Search this forum for examples.

1 Like

You mean I should observe on the serial monitor of Arduino IDE before using app?

  1. Which Android version are you testing on?
  2. Are you testing with Companion or with the APK?

I'm testing with APK on android version 13

No, I want to know whether your Arduino really connects, as you should be able to see in your label1. And obviously you did not look at examples made by others.
Most importantly, install the companion on your phone and test with that. It makes your testing soooo much easier.
Finally, upload your .ino

Then you must ask for permissions:


yea Arduino gets connected. Infact it gets data at first but after sometimes this happens

1 Like

ok thanks I'll let you know after using it

What I saw in your app that could cause stopping receiving things, is that you did not check whether there were in fact bytes to recieve by using the bytes availabletoreceive block, and the usual way to do this properly, is to have clock and on the Clock.Timer event check if something is there and only then try to read it.
Now, with your -1 value in the receiveText block, AppInventor will wait until there is something, until it receives a \n character (are you sending one, actually), and choke while it is waiting.

1 Like

First of all thanks for your guiding but I'm sorry to tell that I don't know how to use it. I am trying to design my app for the first time and have no idea of many things. I am trying to understand so guide me in more detail.
Thanks for your support

Have you read post #9 and tested BTclient_test2.aia?
If so, then show your new blocks.

I have checked it and I think I'm unable to explain what the actual problem is.
Issue is I have a project to have location, speed and distance covered by a vehicle on the mobile app using different buttons. When I implement it sometimes it gives 100% desired results like shows location and speed and distance and just after few tries it says app is not responding wait or close it.
Then I entered input from Arduino IDE and to my surprise I got results displayed in the app. I'm confused with the thing that what is the error and how should I set it.
I hope now you got what I'm trying to do and help me through it.
Once again thank you for your support its so nice of you.

Are you testing with Companion or the APK?
And show all relevant blocks.

Here is a simple BlueTooth text receiver sample, for single value per line:
initialize global message to

1 Like

I'm testing with APK and these are updated blocks

thank you I'll inform you after implementing it

I've to send the text from the app using buttons and then receive data how to implement clock timer for button kindly guide me