running appl in background

by jj » Thu, 09 Apr 2009 15:29:09 GMT


Sponsored Links
 Hello folk
     I want to run application in background. When user close the
foreground screen, application should be running in background. so in
foreground there is no screen of this appl, while user can launch
other appl also.
     To achieve this with the "service component", is it necessary to
create separate process to run this service component or the main appl
process is enough to run service component in background.
        While closing the foreground screen of main appl the process
of this appl is also killed? Or is it remain there to run background
service.

I want suggestion for this issue, Or any other way to attain the goal.

Thank you
--~--~---------~--~----~------------~-------~--~----~



running appl in background

by Dianne Hackborn » Thu, 09 Apr 2009 16:26:22 GMT


 Please read the documentation on Service, the overview documentation on
applications (which has a section on process lifecycles/management), and
there are a number of examples in ApiDemos of creating services that run
after an activity finishes.






-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


running appl in background

by jj » Mon, 13 Apr 2009 17:35:40 GMT


 If service is running in background in another process,
independent of foreground activity process. As per my study I got the
two  ways to know with background process update,
   1. using IPC(AIDL) bindService()
   2.broadcasting intent from service whenever we want update for
particular function.

     But as far as first option is concerned the foreground activity
should be there running.
My background process should run even though the fore ground activity
is no more on screen. User ca launch other application also while
running my background process.

   So only second option is remains the choice. Or there is any other
way.
   Am I right about bindService() concept[that it remains only the
fore activity is there], is there any other way to keep binding with
backservice, to know update of it even though fore ground is no more
on screen.

--~--~---------~--~----~------------~-------~--~----~



running appl in background

by Dianne Hackborn » Tue, 14 Apr 2009 01:13:37 GMT


 No.  You are right that bindService() will keep the target service running
(ONLY  if  you pass in the appropriate flag), but if you use startService()
then the service will remain running even if nothing is bound to it.






-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. how to run android source code in linux eclipse??

how to run android source code in linux eclipse??
--~--~---------~--~----~------------~-------~--~----~

2. Writing widgets *without* persistent services

Hi,

You can add res/layout-land and put your landscape layout there.  So
basically you have res/layout for portrait and res/layout-land for landscape
layouts.

Marc






--~--~---------~--~----~------------~-------~--~----~

3. Porting ANDROID on S3C2440 Platform

4. Why can "Maps" find a location on demand but not my app

5. Handling volume controls

6. Is there a way for us to show ProgressBarIndeterminate in Theme.Dialog activity?

7. Database Pattern - What's your method?