Brent81
Brent81

Reputation: 1172

is there a way to let an background app display something when other app is running?

for example, if i'm playing a game, a trigger will display an alert after a certain time to warn me not playing too much time and should have a rest. Both android and iphone solution is welcome.

Upvotes: 0

Views: 103

Answers (3)

SuperFrog
SuperFrog

Reputation: 7674

Think about it as on an Alarm Clock, which can interrupt your current App, something which is off-course possible.

Regarding Android you might want to read about AlarmManager

As for iPhone you might want to take a look in this Stackoverflow question discussing local notifications.

Upvotes: 1

zozelfelfo
zozelfelfo

Reputation: 3776

(Android solution)

You could use AlarmManager with setRepeating function to repeat this task

Check here

Hope it helps :)

Upvotes: 1

verybadalloc
verybadalloc

Reputation: 5806

On Android, using the following permission,

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

you can draw views on top of any other application. For example, this is the permission used by the Facebook Home app to draw its chat heads.

Also, this is a system permission, so it does come at a cost.

Upvotes: 1

Related Questions