What is the best way for an Android app installed on two devices to communicate with each other? Can the devices connect directly without using text messaging?
ShortAnswer: Yes
Data can be sent directly.
In order of range: 1 Bluetooth 2 wifidirect 3 maybe.. GSM hardware direct?
After that, options again in range order: 4 tether or network 5 Internet
The android NSD API is meant to do the exact same thing you are trying to achieve! The example bundled with SDK is self explanatory!
please check:
Android NSD API example