开发者

How to measure the amount of megabyte data?

I want to make an app that measure the amount o开发者_如何学编程f data I use while surfing on my Iphone over 3g network.

Things I would like to incorporate; - UIPickerView (to set the amount of data I want to to use before an alert shows) - AlertView ( the warning that my data is about to exceed) - Run in the background.

So basically, I want to be able to set the amount of data I have on my Data plan. I want to set the amount of data I can use before the AlertView shows and tell me I'm soon over my set limit. And last, I want it to run in the background (multitask enabled).

How do I make this app, and again I'm new to development so I wanted to start off with small apps like this. So please, can anyone help me and kind of tutor me in this?


  • You can get network statistic for pdp_ip0 interface using getifaddrs and casting if_data field to (struct if_data *). So the app is possible to create. For more details check this https://devforums.apple.com/message/253320 on the iphone -developer's forum.
  • To display the alert box just use Local Notifications.
  • To store settings use NSUserDefauls
  • To stay in the background follow this guide

Having that said I agree with shaggy it will be hard to pass the app through the review process.


This is likely not possible on the iPhone, as it requires access to system interals. You'd be better off starting with a project that doesn't require external inputs, like a calculator. Much less exciting, I am sure, but decidedly more achievable.


This is definitely not possible. Your app can't plug into the network stack and watch bytes fly by, nor can you have this run in the background on iOS 4, since it doesn't match one of the 4 archetypes for background apps (audio; location services; long-running task; VOIP).

As Seamus Campbell mentioned, this is definitely not a "small app" to start off with.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜