GetIsNetworkAvailable= TRUE in FlightMode! Are you connected to your pc?

phone1

I was doing some testing for our upcoming mobile application detecting whether the user had an internet connection and handling it nicely. After doing a bunch of testing on the emulator I deployed to my device, turned on flight mode and could not for the life of me get no network! Thinking I’d done something silly I spent awhile debugging it and trying to work out why I kept getting true!

After thinking I was insane I showed the odd behaviour to John..and suddenly it started working…odd? The difference was I had to disconnect from the usb cable to walk to the other room…so does that mean when I’m connected I’m somehow using my laptop’s internet connection? So to make sure it wasn’t just by logic I made sure I couldn’t browse the web in flight mode disconnected. I plugged my phone into the computer and tried again and TADA…browser page appears.

While it’s actually a cool feature, meaning I can be totally sure I’m not burning through my phone data, on one hand it makes absolute sense from a user perspective, but from a development / testing perspective it was an unexpected result.

 

Technorati Tags: ,