What do you want to do after the Web Request? Play a sound and show a notification? Then you have to register event for Web1.GotText with 4 parameters.
Create a procedure called Web1.GotText with 4 parameters that of the event.
In fact, I performed the same procedure that you mention but it still does not work, my intention is to activate a sound when executing the web component when I get a response, but it does not work.
I had the same problem, the original file is actually a high quality picture, but it looks likes MIT servers fiddle somehow with the uploaded images and blurs them to reduce their quality (maybe for compression purpose).
My app produces a notification message (by Melon Notification extension) every 5 seconds.
I would need to prevent the notifications from continuously waking up the screen of my phone when the device is in sleep mode.
I tried to set such behaviour in Android settings:
Settings > Apps > Special app access > Turn screen on
Unfortunately, I can't find my app here listed, and that seems a well-known Android inconvenience.
I wonder if it is possible to exploit ActivityStarter component to programmatically open Turn screen on settings for my app, in the same way I already do for external storage all files access permission:
It looks like an extension to detect if the device is in idle/sleep mode does exist:
This extension is supposed to identify also if the device screen is off, so I tried to use it in my app, in order to disable the post of a new notification if my phone is in sleep mode.
Unfortunately, the things do not work fully as expected: if my phone is locked with screen off, it's alright (the notification does not trigger and the screen remains off, that is what I want), but if it is locked and the screen is active, the notification does not refresh. It looks like the lock active + screen on status is detected again as idle/sleep mode...
I would appreciate Anke's opinion also, that has built the extension.
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.
To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.
The background service implemented in the app keeps reading a file every 5 seconds and posts a notification displaying the seconds of current time from system clock.
Here below a videoclip of the app running on my phone (Android 14):
As you can see, with the device locked and screen active, the notification does not refresh as expected.
Here below AIX file project:
It looks like the extension by @Anke always returns true false... to confirm this, you could add a debug statement and log that information to be able to read it using logcat...
The notifier offers method LogInfo for that
LogInfo(message)
Writes an information message to the Android log.
Just do a LogInfo IdleMode.IsScreenOff to confirm this
I don't agree @Anke extension return always false. If that were the case, in my app the notification would always trigger. On the other hand, actually, conditions exist where it does not (when the device is locked with screen off), and logcat file I am going to post confirms this as well.
I don't fully get the point of your request, anyway I did as you asked for. I arranged the relevant blocks in this way (I hope this is what you intended):
well, that's great.. this seems to be a misunderstanding from my side then...
Yes, you can do it like this and we also can see some debug statements in logcat
03-08 18:23:54.231 13661 13661 I Notifier: DEBUG: The screen is now ON.
03-08 18:23:59.262 13661 13661 I Notifier: DEBUG: The screen is now ON.
03-08 18:24:04.280 13661 13661 I Notifier: DEBUG: The screen is now ON. 03-08 18:24:12.551 18275 2501 I NearbySharing: Screen is locked
03-08 18:24:14.305 13661 13661 I Notifier: DEBUG: The screen is now OFF.
03-08 18:24:19.323 13661 13661 I Notifier: DEBUG: The screen is now OFF.
03-08 18:24:24.343 13661 13661 I Notifier: DEBUG: The screen is now OFF.
03-08 18:24:29.362 13661 13661 I Notifier: DEBUG: The screen is now OFF.
03-08 18:24:34.384 13661 13661 I Notifier: DEBUG: The screen is now OFF.
03-08 18:24:39.402 13661 13661 I Notifier: DEBUG: The screen is now OFF.
03-08 18:24:44.409 13661 13661 I Notifier: DEBUG: The screen is now OFF. 03-08 18:24:45.797 18275 25165 I NearbySharing: Screen is unlocked
03-08 18:24:49.449 13661 13661 I Notifier: DEBUG: The screen is now ON.
???
as far as I can see, everything looks fine, because there also is another processs (NearbySharing) which checks, if the screen is locked/unlocked and this corresponds with your debug statements
It looks like I can't explain clearly which is the problem and there is something that dodges my understanding. My bad.
The log file I posted should be examined in relation to the videoclip of my app running. In the log file, when the device is locked and the screen is marked as off in the log, this can actually correspond to two status that can't be told apart: when the screen is on and when the screen is off. Here is my problem.
We have therefore these 3 conditions:
Device unlocked --> IdleMode.IsScreenOff = False ---> The notification triggers: OK, as expected
Device locked, screen OFF --> IdleMode.IsScreenOff = True ---> The notification doesn't trigger: OK, as expected
Device locked, screen ON --> IdleMode.IsScreenOff = True (but should be False!) ---> The notification doesn't trigger: Wrong behaviour
If the device is locked, but the screen is on, I want the notification triggers, but this does not occur because Anke's extension detects the case "Device locked, screen ON" as IdleMode.IsScreenOff = True.
To show the problem, I modified the debug version of my app by changing the log messages text and by adding a button Log Debug within the notification message itself and I pressed it to record a log message just only when the device is locked with screen active:
This is the corresponding logcat (on each line, I reported the actual status of the device):
03-08 21:32:46.593 30319 30319 I Notifier: DEBUG: IdleMode.IsScreenOff = FALSE ---> Device unlocked
03-08 21:32:51.631 30319 30319 I Notifier: DEBUG: IdleMode.IsScreenOff = FALSE ---> Device unlocked
03-08 21:32:56.649 30319 30319 I Notifier: DEBUG: IdleMode.IsScreenOff = FALSE ---> Device unlocked
03-08 21:32:59.296 18275 2501 I NearbySharing: Screen is locked
03-08 21:33:01.658 30319 30319 I Notifier: DEBUG: IdleMode.IsScreenOff = TRUE ---> Device locked, screen off
03-08 21:33:06.671 30319 30319 I Notifier: DEBUG: IdleMode.IsScreenOff = TRUE ---> Device locked, screen off 03-08 21:33:11.691 30319 30319 I Notifier: DEBUG: IdleMode.IsScreenOff = TRUE ---> Device locked, screen on 03-08 21:33:14.314 31115 31115 I Notifier: DEBUG: Device now LOCKED with screen ON. ---> Here I pressed the button Log Debug in the notification... 03-08 21:33:16.705 30319 30319 I Notifier: DEBUG: IdleMode.IsScreenOff = TRUE ---> Device locked, screen on
03-08 21:33:18.900 18275 30940 I NearbySharing: Screen is unlocked
03-08 21:33:21.745 30319 30319 I Notifier: DEBUG: IdleMode.IsScreenOff = FALSE ---> Device unlocked
03-08 21:33:26.766 30319 30319 I Notifier: DEBUG: IdleMode.IsScreenOff = FALSE ---> Device unlocked
03-08 21:33:28.704 31115 31115 I Notifier: DEBUG: IdleMode.IsScreenOff = FALSE ---> Device unlocked
At this point, I wonder about Anke's extension purpose: does it detect if the screen is on/off, or does it detect if the device is locked/unlocked?
I believe what I really need is something to just detect is the screen is on or off...
Thanks again and I apologize for my miscommunication.
I feel like I am a step away from solving such issue and get my app finally working, but the things are getting more and more complicated...
Do you deem feasible to somehow exploit ActivityStarter component to do that?
By the way, just right now I was unsuccessfully trying something like that (I get permission denied and the activity is not found):