"Sticky Notes" sign in App Android client (open source)

Source: Internet
Author: User
Tags get ip

[note] Sign-in app, Android client, server use Bmob service, use Office WiFi MAC address sign in, JKXQJ

1, the reason to do this app: the Friday company Administration told me that I did not sign in July, so decided to take the weekend to do a router based on the MAC address of the check-in app.

2, the afternoon I was in the company to draw a sketch, prepare for the weekend to do it.

3, in fact, this app is very simple, backstage with the Bmob service, development efficiency doubled, half a day to make.
As follows:



4, the core code is as follows:

    //Check what network is connected     PublicIntegerCheckwifi(Context context) {Connectivitymanager Connectivitymanager = (connectivitymanager) context.getsystemservice (Context.CONNECTIVITY_        SERVICE); Networkinfo mnetworkinfo = Connectivitymanager.getactivenetworkinfo ();if(mnetworkinfo.getstate () = = NetworkInfo.State.CONNECTED) {if(Mnetworkinfo.gettype () = = Connectivitymanager.type_mobile) {return 1;//return 1, connected to a mobile network}Else if(Mnetworkinfo.gettype () = = Connectivitymanager.type_wifi) {return 2;//Return 2, connected to WiFi}            }Else{return 3;//Return 3, no connection. }return 3; }//Get IP     PublicStringgetlocalipaddress() {Try{ for(Enumeration<networkinterface> en = networkinterface.getnetworkinterfaces (); en.hasmoreelements ();) {NetworkInterface intf = en.nextelement (); for(Enumeration<inetaddress> enumipaddr = intf.getinetaddresses (); enumipaddr.hasmoreelements ();) {InetAddress inetaddress = enumipaddr.nextelement ();if(!inetaddress.isloopbackaddress ()) {returnInetaddress.gethostaddress (). toString (); }                }            }        }Catch(SocketException ex) {LOG.E ("IP address is:", ex.tostring ()); }return NULL; }//Get Mac     PublicStringgetlocalmacaddress() {Wifimanager WiFi = (wifimanager) getsystemservice (Context.wifi_service); Wifiinfo info = Wifi.getconnectioninfo ();returnInfo.getmacaddress (); }

5, the project has uploaded GitHub, welcome watch/fork/star/download.
Https://github.com/jkxqj/BianQian

CSDN Code Address:
Https://code.csdn.net/acmjk/bianqian

Copyright NOTICE: This article for Bo Master original article, reproduced please indicate this blog address! Look to the Master,follow the Master,walk with the Master,see through the master, become the master.

"Sticky Notes" sign in App Android client (open source)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.