My app works buth crashes after a while


My app works fine buth it crashes is there a way to solve this?

Can you tell us more about what is happening in the app when it crashes? There is a lot going on in your blocks and depending on what's happening in the app it will help narrow down the search space.

Maybe your images are to big and you get memory problems that causes the crash. Can you tell how big they are in pixelsize?

I am connecting to the Hc-05 bluethooth module and im picking a language then it sends what I say when I press a speak button. It also says if its connected or not. it freezes after a few times of using it, when i send 2 words it freezes after that. Buth when I restart the app and reconnect the bluethoot module it works fine again buth again after a few words it crashes.

Already thanks for all the help its appriciated

the picture of the project is 250pxl x 400pxl I could remove the picture if its a problem.

You mean the icon of the app? That should be square. And all other images in your app. What size are those.

Your problem may be in the handling of the Bluetooth, but exactly those blocks are invisible. Search the help to find how to upload blocks, or attachan .aia

here is the aia file.
thanks for youre effort
Gip.aia (292.5 KB)

I forget to upload a picture of the front here it is


The picture at the bottom is 250pxl * 360pxl, and the bluethooth picture is 100pxl * 360 pxl.
thanks for the help.

In your aia the bottom picture is 972 x 729 pixels in size. You mean you set the image component to 250 x 360 pixels?

true, I changed the horizontal allignment.
Do I need to change the picture as well?

It might not be the problem. What phone are you using to test? Are you testing on the companion or as an apk?

In the BTAfterPicing you set the elements of the list again. It would be better to set a status message in some label.
Does your BT device ever send something back? In that case you should receive it, otherwise your app will indeed stop functioning after a while, because the buffers fill up.
If not, it would be nice to send something back, to make sure all is ok.
Do you have a .ino file for our BT device? Or some API description?
It could help finding out what is wrong.

Then, Peters question could be an indication: Note : it has been reported, that this method does not work on Android 8.x devices (the supported languages query)

Huawei mate 10 lite

What version of Android does it have?
And what is your reply to the question about the communication with the BT device? What is it?

@Ghica
It does not send something back, the arduino only receives data.
The android version is android 10.
Do you also need the ino file?

Thanks for the active thinking it really puts a smile on my face.

Dank je Kas, ik houd van smileys!

An .ino file would be good. There must be some reason why your app stops working after a while!

here is the a picture of the.ino file I couldnt upload it.



3th

thanks for the assistance.

Hi Kas,
You could have pasted the text instead of a picture, that would have been easier to read.
I see some potential problems:
You do some print() and println(). These are certainly return messages that could clog the buffers.
So make some blocks in App Inventor to read the return messages. Look here for a hint on how to do that:

Also, you are sending the messages every 10 milliseconds. That is way to often!
You should find a reasonable value, 1000 or 500 should be fine.
Just some things to try.