简体   繁体   English

有什么方法可以自动在 Android 10 中创建具有指定 SSID 和密码的热点?

[英]Is there any way to create an Hotspot with specified SSID and Password in Android 10 automatically?

I've been working for a while on an application that enables and disables an Hotspot with specific SSID and Password in order to create a connection and trasfer data through FTP with the connection's client.我已经在一个应用程序上工作了一段时间,该应用程序启用和禁用具有特定 SSID 和密码的热点,以便使用连接的客户端创建连接并通过 FTP 传输数据。

The client connects only to a specific SSID and Password, and that's why I've been trying to set things up in order to have it working, but since I've made a jump from pre-Android 8 to Android 10 I noticed that most methods and classes that used to manage these connections are either system-only or completely removed.客户端仅连接到特定的 SSID 和密码,这就是为什么我一直在尝试设置以使其正常工作,但是自从我从 pre-Android 8 跳转到 Android 10 之后,我注意到大多数用于管理这些连接的方法和类要么仅用于系统,要么完全删除。

Does anyone know if there's a way to set a specific SSID and Password on WifiManager.LocalOnlyHotspot, or there's some other way to do that?有谁知道是否有办法在 WifiManager.LocalOnlyHotspot 上设置特定的 SSID 和密码,还是有其他方法可以做到这一点? My project basically depends on it and it'd be a shame if we had to change a lot of how interactions works because of these security changes.我的项目基本上依赖于它,如果由于这些安全性更改而不得不更改很多交互方式,那将是一种耻辱。

Thanks for the help everyone!感谢大家的帮助!

I didn't find any universal answer on generic Android Devices, but since I'm using a Company Device I've found that they've implemented some inside libraries that allow these functions, and I've used the DevKit to make 'em.我没有在通用 Android 设备上找到任何通用答案,但由于我使用的是公司设备,我发现他们已经实现了一些允许这些功能的内部库,并且我使用 DevKit 来制作它们.

So, the answer is you either ask the user to turn on the Wi-Fi or redirect them to an redirect page in case they don't have it enabled, or be lucky and have some kind of library that can allow you to do that implemented in your Android OS, if you're working from A8+所以,答案是你要么要求用户打开 Wi-Fi,要么将他们重定向到重定向页面,以防他们没有启用它,或者幸运并且有某种库可以让你这样做如果您使用的是 A8+,则在您的 Android 操作系统中实现

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM