Hey Goncalo,
I have a very similar issue. We are using rooted chinese tablets with M2M 
International SIM cards with private static IP and private APN. Everything 
work fine after the tablet is started: we can ping the device from the 
server using its static IP and ping the server from the device.
We use iptables to DROP every traffic except with our server IP.
We discovered that after few minutes/hours, the device becomes unreachable 
from our server. The only workaround to wake up the connection is to make a 
ping from the device to the server. So we implemented a ping every 10 
minutes but even with this the device can becom unreachable only 2 minutes 
after the ping. I tried with the same SIM card on a 3G modem on a linux 
computer and we never have this issue. So it seems to be android related.
We could ping even more often but it would be very expensive. Each MB is so 
exensive with these sim cards.
Did you find a solution to your issue finally?

On Friday, December 14, 2012 at 11:24:04 AM UTC+1, Goncalo Oliveira wrote:
>
> Hi all,
>
> Seems that Android is dropping idle sockets when under a mobile network. 
> Usually, no socket is kept alive for more than 7 minutes of inactivity. I 
> am using a SIM card with a particular APN, that allows idle sockets for at 
> least 30 minutes - this was tested using another kind of device, also 
> communicating with GSM, and there are no drops, so problem isn't the SIM 
> card.
>
> After a few searches in the web, I tried a few approaches to work around 
> this, but until now, no success. I tried using a partial wake lock after 
> connecting, releasing only when disconnected - didn't work. Also tried 
> using only a 2G network, as some said that changing from network type could 
> impact on this - same outcome.
>
> After digging a bit more and by analyzing logcat, I watched that a 
> CONNECTIVITY_CHANGE 
> is sent after some idle time, disabling the data transfer availability 
> (active network is mobile, no connectivity) and another one is sent 
> enabling it again (active network is mobile, connectivity). This cuts off 
> all live socket connections.
>
> Investigating a little bit more, I also observed that this behavior is not 
> consistent through all Android versions, or maybe (even worse) through 
> different hardware. Connectivity break is occurring in a Galaxy Tab 7 
> with Android 4.0.4. The same isn't occurring in an Unitech TB 100 with 
> Android 3.2.
>
> Does anyone know where I can get more information and/or I can work around 
> this? I would really like to avoid sending heartbeats every 6/7 minutes.
>
>
> Cheers
>

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/57738a9a-7175-42d2-86c7-66d43c0f89fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to