我想使用 Android Things (5.1) 和几个 Raspberry Pi 3 或使用蓝牙创建一个 P2P WiFi 网络。我遵循了 Android Developer 部分中的指南 https://developer.android.com/guide/topics/connectivity/wifip2p.html ,所以我的 MainActivity 看起来像: private class MainActtivity {
private WifiP2pManager mManager;
....
@Override
public void onCreate(Bundle savedInstances) {
mManager = (WifiP2pManager)
getSystemService(Context.WIFI_P2P_SERVICE);
....
}
}
但是,当我尝试在启用 WiFI 的情况下运行该应用程序时,SystemServiceRegistry 会显示一条消息,说明
No service published for: wifip2p并且未检索到 WifiP2pManager。
我该如何解决这个问题?有人知道是否可以使用 WiFi Direct 和 Android Things 创建 WiFi P2P 网络?
最佳答案
截至目前(Android Things 稳定版 1.0)RPI3B 不支持 WifiP2P,因此尝试使用 Google NearBy 2.0 API作为替代方案,我认为它会满足您的需求。
关于bluetooth - Android Things 中的 WiFi P2P 网络,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47547864/