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 -~----------~----~----~----~------~----~------~--~---