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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -