How to connect to an available WIFI network through our application in android? [closed]

StackOverflow https://stackoverflow.com/questions/22143981

  •  19-10-2022
  •  | 
  •  

سؤال

I scan for all the WIFI networks and then display them in a ListView. Now I want a click on one of the list items to open a dialog box asking for confirmation and the password of that access point to be given by the user. (same as the native wifi application do in android)

هل كانت مفيدة؟

المحلول

try this link How do I connect to a specific Wi-Fi network in Android programmatically? and also add permission in manifest

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />

نصائح أخرى

Use wifiReciever.wifiScanList.get(pos).SSID to get the SSID and then use WiFiConfiguration class to connect...

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top