How to do :cross-platform mobile local area network programming

I want to develop a cross-platform mobile(ios/Android) local network programming with wifi or bluetooth.
If I don’t want to use libcurl and web server, how to do?
Can the bonjour technology build it?

I try the android sample project from https://github.com/twitwi/AndroidDnssdDemo, it use jmdns & Bonjour,
and I use two android device,but the two device can’t find each other in DNS list.

If use GameCenter only for ios,it can’t use in Android.