Hi Guest

MobileUser

1 HomePage 1 Jobs 1 WalkIn 1Articles  

Cat Exam

 :) Latest Topic
AJAX
VB.NET
SQL Query
UDDI
CLASS
JavaScript Questions
SharePoint Interview
SilverLight
WCF
general knowledge
 ASP.NET
 :) Hot Jobs
 
 :) Latest Articles


  

 


Name the API which is used to manage all aspects of WIFI connectivity with syntax?
Question Posted on 11 Aug 2021

Home >> Android >> Android Interview Questions >> Name the API which is used to manage all aspects of WIFI connectivity with syntax?




Name the API which is used to manage all aspects of WIFI connectivity with syntax?
Name of WIFI API is WiFiManager which is used to manage all the aspects of WiFi connectivity. And to instantiate this class we used method name is getSystemService. And syntax is given below:-


WifiManager Wifiobjmain;
Wifiobjmain = (WifiManager) getSystemService(Context.WIFI_SERVICE);


And to get the scan list of wirless networks we need to register our broadcastReceiver. And to register we use registerReceiver method with argument of our receiver class object. And syntax for this is given below:-


class WifiScanReceiver extends BroadcastReceiver
{
 public void onReceive(Context c, Intent intent)
 {
 }
}
WifiScanReceiver wifiRecieverobj = new WifiScanReceiver();
registerReceiver(wifiRecieverobj, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));



And to start above scan we use startScan method of WifiManager class. And this method returns a list of ScanResult objects. And to access this object we use get method. ANd systax for that is given below:-


List< ScanResult> wifiScanList = mainWifiObj.getScanResults();
String data = wifiScanList.get(0).toString();
0
0



 
 Input Your Comments Or suggestions(If Any)
 Name
 Email(optional)
 Comments


Other Important Questions
Can we change the name of any application after its deployment in Android?
What is DDMS and its features?
Code to call another activity in Android?
What is Android and used for
What is Open Handset Alliance (OHA)






 
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |