Reputation: 1172
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
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
Reputation: 3776
(Android solution)
You could use AlarmManager with setRepeating function to repeat this task
Check here
Hope it helps :)
Upvotes: 1
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