Quote:
Originally Posted by baja_yu
Not without an outside server to test the download and upload speeds using sample data.
|
+1 to that.
I'd suggest some caution, though, as to get an accurate measure usually takes more than a handful of bytes. The users may not appreciate their sudden surge in data charges caused by the app
My recommendation would be to try something else first:
a) UDP vs TCP - UDP has far less overhead, but you may need additional logic to handle dropped, duplicated, and out-of-order packets
b) Buffering - if you've got a large video file, for example, you can begin pulling the file AND watch how fast the file is arriving. This gives you the best of both worlds - no superfluous data flying forth just to measure speed, and you can begin playing early if you've got good throughput
c) Compression - don't send a large text file, use zlib to send a much smaller zip
d) Async operations - keep the app responsive by not downloading in the main thread
e) Distract - one of the magician's best tools. Show your user an amusing animation while you download, do a "movie fun facts", etc. Misdirection can be used to good effect (slightly overestimate download times - so that you can "jump" faster toward the end). Mentalism would be the Penn-ultimate (sic) achievement - but there's already a hypnotoad app