Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

wifi - 是否可以在Android 10设备上以编程方式启用wifi?(Is it possible to programmatically enable wifi on Android 10 devices?)

Since setWifiEnabled is deprecated on Android 10, how does one programatically enable wifi on Android 10 devices?

(由于setWifiEnabled在Android 10上被弃用,因此如何以编程方式在Android 10设备上启用wifi?)

Is it not possible to programmatically enable wifi at all on Android 10+ (SDK 29) ?

(在Android 10+(SDK 29)上无法以编程方式完全启用wifi吗?)

  ask by AdeleGoldberg translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

No, This is not possible to enable or disable Wi-Fi programmatically from Android-10 API level 29 [ Until google provides an alternative solution ].

(否,这无法通过Android-10 API level 29 programmatically方式enabledisable Wi-Fi [ 直到google提供替代解决方案 ]。)

For applications targeting Build.VERSION_CODES.Q or above, this API will always return false and will have no effect.

(对于面向Build.VERSION_CODES.Q或更高版本的应用程序,此API将始终返回false,并且无效。)

If apps are targeting an older SDK ( Build.VERSION_CODES.P or below), they can continue to use this API.

(如果应用程序以较早的SDK(Build.VERSION_CODES.P或更低版本)为目标,则它们可以继续使用此API。)

There is an issue 128554616 which already has been created in google issuetracker forum.

(google issuetracker论坛中已经创建了一个问题128554616 。)

You can see there for any updated info.

(您可以在此处看到任何更新的信息。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...