On Mon, Apr 15, 2013 at 8:44 AM, Kostya Vasilyev <kmans...@gmail.com> wrote:

> Robert,
>
> Could you elaborate on the "issues like these" part? Are there changes in
> Android that developers should be made aware?
>

By "issues like these" I just meant the inevitable bugs that will crop up
when making software.  If there is a library on the platform that already
does what you need it is risky to decide to create your own redundant code.


> I also have an app that uses long persistent server connection, and using
> GCM is not an option either.
>
> Can you elaborate on why GCM is not an option for you?  We want to make
GCM useful, so if it's missing features or "is not an option" we want to
know about it..


> It seems that with Android 4.1 and 4.2, connections often go "dead" --
> even though technically connected (at the server side), data pushed by the
> server stops getting through (this is verified by server logs).
>

Is that just on WiMAX as the original poster suggested?  Do you have
bugreports and/or packet captures?


>
> Android 4.0 does not seem to suffer from these issues, at least not to the
> same extent.
>
> A Nexus 7 and a Galaxy Nexus running the same stock 4.2.2, connected to
> the same server, over the same WiFi network, will experience dead
> connections at different rates (confirmed by logging).
>

Can you share a bugreport and packet capture?  There was no intention to
kill long-lived connections in android, so if there is an issue with 4.2.*
we need to hear about it.


> The suggestion to use GCM does not benefit everyone.
>

> It's nice that that Android has GTalk which provides GCM, and has its own
> keep-alive logic, but with it being closed source, and with apparent
> changes in recent Android versions, this leaves those developers who can't
> use GCM dead in the water.
>
> It would be great if someone from Google could comment, and explain,
> what's different in Android 4.1 - 4.2 with respect to long running
> connections, and what sort of magic is now required to keep them alive, for
> those apps that really need it.
>

As I said above we did not intentionally do anything to break long-lived
connections.  We encourage GCM use as it lets us do optimizations based on
mobile network type, etc to save on signaling traffic and battery life, but
you should still be able to roll your own if you wish.

There was a bug introduced in the 4.1 timeframe on mobile-data connections
we stopped counting udp packets when determining if a mobile connection was
hung - this could cause us to reset the mobile connection even when it was
live if only udp packets were being passed.  This doesn't apply to wifi OR
to mobile with GTalk alive - only on a private mobile network where GTalk
servers are inaccessible.

>
> Thanks,
> -- K
>
>
> 2013/4/15 Robert Greenwalt <rgreenw...@google.com>
>
>> Could you use GCM <http://developer.android.com/google/gcm/index.html> 
>> instead
>> of rolling your own long-lived connection with independent keepalive?
>>  It'll be better for the users battery and better for the carriers network
>> and you won't have to figure out issues like these.
>>
>>
>> On Sat, Apr 13, 2013 at 3:35 AM, Long <long...@gmail.com> wrote:
>>
>>> Hi Developers,
>>>     I have an background service which connects my server with a TCP
>>> connection.
>>>     My background service sends a ping packet to my server every
>>> 4minutes to keep the socket alive.
>>>    The problem is that the device can not get the packet from the server
>>> after a short time(3 seconds from my test) after the ping is sent.
>>>    This app works fine on other networks(AT&T, verizon).
>>>
>>>    The strange thing is that if I force the device to connect to 3G(EVDO
>>> revision A), it works fine.
>>>
>>>    It seems to me that, on Sprint 4G network, when an app sends a packet
>>> through a tcp socket, and then the socket is idle for
>>> several seconds, then the app will never be able to receive packets from
>>> this socket.
>>>
>>>    I don't think it's related to the 4G signal, since this issue can be
>>> reproduced every time.
>>>
>>>    Any suggestions?
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> --
>>> 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/groups/opt_out.
>>>
>>>
>>>
>>
>>  --
>> --
>> 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/groups/opt_out.
>>
>>
>>
>
>  --
> --
> 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/groups/opt_out.
>
>
>

-- 
-- 
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/groups/opt_out.


Reply via email to