Hi, The service component of my application needs to do certain tasks at some scheduled time in future. The task list itself is populated by an activity (of the same application) along with the exact date & time the task should be carried out. When there are no tasks, service can stop running. Even when there are tasks, service doesn't have to run until the scheduled time of the 1st task in the (sorted) task list. Once the 1st task is taken care of, it doesn't have to run until next task's time has come. I was wondering if android has UNIX crond style process that can I make use of (programatically).
Also, when new task is added or existing one is deleted, the activity needs to notify the service. I looked at AIDL but it seems to be more for communication across processes. If the service and activity are in the same process, isn't there an easier way to wakeup/notify the service that tasklist has changed ? Thanks, Sarath On Mon, Dec 29, 2008 at 4:32 PM, Mark Murphy <mmur...@commonsware.com> wrote: > > Sarath Kamisetty wrote: >> My application has two halves - one that interacts with the user and >> gathers some data and stores it, the other half of it is like service >> that constantly monitors and processes this data and carries out the >> user specified actions in the background. How do I develop this ? >> >> One approach is to split the app. into two independent parts - an >> activity and a service. Activity (with textboxes and buttons etc.) >> takes user input and stores the data in sql database. However, it is >> not clear to me if the service portion of the application can access >> it. Is that possible ? > > If "it" is the SQLite database, then all components in a single > application can access the database. Here, "components" refer to > activities, services, content providers, and intent filters. > >> In this approach, the activity and service will >> be completely independent and the activity has to notify the service >> (somehow ?) whenever user inputs new data so that the service can >> reprioritize its task list. > > Use AIDL, static data members, or the like to communicate from the > activity to the service. > >> In >> this approach my app should be running in the background as soon as >> phone is booted up. > > Everybody thinks that. Then people wonder why their phones are so slow. :-( > > I really encourage you to think through whether your application > absolutely positively must run automatically without user intervention > when the phone starts up. > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com > > Android Training on the Ranch! -- Mar 16-20, 2009 > http://www.bignerdranch.com/schedule.shtml > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---