java - Generating a number after connecting to wifi -
i beginner android , developing app. connect particular wifi connection in app. want generate number 1 or 2 or 3 or 4. number need other purpose. how this?
wifimanager wifimanager = (wifimanager) context.getsystemservice(context.wifi_service); wifiinfo wifiinfo = wifimanager.getconnectioninfo(); if(wifiinfo.getsupplicantstate() == supplicantstate.completed) { if(wifiinfo.getipaddress() != 0) { if((wifiinfo.getipaddress() == wifiip) && (wifiinfo.getssid().equals(wifissid))) { if (enablelogs) } else{ if (enablelogs) wifiip = wifiinfo.getipaddress(); wifissid = wifiinfo.getssid(); }
if want generate random number use this:-
final int min = 10; final int max = 100; final int random = random.nextint((max - min) + 1) + min;
Comments
Post a Comment