Should I use AlarmManager or ScheduledExecutorService? (pros/cons?)

by ccylan » Wed, 25 Jun 2008 03:58:23 GMT


Sponsored Links
 Hello Everyone,

Here is my dilemma.  I have several different timed operations that I
need to run on a daily basis, but at different times.  Currently I am
using ScheduledExecutorService, however having dabbled with
AlarmManager and its setRepeating function, I'm wondering if I should
use that instead?  What are the pros and cons of using either of these
classes?

Cheers,
Charles
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Android - minimal UI, services or broadcast recievers?

I have an application that will have no User Interface (not exactly
none altogether but VERY minimal).

I want it to scan for Wifi access points at regular intervals, check
the connected state of Wifi and check the connected level of the
currently connected access point.

It also listens for the OUT_GOING_CALL broadcast and traps the call if
connected to wifi and then pops up a dialog that tells the user the
call has been blocked and offers the user cheaper options than Gsm if
there are any.

I currently use the Broadcasts to get the Scan Results and to get
changes in the connected Level of the wifi connection also.

However I had thought that moving these to a service of my own would
be a good idea, however would I be better leaving them as Broadcast
Recievers in Non Activtiy and Non Service classes and just make the
main Engine of the application a service that turns on and off these
broadcasts from there Classes (Objects) ?

So I was wondering would having several services, one that does the
wifi stuff, one that does the call monitoring, and one that drives the
whole thing?

Or would I be better off using BroadcastRecievers to listen out for
changes instead and implement a timertask to scan for access points
and only have one service being the engine that drives it all?

-- 

2. The concurrency control of ContentProvider whose android:multiprocess is set true

>     Does this mean that multiple instances of the same ContentProvider

SQLite has built-in multi-process concurrency control -- it's part of the
product.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html


-- 

3. The concurrency control of ContentProvider whose android:multiprocess is set true

4. Buat gan Prayudi

5. info about CTS

6. Displaying Virtual Keyboard without expanding EditText

7. How can i use DragLayer.java to drag and drop my own ListView items