Taifun
Thank you , here is the blocks let the foreground work and listening the childtag's update from firebase
Taifun
Thank you , here is the blocks let the foreground work and listening the childtag's update from firebase
Try to put these blocks
into your main procedure show_notice and create an event handler for Firebase_Realtime_DB1_ChildChanged
Taifun
You forgot to start the clock for background processing
Btw. What is the purpose of your background processing if the only thing you are doing is updating the user interface? Which means, only if your app is in the foreground something is happening (after you fixed the bug)
Taifun
...wait how does one do that? i thought clock1.timerenabled in the listpicker was the way to start the clock for bg processing. i didnt know there was a different way of starting the clock.
ah these set of blocks essentially are highlighted part of the bigger issue im facing with another app. im just using the ui components for now to check for bugs.
it works as it should without itoo this way
Start the clock in your main procedure orionpax
For debugging let me recommend logcat
Taifun
yes i did that, and now i have realised that itoo can NOT perform "call BluetoothLE1.Disconnect." somehow thats in the timer procedure.
i tried to create a loop where the timer disconnects the device but then it doesnt disconnect at all, thereby causing more issues in the latter parts of the blocks.
update: i think the issue is im connecting the device on foreground and then using the disconnect in the background.
probably would need another small clock that runs in foreground itself that disconnects the device and starts the process i believe.
Do the Connect also in main procedure orionpax
Yes
Taifun
yes, i did that and connected the device in bg using itoo and ran the connected and byte received command and everything works as it should.
just a problem tho, i dont understand what this error means. it comes up when the the device is connected using connectwithmatchingname block in bg
Sure but even so, shouldn't reconnecting it again after getting the name, by running the timer procedure in the bg do the same?
I'll try what instruction you gave me with image for now.
You will have it running twice in this case
You do not want this
Taifun
I have problem with the code. The code is function but unstable and I dont know, where is problem. Please help
That's a wild guess and I do not think so
You can easily create a test project and add some debug statements to proof, that this is not the case
Can you elaborate? Probably your background process sometimes does not continue after waiting 30min ot 1 hour and the Android operating system is terminating your process?
If you want do do something regularly after a given time (in your case after 30min/1h) usually you use the alarmmanager functionality. My alarmmanager extension is able to do some processing after a given time in the background App Inventor Extensions: Alarm Manager | Pura Vida Apps
Taifun
Thanks, You mean than your extesion will be used in Itoo?
No, it's the other way around, my extension will use itoo functionality, Itoo X Framework: Virtual App Inventor environment for Background execution - #2 by Kumaraswamy
Taifun
when i do this, nothing happens, the device does not get connected because im guessing itoo processes cant read the listview1.selectionindex and act upon it. i also added a evaluate but no result of listview1 but still nothing happens.
No? Why not? Don't you think it would probably be a good idea to share your updated blocks?
Taifun
I did a search for you in the itoo thread and found the following BLE example for you
And another example
Don't hesitate to search yourself, too...
Taifun
yeah sorry i was about to, so
well as the listview contains both- the address and the name, i cannot use connectmatchingname or the connectwithaddress block, i would probably need to create a way to save both to utilise them into the itoo procedure blocks.
also, when i directly hardcode it to my devices name using connectmatchingname, this still pops up
the one below this one is completely hardcoded and what i wanna do is use the listview for connecting the device.
UPDATE:
for this, i got the address from the listview and saved it using storeproperty block