Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AlarmManager effect on battery for an Alarm clock app

Tags:

java

android

I want to built a alarm clock app for android
I'm using an AlarmManager that starts a service every 1 seconds to check system time.
now I have 3 question:

1- Is there an other way to check system time every 1 second? and what is the best way for this work?

2-what is this my way on battery charge? is it cause to reduce battery charge very faster?

3- what mechanism use the android alarm app for checking time?

please help me to built this app

thanks

like image 814
Sadegh Avatar asked Apr 21 '14 20:04

Sadegh


1 Answers

Why don't you just use the AlarmManager functionality supplied by the OS, and not try and invent this yourself. Basically this allows you to make a call to a service at a predetermined time (probably ultimately what you want to do).

What you suggest would be very problematic for battery, and doesn't sound like a good approach.

like image 150
Booger Avatar answered Oct 15 '22 14:10

Booger