I would like to provide an app for people with illness who suddenly fall asleep when the app is running and the user falls asleep app makes a noise

I want to make an application for people with sickness who suddenly fall asleep when the application is running and the user falls asleep the phone rings and vibrates until the user wakes up because of this noise.
Is it possible to do this through the touch sensor, for example, if you do not touch the screen for 5 minutes, the alarm will work, and if the screen has been touching for 4 consecutive minutes (the user falls asleep and forgets his finger on the screen) the alarm works
Is it possible to do this please help me and thank you.

I have a relative who suffers from this disease and I want to help him

As you described in your topic, I think touch sensor should always be active whenever a user is using their smartphone… This seems like a complicated thing.

Probably We can use Background tasks extension and touch sensor to do this.

I believe the medical term for this to be narcolepsy

If you are happy for the app to be in the foreground / always on, then a large button (perhaps screen sized), and a clock timer should be all you need to make a demo version.

You could put the code in the button.touchup event so it will respond when the finger leaves the screen.

1 Like

I didn’t understand how I could do that

Set button to fit screen and use when button touch up block play sound

I would prefer an affirmative touch (button click). User could fall asleep with finger on button…

@TimAi2 @dora_paz @Peter @AJOY_DAS
There is no need to have the touch sensor out of the app because I will add the basic apps for me to my sick relative in this app(YouTube, web view…)

How can I do that, can you please explain to me more?

How can I do that, can you please explain to me more?

Another way would be to just use a (choose) notifier run by a timer, which would not get in the way of doing other things (youtube/webview) in the app.

Not a good method, you can’t act to remove dialog.

Can you give me an effective method

what about first doing some tutorials to find out, how Kodular is working?

A very good way to learn App Inventor or Kodular is to read the free Inventor’s Manual here in the AI2 free online eBook App Inventor 2 Book: Create Your Own Android Apps … the links are at the bottom of the Web page. The book ‘teaches’ users how to program with AI2 blocks.
There is a free programming course here Course In A Box and the aia files for the projects in the book are here: App Inventor 2 Book: Create Your Own Android Apps
How to do a lot of basic things with App Inventor are described here: How do you...? .

Also do the tutorials Tutorials for MIT App Inventor to learn the basics of App Inventor, then try something and follow the Top 5 Tips: How to learn App Inventor

and concerning your app idea…
will it be ok for the user to only be able to use your app? if yes, you can follow @TimAi2’s advice

but you said

which means, the user still likes to use other apps on the device?
in this case this app idea will be a challenge…


1 Like

I recommend using a background tasks extension in which you can use a timer from the last time you touch the button within the app. well be 5 minutes for example. and that if more than that time elapses an alarm is activated. all of that running in the background. But you would have to enter the app to be able to stop the alarm of course.

As someone who can’t wake up even with the noise the alarm makes at its maximum volume which is the case with some people, i don’t think this will be helpful for me :joy: