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. The application Settings(process com.android.settintgs) has stopped unexpectedly.while running bluetooth chat given sample appln

Android sdk 2.1 supports Bluetooth but we are unable to enable
Bluetooth in emulator.
while running "Bluetooth chat application" given in  sample code .

It throws following error :
"The application Settings(process com.android.settintgs) has stopped
unexpectedly."

And even in SDK DOC its given that Bluetooth not supported by
emulator.

Emulator Limitations

In this release, the limitations of the emulator include:

    * No support for placing or receiving actual phone calls. You can
simulate phone calls (placed and received) through the emulator
console, however.
    * No support for USB connections
    * No support for camera/video capture (input).
    * No support for device-attached headphones
    * No support for determining connected state
    * No support for determining battery charge level and AC charging
state
    * No support for determining SD card insert/eject
    * No support for Bluetooth



Plz reply us how to enable blutooth in emulator

-- 

2. Updating device time

How to update the Device time via the application? Is there any APIs
available for this?

-- 

3. expanding space for apps in sd card

4. Select/Highlight/Focus on Text in a WebView

5. Android Market Problems...

6. Mobile & Embedded Industry Expert Opinions Needed

7. Looking for a developer to give a student talk on Android Development