[PAID] ⏰ Alarm Manager Extension with Notification or Autostart

i had a few questions regarding this extension.

  1. is the "open above lockscreen feature" limited only to alarms(can only be triggered by alarms), or can that be triggered by a stimulant, say when bytes/strings are received by a BLE module?
  2. i believe that feature also brings the app to the foreground if im not wrong?

Currently only the alarmmanager extension and the sms receiver extension are able to do this

Currently not
EDIT: the use of this feature also is restricted by Google... for details see here Behavior changes: Apps targeting Android 14 or higher  |  Android Developers

Yes exactly

Taifun

thats not going to be a problem as im not going to release the product to the public anyway:3



im trying to trigger an alarm using itoo and ble and it works, but not in a way i expect it to work. instead of anything appearing on the lockscreen, i get only a notification with the title and text. i created another screen for lockscreen but it doesnt appear. i tried to follow the lockscreen app as much as i could, and the lockscreen app works perfectly fine, but this doesnt. i dont understand where the issue is. (even if the alarm activates because of ble received, the alarm still should perform as expected right?) all permissions required have been enabled as well.
is it because itoo is interfering with the app with the createprocess block?
ALSO: in recent xiaomi mobile phones, theres an additional show in lockscreen option that needs to be enabled by opening app settings. (advice)

UPDATE: you need to have the screen name of the lockscreen as "LockScreen" case sensitive if you want the lockscreen to appear.

Exactly! You got it. Congratulations !
Taifun

image
this query is with reference to the last line of the image, "in case...asap"

  1. if i put the instant to call clock1.now, will the alarm activate just after the button is pressed?
    if yes, then it doesnt work somehow for me{i created an apk of the lockscreen example file, and tweaked only that function a bit},
    and if no, then how does it work, and what does that sentence entail?
  2. if i want to trigger an alarm as soon as the button is pressed{button.click or idk}, how do i do so?

No

For short time intervalls (below 15 minutes) my suggestion is to use itoo together with a clock and the melon notification extension

If you use the alarmmanager it will take some seconds until the alarm activates

As a test try 1 minute, see aldo the example projects..

Taifun

Yes I could do it, but then I lose the functionality of the screen that appears above the lockscreen.

I see, but why? Is it the limitation of the extension?

Ok, I see

It is the underlying alarmmanager API

To solve the issue I think I could add some logic to not use the alarmmanager api in this case and trigger the alarm directly... I will do some experiments when I find some time...

Taifun

1 Like

that would help me greatly really.

please do
thank you
yns

I was thinking about it again... In your latest screenshot you click the Start button and your idea is to set an immediate alarm to open the app above the lockscreen... this does not make much sense like this, because your app already is running, isn't it?

Please describe your use case more in detail... are you trying to open the app above the lockscreen from the background using itoo together with the alarmmanager extension?

Taifun

well i mean- you are not wrong, but i was testing the extensions capability to create an alarm and activate it in an exact instant by a stimulus, be it anything at all and i needed the LockScreen screen to appear.

almost precisely. figured me out lol and well I have achieved the said above process, but the extensions takes much time in creating and activating the alarm(almost 10 s, when i create the alarm with the screenshots block and put this in the instant section {even though the seconds added is 5} when i want it to be in an instant)


it would be great if you could help. :]
yns

I now added a new method StartNow which immediately triggers an alarm without using the alarmmanager API...

Depending on the start mode you can display a notification or open the app above the lockscreen

I will send you version 12 and a test project as PM so you can test it... after successful tests I will publish the new version.

Taifun

2 Likes

hi @Taifun i want to run some function while alarm start such as store value to tiny db before opening the app, is that possible with this extension?

Yes, just use the OnReceive event handler for that

For details please see chapter itoo integration in the documentation at App Inventor Extensions: Alarm Manager | Pura Vida Apps

Please try something yourself and if you got stuck, post a screenshot of your relevant blocks

Taifun

I paid for the recommended App Inventor Extensions: Alarm Manager | Pura Vida Apps, but I did not receive any response, examples, or extensions by email.

Thank you for your message. You received an email with a link to the download folder, which gives you access to the following files

  • TaifunAlarmManager.aix:Use the full version of the extension if you need to open the app above the lockscreen
  • TaifunAlarmManagerKODULAR.aix:Use the Kodular version of the extension if you are developing in Kodular and need to open the app above the lockscreen
  • TaifunAlarmManagerLITE.aix: Use the lite version if you do NOT need to open the app above the lockscreen
  • simple.aia: example project as simple as possible to show a notification at alarm time
  • alarmmanager.aia: example project to show the main features of the extension in startMode OnlyNotification
  • lockscreen.aia: example project to open the app above the lockscreen
  • itooNow.aia: example project to show how to use the StartNow method to open the app above the lockscreen from background processing

I will send you again the link in a PM - private message. For further questions concerning accessing the extension please contact me by PM. Thank you.

Taifun

Hi, I was planning to use your extension and onReceive. I have to say that the notifications keep working repeatedly. That’s why I added a command in the onReceive procedure to connect via MQTT to the broker, and then I activate a timer which, after 45 seconds, reads the topic from the broker and disconnects.

I found out that the condition checking whether the MQTT client is connected doesn’t work. It seems to me that usrPahoMqttClient and timers don’t work inside onReceive. Do they need to be activated somehow?

Normally, in itoo it worked for me for at least 6 hours. When it didn’t work, I tried to activate itoo in the background if Android killed it. That also didn’t work out.

What am I doing wrong? Thank you very much for your help.


The alarmmanager uses the itooX framework, so all rules relevant for itoo are also relevant for the background processing of the alarmmanager. So the answer is yes, do it the same as you would use itoo

This should return false even if you started the connection in the foreground, i.e. do not mix foreground and background processing, i.e. start your connection in the background in the OnReceive event handler

To send a notification you could also use the StartNow method from the alarmmanager extension

Also for debugging use the Notifier.LogInfo method and use Logcat to check the log

Taifun

Is rhere an event available, which gets triggered if the connection was successful?

I currently do not have a link to the documentation of the mqtt extension...
You might want to register that event for itoo ... same for other relevant mqtt events...

What I forgot to ask earlier, I'm assuming, you added also the itoo extension? Without that extension obviously background processing is not possible

Taifun

How to create dynamic alarms using the alarmmanager extension

Example 1: display a random message at alarm time

start a repeating alarm and at alarm time in the OnReceive event handler pick a random text and display the notification using the StartNow method


dynamic1a

Example 2: display the current weekday at alarm time

start a repeating alarm and at alarm time in the OnReceive event handler get the current weekday and display the notification using the StartNow method


Taifun

2 Likes