mopub/mopub-client — pull request #37 by rfgamaral (2012-02-25 17:21:48+00:00)
Title: Check for network connectivity before loading an ad

I noticed that the MoPubClient requests an ad every X seconds when there is no network connection. This doesn't bother me, it's normal behavior as we expect to receive ads as soon as the network connection is up again. What bothers me is that LogCat will be filled with "loading ad failed" messages because it is actually trying to request a new ad (going through a long process to do so).

The problem is that no verification for network connectivity is ever made and it just assumes the network is up, requesting a new ad, until it fails to connect to the ad server. This patch will prevent an ad from being requested if there is no network connectivity. It will kick in and try to load a new ad every X seconds, always checking for network connectivity first.