我正在开发一个基于android的应用程序,它将在紧急情况或灾难情况下使用,以帮助用户安全撤离。因此,在这方面,我需要在特定地区的用户之间建立一个网状网络。我得用临时模式才能做到这一点。
发布于 2016-02-05 12:43:16
您可能正在寻找的协议不被方便地标记为“ad”,它被称为"Wifi P2P":
文档:developer.android.com/guide/topics/connectivity/wifip2p.html
WifiP2pManager mManager;
Channel mChannel;
BroadcastReceiver mReceiver;
...
@Override
protected void onCreate(Bundle savedInstanceState){
...
mManager = (WifiP2pManager) getSystemService(Context.WIFI_P2P_SERVICE);
mChannel = mManager.initialize(this, getMainLooper(), null);
mReceiver = new WiFiDirectBroadcastReceiver(mManager, mChannel, this);
...
}
//obtain a peer from the WifiP2pDeviceList
WifiP2pDevice device;
WifiP2pConfig config = new WifiP2pConfig();
config.deviceAddress = device.deviceAddress;
mManager.connect(mChannel, config, new ActionListener() {
@Override
public void onSuccess() {
//success logic
}
@Override
public void onFailure(int reason) {
//failure logic
}
});希望这能有所帮助
发布于 2017-02-09 22:35:10
有一个Meshkit https://www.opengarden.com/meshkit.html,它是一个创建Mesh网络的框架。他们有一个很好也很有名的应用程序,名为"firechat“https://www.opengarden.com/firechat.html,作为”概念的证明“
AFAIK,它不是开源的。
发布于 2017-02-22 16:10:13
我发现类似的想法已经在谷歌商店发布,那就是光束化。也许你可以联系他们了解一些想法。
https://stackoverflow.com/questions/35223943
复制相似问题