13

I'm interested in measuring the network traffic for my application. Ideally I would need to separate wireless from 3G network traffic. I can't seem to find any API that gets this information; however I see that there is at least one app in the AppStore that does something close (they actually sum up the traffic for the entire phone).

Any ideas?

Mihai Damian
  • 11,193
  • 11
  • 59
  • 81
  • Can you please explain us how? Regards, –  Jun 17 '11 at 12:29
  • Hi, i see your solution below, but I have a question: have you accomplished your project using getifaddrs? Have you figured out multi aplication problem? So you can separate application whith one use how many data? – Jakub May 10 '12 at 12:31

2 Answers2

6

I've found one approximate solution: getifaddrs can be used to get statistics on network usage.

One advantage is that it can get separate statistics for Wi-Fi and WWAN interfaces.

A disadvantage is that on multi-tasking devices those interfaces may be used by multiple applications and the statistics are cumulated.

Mihai Damian
  • 11,193
  • 11
  • 59
  • 81
6

I also was looking for solution and found it here: iPhone Data Usage Tracking/Monitoring

Please take a look this post, it provides all info that you need.

Community
  • 1
  • 1
Artem Kalachev
  • 1,132
  • 1
  • 8
  • 19