← Back to team overview

ubuntu-phone team mailing list archive

Re: How to check if internet is connected

 


El 20/03/16 a las 22:36, Nekhelesh Ramananthan escribió:
> Hi XiaoGuo,
> 
> Thanks a lot for your code. It is very simple and self explanatory to go
> through and understand. I was very excited to test it on my phone, since
> for applications knowing whether you are on 3G or Wifi really helps them
> be smart about their network usage. A common example, is a Podcast app
> (Podbird) not automatically downloading new episodes if it detects users
> are on 3G. Is this possible? Can we detect if the user is on 3G or Wifi?
> I assumed that limitedBandwith would be the property for this case, but
> it always shows "bandwidth not limited" regardless of whether I'm on 3G
> or Wifi (tested on krillin & nexus4).
> 
> If the Ubuntu.Connectivity developers are reading this email, please
> provide an insight as to what "limitedBandwidth" is intended to cover.

Weren't you planning on using the download manager? If so
http://bazaar.launchpad.net/~phablet-team/ubuntu-download-manager/trunk/view/head:/src/downloads/client/ubuntu/download_manager/download.h#L120

I'm not sure what the expected behavior is if it is not allowed though
(stall or return with error), but this API is most likely the thing used
to update the image when told to only download over wifi.


Cheers
Sergio

PS: just spotted a typo there s/phones/phone's/ and s/allows/allowed/

Attachment: signature.asc
Description: OpenPGP digital signature


References