Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dok24

macrumors newbie
Original poster
Jun 30, 2011
11
0
Hey all,

I have a quick question regarding my iphone application I'm building. It is sending and receiving data over the wifi, which is working great. When I have it plugged into the computer, and have it running through Xcode, it never loses wifi. When I have the phone on it's own, and I turn off the screen, within about 20 seconds it loses wifi connection. It gets connection back when I go through the lock screen, but ideally I would rather have it maintain a constant connection to avoid complications server side.

Is there any way to prevent this behavior?? I have searched through the apple documentation and have come up empty handed.

Thanks!
 
And I think u will remain empty handed.. Something the OS Does for you, you can mostly (wel, allmost never) change.
It's to secure battery life if i'm not mistaking. So I think u need to rebuild parts of your app ;o
Unless someone has a better idea.
 
...but ideally I would rather have it maintain a constant connection to avoid complications server side.

You should build your app so that it handles the possibility of no network connection. Apple may reject it, if it doesn't. I know first-hand. We had an app rejected because it didn't gracefully handle when there was no internet connection.

Maybe tell us more about why you think it needs a constant connection (i.e. what is your app doing over this connection) and we might be able to suggest some alternatives.
 
I am not going to upload it to the store - this is purely for research purposes.

What we are doing with the iphone is using it for both localization(through pinpointing the WiFi signal strength), and back and fourth communications with the server that have to happen in real time.

I guess I could just turn off autolock and keep the screen on, but that seems to drastically decrease battery life. Does anybody know if blacking the screen out manually will lessen the impact?
 
I've had some large downloads to my IP4 - I sleep the phone, and after the download is complete (10-15 minutes later) the battery life fell by 10% or so. (and the phone was warm - even though the display had not been running at all)

I'm sure the packet handling, data processing also bit a lot more - but even so, I was surprised how much it consumed, especially with excellent signal strength on the radio...
 
I am not going to upload it to the store - this is purely for research purposes.

What we are doing with the iphone is using it for both localization(through pinpointing the WiFi signal strength), and back and fourth communications with the server that have to happen in real time.

I guess I could just turn off autolock and keep the screen on, but that seems to drastically decrease battery life. Does anybody know if blacking the screen out manually will lessen the impact?

Have you considered your options in regards to iOS 4's background services?
 
Have you considered your options in regards to iOS 4's background services?

As far as I know you would need 3g to take advantage of those services? Unfortunately, 3g is not available to us.
 
I guess I could just turn off autolock and keep the screen on, but that seems to drastically decrease battery life.

Autolock (and the switch on top of the phone) do more than just turn off the screen. They put the thing to sleep, which suspends all processing, pretty much the same as if you put your Mac to sleep. The switch on the top of the iPhone is even called Sleep/Wake in the User Manual.

The reason it doesn't sleep when it's connected to USB is because it doesn't need to. It's charging, which doesn't deplete the battery.

Does anybody know if blacking the screen out manually will lessen the impact?
If you mean simply drawing all black pixels to the screen, then I doubt that will improve the battery life. The screen-related battery killer is the backlight, not the LCD itself. So figure out a way to dim the backlight all the way down, and that might improve battery life.

The wireless chip is a pretty big power hog, too, so I frankly wouldn't expect much of a gain even if you manage to dim the backlight to nothing.
 
Last edited:
At the moment the iphones and computers in charge of running the servers.
 
At the moment the iphones and computers in charge of running the servers.
I meant want models of iPhones are available to you (original iPhone, iPhone 3G, iPhone 3GS, etc.) Unless of course you meant 3G, the telecommunication service, as opposed to say, EDGE.
 
I meant want models of iPhones are available to you (original iPhone, iPhone 3G, iPhone 3GS, etc.) Unless of course you meant 3G, the telecommunication service, as opposed to say, EDGE.

Oh! My mistake. It is a 3Gs.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.