3

I am working on an android based application, which will be used in the emergency or disaster situations to help the user, which path to follow to evacuate safely. Therefore, in this regard I need to establish a mesh network between the users in a particular area. I have to work on ad-hoc mode to make it possible.

Ahmed Qayyum
  • 129
  • 1
  • 10

3 Answers3

0

The protocol you may be looking for is not conveniently labeled "ad-hoc", it's called "Wifi P2P":

Documentation: 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
    }
});

Hope this helps

Aaron Gillion
  • 2,071
  • 3
  • 17
  • 29
  • Actually it needs the device to be rooted to enable the ad-hoc mode. And I don't want to make changes in the source code of the Wi-Fi chipset. I just want to know, if you an help me to enable the ad-hoc mode through SPAN Framework. – Ahmed Qayyum Feb 05 '16 at 14:01
  • Yeah, unfortunately SPAN is just a concept, no documentation on Google, unless you can find a link somewhere. – Aaron Gillion Feb 05 '16 at 14:12
  • Wi-Fi P2P (now known as Wi-Fi Direct) does **not** support ad hoc (multi-hop) routing. – Bora M. Alper Dec 01 '17 at 13:17
0

There is the Meshkit https://www.opengarden.com/meshkit.html which is a Framework to create Mesh Networks. They have as "proof of concept" a good and quite famous app, named "firechat" https://www.opengarden.com/firechat.html

AFAIK, it is not open source.

VP.
  • 5,004
  • 6
  • 42
  • 69
0

I found similar idea which already published on google store ,namely Beamify. Perhaps you can contact them to get some idea.

  • Link-only answers are generally discouraged. Could you summarise the content of the link and how it applies to the question? – ymbirtt Feb 22 '17 at 16:36