0

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.

Brent81
  • 1,152
  • 1
  • 13
  • 19
  • 1
    On ios you could use [Local notifications](http://stackoverflow.com/questions/13773123/how-can-i-schedule-local-notification-for-the-following-scenario) – David Karlsson Jun 17 '13 at 15:34

3 Answers3

1

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.

verybadalloc
  • 5,768
  • 2
  • 33
  • 49
1

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.

Community
  • 1
  • 1
SuperFrog
  • 7,631
  • 9
  • 51
  • 81
1

(Android solution)

You could use AlarmManager with setRepeating function to repeat this task

Check here

Hope it helps :)

zozelfelfo
  • 3,776
  • 2
  • 21
  • 35