[android-developers] Re: Permanent socket connection drains battery

2010-07-16 Thread Namrata
@Jens I am not explicitly holding WakeLock. If running service which runs a thread with a infinite loop blocking at inputsream read implicitly holds wake lock then I am not sure about it. @Jokin Have registered for C2DM waiting for their reply from 2 days. I can not use chrometophone as I want to

[android-developers] Re: Permanent socket connection drains battery

2010-07-16 Thread Jokin Cuadrado
the best and easier way i can figure is to use the Android Cloud to Device Messaging service, using the underlying google sync connection that it's already running. http://code.google.com/android/c2dm/index.html You can see also the chrometophone extension code to see a working implementation: ht

[android-developers] Re: Permanent socket connection drains battery

2010-07-16 Thread Jens
So you're holding a wake lock that keeps the network and CPU on at all times? Which would prevent the device from sleeping? Yeah, that's a pretty sure-fire way of draining the battery. On 15 Juli, 15:41, Namrata wrote: > > Do you really need to have a socket open at all times? > > yes, my applica

Re: [android-developers] Re: Permanent socket connection drains battery

2010-07-15 Thread Connick
Possible to leverage Googles cloud messaging instead? You can push intents down to the device. On Thu, Jul 15, 2010 at 9:41 AM, Namrata wrote: > > Do you really need to have a socket open at all times? > yes, my application is based on push technique for which I always need > to keep it open >

[android-developers] Re: Permanent socket connection drains battery

2010-07-15 Thread Namrata
> Do you really need to have a socket open at all times? yes, my application is based on push technique for which I always need to keep it open >only keep the socket open while the user is actually using the application. yup I am doing it. Actually the fuctionality of app includes minimization of

Re: [android-developers] Re: Permanent socket connection drains battery

2010-07-15 Thread Miguel Morales
Do you really need to have a socket open at all times? Why not periodically check the server using an Alarm, or only keep the socket open while the user is actually using the application. Also, any loop will drain your battery, you might try sleeping at the end of it. On Thu, Jul 15, 2010 at 5:

[android-developers] Re: Permanent socket connection drains battery

2010-07-15 Thread Namrata
Thanks Mark.. On Jul 15, 5:06 pm, Mark Murphy wrote: > On Thu, Jul 15, 2010 at 7:56 AM, Namrata wrote: > > any answer?..This is blocking issue for me as it drains batter in > > couple of hours. > > You may wish to watch the C2DM presentation from Google I|O 2010, as > they provide a few hints on

Re: [android-developers] Re: Permanent socket connection drains battery

2010-07-15 Thread Mark Murphy
On Thu, Jul 15, 2010 at 7:56 AM, Namrata wrote: > any answer?..This is blocking issue for me as it drains batter in > couple of hours. You may wish to watch the C2DM presentation from Google I|O 2010, as they provide a few hints on how they try to minimize battery usage. -- Mark Murphy (a Commo

[android-developers] Re: Permanent socket connection drains battery

2010-07-15 Thread Namrata
any answer?..This is blocking issue for me as it drains batter in couple of hours. On Jul 15, 2:29 pm, Namrata wrote: > Hi, > > I am developing an app which has one service running in the background > even if the application is closed. This service basically listens to > the server via socket con