androidc++android-ndkwifip2p

Is native C++ WiFi P2P networking possible on Android Devices?


My current Android project requires the ability to set up a "local" p2p network on neighbouring devices using some flavour of WiFi (e.g. WiFi, WiFi Direct, WiFi Aware etc..)

Having tried the Android API's (and being unable to find any devices that support Aware) I have failed in being able to deliver a reliable application that can auto detect neighbouring devices and establish a usable p2p network.

The approaches I have tried include "Create P2P connections with Wi-Fi Direct", "Connect devices wirelessly" and "Nearby Connections"

None of these approaches (or any combination) provide a reliable, repeatable method for automatically establishing a p2p network.

I do not believe this is a difficult problem space and I do not understand why it seems impossible to establish a reliable p2p network between neighbouring devices.

I have been searching for alternative approaches one of which is using native C++ code to achieve the desired result.

As I have no experience with Android NDK this decision is proving challenging.

I cannot find any Android C++ WiFi example(s)/tutorial(s) etc..

Is it possible to employ C++ on Android for WiFi applications?

Am I forced to use the High Level Android WiFi API's?


Solution

  • No, there is no shortcut through NDK to WiFi features of your device, unless you can acquire root permissions. The underlying problem will not go away even then, it will only be worse. The C++ implementations of WiFi are even less standardized across devices and platform versions than the different vendor-backed flavours you are talking about.