1、 Requirement description
Recently, we need to make a requirement to determine whether the Android device is connected to the WiFi with the specified name before doing a certain business. If you are connected to the WiFi with the specified name, you can continue a service; Otherwise, skip to settings to connect to the WiFi with the specified name
Therefore, I need to obtain the WiFi name of the current Android device connection for business logic judgment
2、 Implementation method
Before implementation, you need to add corresponding permissions
First of all, it’s necessary to obtain permissions. Those above 8.0 should be added in Android manifest
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission
Similar Posts:
- Permissions required by Vibrator.vibrate: android.permission.VIBRATE
- D/NetworkSecurityConfig: No Network Security Config specified, using platform default
- Android Error: open failed: EACCES (Permission denied)
- Solution to the error of “may missing Internet permission” in Android
- OS Error: No address associated with hostname, errno = 7 [How to Solve]
- How to Solve Android Error: java.lang.SecurityException: Permission Denial
- Socket failed:EACCES(Permission denied) [How to Solve]
- How to connect Android mobile phone with ADB & reasons and solutions of unable to connect to 192.168.1.100:5555
- About multi_ image_ Error reporting for picker
- Android Studio Failed to Install app Error: INSTALL_FAILED_DUPLICATE_PERMISSION