Since the app has to be open (active) at the time of clocking in and clocking out (taking timestamps), I don't see any problems implementing such apps with AI2 (or Kodular, Niotron, ...).
Try this simple app (initially just for one day and one break / pause):
Thanks again for the answer, it helped. But I've now switched to Kodular because I found it easier. There is an item called ListView Image and Text. A new item is created with every click on the stamp button, which also works perfectly. The problem is, every time the screen is restarted, the list view is emptied because it is not saved. I've searched the internet but haven't found anything on how to save a ListView. Can you please help again ? Thank you and have a nice day.
There is good reason, 1 - we then know which distribution you are using, 2. AI2 and Kodular are different in many ways, what works on one does not necessarily work on the other. This is why it is best to ask on the correct community.
The Android Developer link pretty much describes the distinction between onPause and onStop.
Essentially onPause is not killable by the OS, but onStop is.
So do anything important in onPause, as onStop may not fully execute....
I had tested it extensively on dozens of devices at the time, and as I already pointed out, after on Pause (at least on non-tablets) onStop is always executed. As you can see in my tests, I was able to store something with onPause as well as with onStop. However, it may be that this behaves differently on tablets (as Evan Patton said; I haven't tested it).
No, I did not test it myself, but I do believe what I read on the Android Developer page (which is linked to right at the top of your extension description)
I'm NOT saying onStop never happens straight after onPause, but the docs say it is possible that onStop may not reach the end of execution.
The OS may destroy the app before it concludes - this may not always be the case, and hence why it appears to be OK to use onStop.
BUT as they do document it, I'd consider that it is risky to reliably use onStop for important things like saving configs, but onPause will not get aborted by the OS so that's where it should take place.
A distinct but important difference I'd say
But what I will add is your extension has proven invaluable to solve a problem I had with the Paho MQTT client extension entering a world of networking hurt when the phone shut shop.
All was good when open and running, but once the app was put to sleep it would then have problems once awakened.
So now I force the connection closed in onPause, then reopen in onResume - far more stable.
So thank you very much for providing this extension.