Apps using Itoo and build after august 17 cause the app to crash

Hello Kumaraswamy,,

after the update of the AlarmManager my Main-App is now working too.

The compagnion isn't working also with apps without Itoo. I tried all suggestions given by MIT, no success????

As i don't now, if you save my Test-App before Taifon removed it (Sorry again to Taifun for this mistake), here is the new one without the AlarmManager-Extension.
I tested it on Android 9 and 14, again the Acceleration-Sensor didn't work in background, Pedometer is OK.

For your help in advance thank you and best regards.
SensorenTest_Accel_Steps.aia (93.3 KB)

Itoo cannot work in the companion app.


I looked at your project, I see that AccelerometerSensor1.AccelerationChanged --> changing which is right but then it calls Show_Accel which attempts to set label text.

This is not possible, you cannot change UI elements when your blocks are called from background. That's why it crashes.

Hi Marcel, I checked your project, you are doing almost everything right except the fact that procedures startBle and stopBle are missing an argument "x" which is meant for the message slot.

startBle() -> startBle(x)
stopBle() -> stopBle(x)

Since you are missing an argument signature, this Itoo fails to call your procedure.

Hi Kumaraswamy,

I added the argument to startBle and stopBle as shown

Doesnt make any difference. Both procedures are not called..

I see you are using the BLE extension. Do you have the latest version?

Hi Peter,
No Im not using the latest BLE extension because of this issue:
Create and send BLE advertisements

Im using the version provided by Ewpatton, which works.

However, the problem is not the BLE version Im using. The problem is that Itoo does not call the procedures startBle and stopBle which should start respectively stop BLE.

Hello,

thanks for your answer,

The problem with the compagnion is not that Itoo cannot work in this App, the problem is, that in Android 14, after the connection is made
image
, the mainscreen of the compagnion is frozen!
image
I tried Version 2.72 and Version 2.72u with Apps with and without Itoo. It works OK befor the last Update of Android 14.

What i also don't understand is, why the same routine with "set label text" in "STEPS" works an not in "ACCEL"?

Greetings

It is not Itoo's fault. All the procedures are called properly. I discovered this error message while I was debugging your program:

AEvent(ErrorOccurred=null) args [edu.mit.appinventor.ble.BluetoothLE@49fba75, StartAdvertising, 3300, Error 9121 in extension BluetoothLE: More than 31 bytes in advertising packet] listener = xyz.kumaraswamy.itoo.Itoo$1@4329dac

Hallo Marcel,

as you can see, i do not use the bluetooth extension, so why this error?

Greetings

Hi Kumaraswamy,

I dont think it has anything to do with BLE.

I stripped all BLE and all other non relevant stuff from my app. What is left is basically property and broadcast handling.

"startBle" and "stopBle" now only update the property "state". The "state" is updated on the screen when "Timer" fires (every second). However when pressing "Start Monitoring" or "Stop Monitoring" the screen is not updated..so "state" is not updated...so it looks like "startBle" and "stopBle" are not called. Could you please further investigate? Many thanks in advance!

PhneBuddyV2_0_noBle.aia (287.4 KB)

Your blocks do not really nake sense
If the app is running in the background, there is no user interface available to display anything
Also how exactly shout these procedures startBle or stopBle be called and by whom?

For a working ble example in the background see here.

Taifun

It is something to do with BLE. It errors out in background. Thus making the background operations problematic. Please refer the error I posted.

Edit: I need some time to investigate your new AIA.

Hi Taifun,
Let me explain.

The UI of the app enables the starting and stopping of BLE advertising running in the background using Itoo. The state "started" or "stopped" is displayed whenever the app is openened. So I will always know what the state is by opening the app. That makes sense doesnt it?

I carries a wearable device with me that just scan for the BLE advertisments. When found everything is ok! When not found, my phone is out of range and the wearable device gives an alarm. I use the rssi value to set the range/sensibility between my phone and wearable device.

This app worked without any problems up to 17th of August. Since that date new builds didnt work anymore. The problem was recognized and Kumaraswamy provided a new version of Itoo.

This new version introduced a new issue for me. As far I was able to do problem determination, it looks like the broadcast fucntionality doesnt work anymore. At least not for me using a Samsung A52 running Android 14.

In the PhneBuddyV2_0_noBle.aia posted above, I stripped all functionality except for the Itoo broadcast handling. Indeed the app doesnt tmake sense anymore, but I hope it would help you to find out what is going on.

Please give it a try and let me know the results!

Many thx in advance!

The broadcast functionality is working on Android 13. It seems to be an issue on Android 14. Im researching more.

Edit: I currently lack an Android 14 device. Im unable to test this :frowning:

Hi Kumaraswamy,
Let me know if I can be of any help. Collecting logs perhaps? I have ADB running and USB debugging enabled, but might need some guidance from you how to capture the right data.

What about providing a working example app as small as possible then?

Also

Taifun

Android 14 imposes restrictions on the feature that Itoo uses to exchange messages b/w processes. And there's some technical debt to the project, interfacing the service with the blocks makes it really messy.

Im not sure what to do... Thinking of spiting the message exchange system into a new component (a breaking change), while also allowing more flexibility...

Hello all, this update should resolve all the issues.

xyz.kumaraswamy.itoo.aix (81.4 KB)

Let me know how it works. Tested on Android 14.

Could you please also update this on the main topic also.