Using Android WifiP2p in a Cocos Project

Hey guys !
I’m making this app on android using cocos2d-x (the code is in C++) that needs to use the Wifi P2P feature to transfer data from one tablet to the other.
I’m just confused as to how I can use methods from these APIs within cocos ! I obviously can’t directly code in C++ as I need to use Java, but I can’t go ahead and make a native project, because my game is in C++ and is entirely based on Cocos !
My supposition is that I need to somehow alter Cocos to make it able to handle java classes among a C++ code, and to use the Wifi P2P methods, as well as make the whole thing work as a single app.

Would you guys know what I would need to change in Cocos to make all of this possible, or at least give me a few hints on how Cocos handles the compilation and builld so I can see where I need to add/change things ?

Thanks a lot !

Wifi P2P :
http://developer.android.com/guide/topics/connectivity/wifip2p.html