Using Objective C, I need find the specific bandwidth of the network an iOS is connected to. Does anyone have any hints for finding this information with code?
Asked
Active
Viewed 3,840 times
1
-
you can try to load N(~100) pages of Google and measure time – fatihk May 29 '13 at 13:37
-
Sorry i didn't get u. Could you plz specify the code. – Vipin Vijay May 29 '13 at 13:41
-
1it is just a bad practice in fact, measuring your internet speed roughly by successively opening some particular page in a separate thread and keeping a timer. I'm sure that much better ways exist – fatihk May 29 '13 at 13:47
1 Answers
2
You just need to place a file big enough in one of your servers (or somewhere else)
This could be done using a normal NSURLConnection.
Before start downloading, set up a timer. When your file's been downloaded, you stop the timer. Then you have the amount of time it took for the device to download X MB. You can do the calculations based on this. Once this has been done, the file can be discarded.
Of course, this will vary depending on how far the device is from the server, ping, routing, etc... but I think it's good enough for an implementation this simple. If you want more accuracy repeat the operation several times and calculate average speed.

Alejandro Benito-Santos
- 2,069
- 13
- 25
-
3Since my iPhone had a cap on its monthly data allowance, I would probably get a bit upset if one of the apps was burning through it just to test the link speed. – JeremyP May 29 '13 at 15:31