I eventually will look for hotspots and call only when one is detected
and online.  Thanks for that bit of information and code.  

But during testing, I shouldn't have an issue.  I've decided to take
your thoughts to heart on the emulator and decided to nuke it.  I'm
building a clean emulator(what a painfully long task) and will make sure
that the VM has Internet.  This will give me a clean bench.  I will then
load the application and see what happens.  

I have noticed the emulator is a little flaky where I have to restart it
or even reboot my PC. 

So, let me get a clean bench and make sure Internet is working and I'll
let your know.  On a side note, it would be great if I could use
virtualbox for testing because I save and load different snapshots.

Tim



-----Original Message-----
From: monodroid-boun...@lists.ximian.com
[mailto:monodroid-boun...@lists.ximian.com] On Behalf Of Jonathan Pryor
Sent: Friday, August 05, 2011 12:03 PM
To: Discussions related to Mono for Android
Subject: Re: [mono-android] HTTP issues

On Aug 5, 2011, at 11:31 AM, Tim Kelly wrote:
> However, during on C# testing, this attached routine is called every
minute and after a short period of time it causes the networking in the
emulator to stop requiring a reboot. 
>  
> We've determined nothing from the logs other than it  seems the DNS
request dies as a reported error first and then additional request just
timeout.  But basically it is all over the place and not consistent.

When that happens, before you reboot the emulator, try opening the
Browser app and seeing if you can navigate to a URL. Is it a system wide
loss of DNS/etc., or is it local to your app?

What I've noticed in testing with the emulator is that frequently when
the emulator boots it has no networking, and Browser won't be able to
load anything (which breaks my test app, which also tries a network
request w/o any graceful error catching). Restarting the emulator fixes
this problem (as I haven't explored enough to figure out why the
emulator is coming up w/o networking in the first place).

This may or may not be related to the issues you're seeing; I have no
idea. It does bring up a major point, though: you can't expect to have
"always accessible" networking on the device, so you should try checking
the network connection status before you fire off your network requests
(adapted from
http://www.androidpeople.com/android-how-check-network-statusboth-wifi-a
nd-mobile-3g):

        static bool IsNetworkAvailable (Context context)
        {
                // requires the android.permission.ACCESS_NETWORK_STATE
permission
                var manager = (Android.Net.ConnectivityManager)
context.GetSystemService(Context.ConnectivityService);
                var wifi = manager.GetNeworkInfo
(Android.Net.ConnectivityType.Wifi);
                var mobile = manager.GetNetworkInfo
(Android.Net.ConnectivityType.Mobile);
                bool online = wifi.IsAvailable || mobile.IsAvailable;
                return online;
        }

This may help your app, it may not; it's my current best guess. :-)

 - Jon

_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to