[android-developers] Re: Is it possible, that Android kills a service inside an app?

2015-01-06 Thread Streets Of Boston
Oleksi: What do you mean by 'killed'? Do you mean that its 'onDestroy' 
method gets called?

Let's assume you are talking explicitly about starting the Service, not 
binding to it:

If a Service is started by some other component, it needs to be explicitly 
stopped, either by the same component, an other component or by the Service 
itself (stopSelf).
If the process contains both your Service and your components that can 
start or stop the Service, your Service's onDestroy will not get called 
until it is explicitly stopped. 
As far as I can tell, this would violate the contract between the user(s) 
of Service and the Service itself. 

When your Activity (app) goes to the background, the entire process could 
get killed at some point (especially, for example, if you have a Service 
running that uses a lot of resources causing your entire app to be resource 
heavy). But that means that both your Activity and Service get killed 
(process killed) at the same time.

On Tuesday, January 6, 2015 11:49:50 AM UTC-5, Oleksii Bieliaiev wrote:
>
> Found some info here 
> 
>
>
>
> On Tuesday, November 25, 2014 12:08:18 PM UTC+1, Oleksii Bieliaiev wrote:
>>
>> Hey guys,
>>
>> let's imagine we have an app with a service and an activity inside. Both 
>> components live in a same process, our service is started (in terms of 
>> Android) and a user does some interaction with an activity. Eventually our 
>> app goes to background. My question is, whether is it possible, under 
>> certain conditions (low memory, timeout, etc), that Android "kills" our 
>> started service separately, without killing entire process?
>>
>> Thank you,
>> Alex
>>
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Is it possible, that Android kills a service inside an app?

2015-01-06 Thread Streets Of Boston
Oleksi: What do you mean by 'killed'? Do you mean that its 'onDestroy' 
method gets called?

Let's assume you are talking explicitly about starting the Service, not 
binding to it:

If a Service is started by some other component, it needs to be explicitly 
stopped, either by the same component, an other component or by the Service 
itself (stopSelf).
If the process contains both your Service and your components that can 
start or stop the Service, your Service's onDestroy will not get called 
until it is explicitly stopped. 
As far as I can tell, calling onDestroy out-of-the-blue would violate the 
contract between the user(s) of Service and the Service itself. 

When your Activity (app) goes to the background, the entire process could 
get killed at some point (especially, for example, if you have a Service 
running that uses a lot of resources causing your entire app to be resource 
heavy). But that means that both your Activity and Service get killed 
(process killed) at the same time.

On Tuesday, January 6, 2015 11:49:50 AM UTC-5, Oleksii Bieliaiev wrote:
>
> Found some info here 
> 
>
>
>
> On Tuesday, November 25, 2014 12:08:18 PM UTC+1, Oleksii Bieliaiev wrote:
>>
>> Hey guys,
>>
>> let's imagine we have an app with a service and an activity inside. Both 
>> components live in a same process, our service is started (in terms of 
>> Android) and a user does some interaction with an activity. Eventually our 
>> app goes to background. My question is, whether is it possible, under 
>> certain conditions (low memory, timeout, etc), that Android "kills" our 
>> started service separately, without killing entire process?
>>
>> Thank you,
>> Alex
>>
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Is it possible, that Android kills a service inside an app?

2015-01-06 Thread Streets Of Boston
Oleksi: What do you mean by 'killed'? Do you mean that its 'onDestroy' 
method gets called?

Let's assume you are talking explicitly about starting the Service, not 
binding to it:

If a Service is started by some other component, it needs to be explicitly 
stopped, either by the same component, an other component or by the Service 
itself (stopSelf).
If the process contains both your Service and your components that can 
start or stop the Service, your Service's onDestroy will not get called. As 
far as I can tell, this would violate the contract between the user(s) of 
Service and the Service itself. 

When your Activity (app) goes to the background, the entire process could 
get killed at some point (especially, for example, if you have a Service 
running that uses a lot of resources causing your entire app to be resource 
heavy). But that means that both your Activity and Service get really 
killed (process killed) at the same time.

On Tuesday, January 6, 2015 11:49:50 AM UTC-5, Oleksii Bieliaiev wrote:
>
> Found some info here 
> 
>
>
>
> On Tuesday, November 25, 2014 12:08:18 PM UTC+1, Oleksii Bieliaiev wrote:
>>
>> Hey guys,
>>
>> let's imagine we have an app with a service and an activity inside. Both 
>> components live in a same process, our service is started (in terms of 
>> Android) and a user does some interaction with an activity. Eventually our 
>> app goes to background. My question is, whether is it possible, under 
>> certain conditions (low memory, timeout, etc), that Android "kills" our 
>> started service separately, without killing entire process?
>>
>> Thank you,
>> Alex
>>
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Is it possible, that Android kills a service inside an app?

2015-01-06 Thread Oleksii Bieliaiev
Found some info here 




On Tuesday, November 25, 2014 12:08:18 PM UTC+1, Oleksii Bieliaiev wrote:
>
> Hey guys,
>
> let's imagine we have an app with a service and an activity inside. Both 
> components live in a same process, our service is started (in terms of 
> Android) and a user does some interaction with an activity. Eventually our 
> app goes to background. My question is, whether is it possible, under 
> certain conditions (low memory, timeout, etc), that Android "kills" our 
> started service separately, without killing entire process?
>
> Thank you,
> Alex
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Re: Is it possible, that Android kills a service inside an app?

2015-01-05 Thread Kristopher Micinski
I think the answer to your question is no: it wouldn't be that helpful
from a memory footprint perspective to simply kill the service: memory
allocation happens at the process level.  For this to be useful, the
service would have to be "killed" out in some heuristic way, then some
GC would have to run for a while, and *then* the memory would be
available.  I doubt this is preferable to simply killing the process,
since in a low memory situation you usually need memory pretty
quickly.

I haven't read all of the Android framework code that does this, so I
can can't give a certain yes or no answer.  You could ask on
android-platform and perhaps someone there would know.

You never mentioned why you need to know this information, maybe doing
so would be helpful.  There are tons of times when things in android
look like they have been "killed."  E.g., screen rotation.

Kris


On Mon, Jan 5, 2015 at 12:15 PM, Oleksii Bieliaiev
 wrote:
> Didn't find reliable answer yet :(
>
>
>
> On Tuesday, November 25, 2014 12:08:18 PM UTC+1, Oleksii Bieliaiev wrote:
>>
>> Hey guys,
>>
>> let's imagine we have an app with a service and an activity inside. Both
>> components live in a same process, our service is started (in terms of
>> Android) and a user does some interaction with an activity. Eventually our
>> app goes to background. My question is, whether is it possible, under
>> certain conditions (low memory, timeout, etc), that Android "kills" our
>> started service separately, without killing entire process?
>>
>> Thank you,
>> Alex
>
> --
> 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Is it possible, that Android kills a service inside an app?

2015-01-05 Thread Oleksii Bieliaiev
Didn't find reliable answer yet :(



On Tuesday, November 25, 2014 12:08:18 PM UTC+1, Oleksii Bieliaiev wrote:
>
> Hey guys,
>
> let's imagine we have an app with a service and an activity inside. Both 
> components live in a same process, our service is started (in terms of 
> Android) and a user does some interaction with an activity. Eventually our 
> app goes to background. My question is, whether is it possible, under 
> certain conditions (low memory, timeout, etc), that Android "kills" our 
> started service separately, without killing entire process?
>
> Thank you,
> Alex
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Re: Is it possible, that Android kills a service inside an app?

2014-12-09 Thread Oleksii Bieliaiev
Hi,

please, read my question carefully. I'm asking about a specific case, when 
Android OS "kills" a SERVICE (an application component) separately, without 
killing entire PROCESS. You are talking about the case, when Android OS 
kills entire background PROCESS, because it has low priority compared to 
other running PROCESSES.

Thank you,
Alex


On Tuesday, December 9, 2014 7:57:36 AM UTC+1, gjs wrote:
>
> Hi,
>
> You can prove this yourself by creating a test app with a service & 
> running a few tests.
>
> Run the test app & start the service on a recent device with Android V4+ 
> then leave the service running & go & do other stuff for a while.
>
> Sometime during the next few hours you probably find that your service has 
> been killed by the OS regardless of whether the service was busy or not (& 
> regardless of OOM pressure).
>
> If you want the service to remain running longer than a few hours you will 
> need to use 'startForeground' 
> http://developer.android.com/reference/android/app/Service.html#startForeground(int,
>  
> android.app.Notification) but even that will not prevent the OS from 
> killing your service when it thinks it really needs to due to memory 
> pressure.
>
> Once upon a time before approximately Android V2.2 services were left 
> running indefinitely & weren't eagerly killed by the OS ( even without 
> having to specify 'startForeground' or 'setForeground' ) provided there was 
> no memory pressure, but that's no longer the case.
>
> What's officially documented & what actually happens on real devices will 
> vary, so prove to your own satisfaction by testing...
>
> Regards
>
> On Tuesday, December 9, 2014 12:01:12 PM UTC+11, Peter Teoh wrote:
>>
>> *The Service can still be killed by Android.*
>>
>>
>> Any proofs?
>>
>> not any proofs, but just some discussion is possible:
>>
>> Read this:
>>
>>
>> http://developer.android.com/reference/android/content/Context.html#startService%28android.content.Intent%29
>>
>> From above, there is a line:   
>>
>> The only time they should be stopped is if the current foreground 
>> application is using so many resources that the service needs to be killed.
>>
>> This is talking about the OOM killer.
>>
>> In traditional Linux OOM is initiated from the kernel.   But here in 
>> Android there is a special lowmemorykiller daemon:
>>
>> https://source.android.com/devices/tech/low-ram.html   (looked out for 
>> lowmemorykiller, the name as it is)
>>
>> Under Android source code:
>>
>>
>> frameworks/base/services/core/java/com/android/server/am/ActiveServices.java:
>> final void killServicesLocked(ProcessRecord app, boolean 
>> allowRestart) {
>>
>>
>> frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java:
>> mServices.killServicesLocked(app, allowRestart);
>>
>> You can see the caller and the implementer of the function above.   It is 
>> where BIND_ALLOW_OOM_MANAGEMENT parameter are checked, and thus killing the 
>> services is done if necessary.
>>
>> More info:
>>
>>
>> http://stackoverflow.com/questions/18972590/the-timing-to-start-android-low-memory-killer
>>
>> http://forum.xda-developers.com/showthread.php?t=904023
>>
>> And this is from Linux kernel source code (under drivers/staging/android 
>> means it is still yet to be approved by linux kernel - at that time):
>>
>>
>> http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/drivers/staging/android/lowmemorykiller.txt
>>
>> http://www.programering.com/a/MjNzADMwATE.html
>>
>> http://lwn.net/Articles/511731/
>>
>> http://varun-anand.com/mem_mgmt.html
>>
>> Regards, 
>> Peter Teoh
>>
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Re: Is it possible, that Android kills a service inside an app?

2014-12-09 Thread Oleksii Bieliaiev
Hi Peter,

thank you for your reply. However, please read my question carefully. I'm 
asking about a specific case, when Android OS "kills" a SERVICE (an 
application component) separately, without killing entire PROCESS. Please 
check your own links. You pointed at
final void killServicesLocked(ProcessRecord app, boolean allowRestart)
but it is called from
private final void cleanUpApplicationRecordLocked(ProcessRecord app, 
boolean restarting, boolean allowRestart, int index)
This method has a javadoc comment stating that "Main code for cleaning up a 
process when it has gone away.  This is called both as a result of the 
process dying, or directly when stopping a process when running in single 
process mode." Cleaning up a PROCESS, not a single SERVICE inside a 
PROCESS. Android LowMemoryKiller works with Linux PROCESSES, not with 
application components like SERVICES. Application components only influence 
PROCESS priority, so that LowMemoryKiller can make a decision. But 
LowMemoryKiller kills entire PROCESS.

Thank you,
Alex


On Tuesday, December 9, 2014 2:01:12 AM UTC+1, Peter Teoh wrote:
>
> *The Service can still be killed by Android.*
>
>
> Any proofs?
>
> not any proofs, but just some discussion is possible:
>
> Read this:
>
>
> http://developer.android.com/reference/android/content/Context.html#startService%28android.content.Intent%29
>
> From above, there is a line:   
>
> The only time they should be stopped is if the current foreground 
> application is using so many resources that the service needs to be killed.
>
> This is talking about the OOM killer.
>
> In traditional Linux OOM is initiated from the kernel.   But here in 
> Android there is a special lowmemorykiller daemon:
>
> https://source.android.com/devices/tech/low-ram.html   (looked out for 
> lowmemorykiller, the name as it is)
>
> Under Android source code:
>
>
> frameworks/base/services/core/java/com/android/server/am/ActiveServices.java:
> final void killServicesLocked(ProcessRecord app, boolean allowRestart) 
> {
>
>
> frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java:
> mServices.killServicesLocked(app, allowRestart);
>
> You can see the caller and the implementer of the function above.   It is 
> where BIND_ALLOW_OOM_MANAGEMENT parameter are checked, and thus killing the 
> services is done if necessary.
>
> More info:
>
>
> http://stackoverflow.com/questions/18972590/the-timing-to-start-android-low-memory-killer
>
> http://forum.xda-developers.com/showthread.php?t=904023
>
> And this is from Linux kernel source code (under drivers/staging/android 
> means it is still yet to be approved by linux kernel - at that time):
>
>
> http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/drivers/staging/android/lowmemorykiller.txt
>
> http://www.programering.com/a/MjNzADMwATE.html
>
> http://lwn.net/Articles/511731/
>
> http://varun-anand.com/mem_mgmt.html
>
> Regards, 
> Peter Teoh
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Re: Is it possible, that Android kills a service inside an app?

2014-12-08 Thread gjs
Hi,

You can prove this yourself by creating a test app with a service & running 
a few tests.

Run the test app & start the service on a recent device with Android V4+ 
then leave the service running & go & do other stuff for a while.

Sometime during the next few hours you probably find that your service has 
been killed by the OS regardless of whether the service was busy or not (& 
regardless of OOM pressure).

If you want the service to remain running longer than a few hours you will 
need to use 
'startForeground' 
http://developer.android.com/reference/android/app/Service.html#startForeground(int,
 
android.app.Notification) but even that will not prevent the OS from 
killing your service when it thinks it really needs to due to memory 
pressure.

Once upon a time before approximately Android V2.2 services were left 
running indefinitely & weren't eagerly killed by the OS ( even without 
having to specify 'startForeground' or 'setForeground' ) provided there was 
no memory pressure, but that's no longer the case.

What's officially documented & what actually happens on real devices will 
vary, so prove to your own satisfaction by testing...

Regards

On Tuesday, December 9, 2014 12:01:12 PM UTC+11, Peter Teoh wrote:
>
> *The Service can still be killed by Android.*
>
>
> Any proofs?
>
> not any proofs, but just some discussion is possible:
>
> Read this:
>
>
> http://developer.android.com/reference/android/content/Context.html#startService%28android.content.Intent%29
>
> From above, there is a line:   
>
> The only time they should be stopped is if the current foreground 
> application is using so many resources that the service needs to be killed.
>
> This is talking about the OOM killer.
>
> In traditional Linux OOM is initiated from the kernel.   But here in 
> Android there is a special lowmemorykiller daemon:
>
> https://source.android.com/devices/tech/low-ram.html   (looked out for 
> lowmemorykiller, the name as it is)
>
> Under Android source code:
>
>
> frameworks/base/services/core/java/com/android/server/am/ActiveServices.java:
> final void killServicesLocked(ProcessRecord app, boolean allowRestart) 
> {
>
>
> frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java:
> mServices.killServicesLocked(app, allowRestart);
>
> You can see the caller and the implementer of the function above.   It is 
> where BIND_ALLOW_OOM_MANAGEMENT parameter are checked, and thus killing the 
> services is done if necessary.
>
> More info:
>
>
> http://stackoverflow.com/questions/18972590/the-timing-to-start-android-low-memory-killer
>
> http://forum.xda-developers.com/showthread.php?t=904023
>
> And this is from Linux kernel source code (under drivers/staging/android 
> means it is still yet to be approved by linux kernel - at that time):
>
>
> http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/drivers/staging/android/lowmemorykiller.txt
>
> http://www.programering.com/a/MjNzADMwATE.html
>
> http://lwn.net/Articles/511731/
>
> http://varun-anand.com/mem_mgmt.html
>
> Regards, 
> Peter Teoh
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Re: Is it possible, that Android kills a service inside an app?

2014-12-08 Thread Peter Teoh
>
> *The Service can still be killed by Android.*


Any proofs?

not any proofs, but just some discussion is possible:

Read this:

http://developer.android.com/reference/android/content/Context.html#startService%28android.content.Intent%29

>From above, there is a line:

The only time they should be stopped is if the current foreground
application is using so many resources that the service needs to be killed.

This is talking about the OOM killer.

In traditional Linux OOM is initiated from the kernel.   But here in
Android there is a special lowmemorykiller daemon:

https://source.android.com/devices/tech/low-ram.html   (looked out for
lowmemorykiller, the name as it is)

Under Android source code:

frameworks/base/services/core/java/com/android/server/am/ActiveServices.java:
final void killServicesLocked(ProcessRecord app, boolean allowRestart) {

frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java:
mServices.killServicesLocked(app, allowRestart);

You can see the caller and the implementer of the function above.   It is
where BIND_ALLOW_OOM_MANAGEMENT parameter are checked, and thus killing the
services is done if necessary.

More info:

http://stackoverflow.com/questions/18972590/the-timing-to-start-android-low-memory-killer

http://forum.xda-developers.com/showthread.php?t=904023

And this is from Linux kernel source code (under drivers/staging/android
means it is still yet to be approved by linux kernel - at that time):

http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/drivers/staging/android/lowmemorykiller.txt

http://www.programering.com/a/MjNzADMwATE.html

http://lwn.net/Articles/511731/

http://varun-anand.com/mem_mgmt.html

Regards,
Peter Teoh

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Is it possible, that Android kills a service inside an app?

2014-12-05 Thread Johan Appelgren
What? Whether a Service runs in a separate process or not DOES NOT depend 
on whether you bind to it and/or start it using startService. That is only 
controlled by the process attribute, 
see 
http://developer.android.com/guide/topics/manifest/service-element.html#proc. 

On Friday, December 5, 2014 12:32:33 PM UTC+1, Ashik Vetrivelu wrote:
>
> It depends on the Service which you have. Service in android is of two 
> types:
> Bound Service and Unbounded Service. Binded Service is what is bound to 
> the activity and it lives as long as activity is running. But unbound 
> service is like a *Separate Process. The Service can still be killed by 
> Android.*To avoid this in the onDestroy() method just call the 
> BroadcastReceiver which launches the service. 
>  
>
> On Tuesday, November 25, 2014 4:38:18 PM UTC+5:30, Oleksii Bieliaiev wrote:
>>
>> Hey guys,
>>
>> let's imagine we have an app with a service and an activity inside. Both 
>> components live in a same process, our service is started (in terms of 
>> Android) and a user does some interaction with an activity. Eventually our 
>> app goes to background. My question is, whether is it possible, under 
>> certain conditions (low memory, timeout, etc), that Android "kills" our 
>> started service separately, without killing entire process?
>>
>> Thank you,
>> Alex
>>
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Is it possible, that Android kills a service inside an app?

2014-12-05 Thread Oleksii Bieliaiev

>
> It depends on the Service which you have. Service in android is of two 
> types:


I'm asking specifically about Started service 

 

*The Service can still be killed by Android.*


Any proofs?

Thank you,
Alex


On Friday, December 5, 2014 12:32:33 PM UTC+1, Ashik Vetrivelu wrote:
>
> It depends on the Service which you have. Service in android is of two 
> types:
> Bound Service and Unbounded Service. Binded Service is what is bound to 
> the activity and it lives as long as activity is running. But unbound 
> service is like a *Separate Process. The Service can still be killed by 
> Android.*To avoid this in the onDestroy() method just call the 
> BroadcastReceiver which launches the service. 
>  
>
> On Tuesday, November 25, 2014 4:38:18 PM UTC+5:30, Oleksii Bieliaiev wrote:
>>
>> Hey guys,
>>
>> let's imagine we have an app with a service and an activity inside. Both 
>> components live in a same process, our service is started (in terms of 
>> Android) and a user does some interaction with an activity. Eventually our 
>> app goes to background. My question is, whether is it possible, under 
>> certain conditions (low memory, timeout, etc), that Android "kills" our 
>> started service separately, without killing entire process?
>>
>> Thank you,
>> Alex
>>
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Is it possible, that Android kills a service inside an app?

2014-12-05 Thread Ashik Vetrivelu
It depends on the Service which you have. Service in android is of two 
types:
Bound Service and Unbounded Service. Binded Service is what is bound to the 
activity and it lives as long as activity is running. But unbound service 
is like a *Separate Process. The Service can still be killed by Android.*To 
avoid this in the onDestroy() method just call the BroadcastReceiver which 
launches the service. 
 

On Tuesday, November 25, 2014 4:38:18 PM UTC+5:30, Oleksii Bieliaiev wrote:
>
> Hey guys,
>
> let's imagine we have an app with a service and an activity inside. Both 
> components live in a same process, our service is started (in terms of 
> Android) and a user does some interaction with an activity. Eventually our 
> app goes to background. My question is, whether is it possible, under 
> certain conditions (low memory, timeout, etc), that Android "kills" our 
> started service separately, without killing entire process?
>
> Thank you,
> Alex
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.