There are three kinds of connection errors to worry about in Mobile.
IP
address change (e.g. when you shift between WiFi and cellular) is the
worst: all connections are lost and must be restarted cold.  A loss of
signal is only guaranteed to be fatal if it persists for 30 seconds
(TCP's default timeout period).  With a shorter loss of signal, TCP
may
recover or may hang for a very long time.

Mitigating these problems requires a bit of planning.

First, choose a protocol with the shortest setup time that you can
support.  From worst to best is SFTP, FTPS, FTP, HTTPS, HTTP, custom
TCP/IP, and MTP/IP.

Second, if possible, stage your data transfer such that you can resume
where you left off in case of interruption instead of starting over.
The
easiest way to do that is to store the data in files on both the
device
and the server, then keep track of how much you received.  When a
connection goes down, you can restart at that point.  All of the
protocols above support restarting in the middle, but some make it
easier than others.

If the data is being generated programmatically, it may not be
possible
(or at least not safe) to resume it.  So consider having the server
cache programmatic data in a file for easier resume.


P.S. - In the desktop world, I'm used to thinking of 100 kilobytes as
"approximately 0".  Mobile involves a very different way of thinking!


On Mar 3, 2:40 pm, "Maps.Huge.Info (Maps API Guru)" <[email protected]>
wrote:
> My main app (Radar Now!) transfers one large (maybe 100kb) zip file to
> the device from my server. Speed is less a problem then errors. Often,
> it takes several attempts to get the file downloaded intact. I doubt
> there's much that can be done about these errors as they are due to
> spotty reception or overloaded networks rather than anything the
> device itself is responsible for.
>
> -John Coryat

-- 
You received this message because you are subscribed to the Google Groups 
"Android Discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/android-discuss?hl=en.

Reply via email to