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. Validating XML file using XSD file

Hi,

Is it possible to validate XML files using a XSD file only with the
available Android's classes? If it is, where can I find an example
code?

Thanks in advance :D

Adriano Crestani
--~--~---------~--~----~------------~-------~--~----~

2. System Menu option issue

Is there a way to change the layout of the menu to be in a small font
and size format..
Each item looks very big when the menu option is clicked.

I am running out of time,..please any quick help is appreciated
--~--~---------~--~----~------------~-------~--~----~

3. Maps: Zoom to show multiple locations

4. Log API names are cryptic

5. Porting Android Apps to iPhone

6. Intent for Time

7. Is there any one building a chatroom in the android?