Giter VIP home page Giter VIP logo

lzan13_wifi's Introduction

这个小例子可以判断设备是否已经连接网络,并且在连接网络的状态下可以判断是wifi无线连接还是GPRS手机网络连接,这样就可以在不同的网络连接下去调用不同的方法,处理不同的事情,比如一个有下载功能的app可以判断只有当wifi连接的是后去下载文件,GPRS流量连接则不下载!

在没有连接的网络的情况下会弹出一个对话框,让用户选择是否去设置网络连接!

image

我这里为了能明确的说明wifi和GPRS连接的不同情况,设置了wifi连接下加载一个admob的广告条,GPRS下不去加载广告,这也算是在实际的开发中提升用户体验的一个途径吧!

更多请关注我的个人博客:http://www.melove.net

lzan13_wifi's People

Contributors

lzan13 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.