Wifi direct / wifi p2p / ad hoc

walmo

Active Member
Licensed User
Longtime User
Hi
Looking for a library that can do what this app does ..
It starts the wifi direct connection as a hotspot(access point). Leaving the normal wifi connection to connect to another hotspot.(works like a wifi repeater)

Make your price if you can do this.
Thanks
 

DonManfred

Expert
Licensed User
Longtime User
Looking for a library that can do what this app does ..
WHAT exactly does the App? WHICH libraries is the app using exactly? Without not knowing that noone can do it/help here.

The app source is not available. It is compiled in Obfuscated mode.

Find a Githubproject which DOES EXACTLY what you want and post the Github url so anyone who is interested to help can check the Github project and evaluate to write a wrapper.

I do not know anything of this app.... As written above; without knowing which library EXACTLY you need to get wrapped no one can help.
The app source is not available to look at.
 
Last edited:

walmo

Active Member
Licensed User
Longtime User
Hi DonManfred

I need something like this, found the same idea on google .
Question posted -

Can I connect a WiFi Direct enabled device to any other device which doesn't have WiFi Direct feature but supports WiFi hotspot connection? Does WiFi direct uses specialized hardware to be present on both devices? Will network discovery work in such cases?


Answer posted -

It is possible. Code taken from a talk I gave at Droidcon UK 2013.
You need to call the createGroup(WifiP2pManager.Channel c, WifiP2pManager.ActionListener listener) method of the WifiP2pManager class. This will create a Wi-Fi Direct group that supports legacy Wi-Fi connections.
 

walmo

Active Member
Licensed User
Longtime User
Here is above answer code.

wifi:
BroadcastReceiver receiver = new BroadcastReceiver() {
    [USER=69643]@override[/USER]
    public void onReceive(Context context, Intent intent) {
        if(intent.getAction().equals
            (WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION)){
            wifiP2pManager.requestGroupInfo(channel,
                new WifiP2pManager.GroupInfoListener() {
                [USER=69643]@override[/USER]
                public void onGroupInfoAvailable(WifiP2pGroup group) {
                    if(group != null){
                        // clients require these
                        String ssid = group.getNetworkName(),
                        String passphrase = group.getPassphrase()
                    }
                }
            });
        }
    }
};
 

walmo

Active Member
Licensed User
Longtime User
And this one ...
C:
if (WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION.equals(action)) {
    NetworkInfo networkInfo = intent.getParcelableExtra(WifiP2pManager.EXTRA_NETWORK_INFO);
    WifiP2pInfo wifiP2pInfo = intent.getParcelableExtra(WifiP2pManager.EXTRA_WIFI_P2P_INFO);
    if (networkInfo.isConnected() && wifiP2pInfo.groupFormed) {
            if (wifiP2pInfo.isGroupOwner) {
                wifiP2pManager.requestGroupInfo(channel, new WifiP2pManager.GroupInfoListener() {
                    @Override
                    public void onGroupInfoAvailable(final WifiP2pGroup wifiP2pGroup) {
                        if (wifiP2pGroup != null) {
                            // clients require these
                            String ssid = wifiP2pGroup.getNetworkName();
                            String passphrase = wifiP2pGroup.getPassphrase();
                            ...
                        }
                    }
                }
            }
        }
    }
}
...
 

DonManfred

Expert
Licensed User
Longtime User
Can I connect a WiFi Direct enabled device to any other device which doesn't have WiFi Direct feature but supports WiFi hotspot connection? Does WiFi direct uses specialized hardware to be present on both devices? Will network discovery work in such cases?
I´ll NOT discuss anything in the Jobforum. I do not know the answer at all.
It is possible. Code taken from a talk I gave at Droidcon UK 2013.
You need to call the createGroup(WifiP2pManager.Channel c, WifiP2pManager.ActionListener listener) method of the WifiP2pManager class. This will create a Wi-Fi Direct group that supports legacy Wi-Fi connections.
Where is the link to a Githubproject which does exactly what you want? Do not expect me to understand the hole flow based on the few snippets you posted.

Wifip2p is already available if i recall correctly.
Isn´t it in the WifiDirect library?
 

DonManfred

Expert
Licensed User
Longtime User
I did found a old project on my HDD which i wrote in 2018 (and did not recall 😂 😂 😂)

Maybe it helps

Don´t know if it is working all what is implemented. Do not expect it will. As i never released this library i guess it is missing something or more than only something :D
 

Attachments

  • wifip2pex.zip
    10.7 KB · Views: 250
  • WifiP2PV0.1.zip
    15.6 KB · Views: 213
Last edited:
Top