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?
As was already suggested, sockets are the easiest way to accomplish this if your devices are all connected to a network.
There are things to accomplish here:
For a complete tutorial you can check this out
You have several options, depending on your requirements and setup:
you can use PubNub. it handles all networking and you should only care about messages. it has great API to work.
(Thanks to @Ian Jennings : Can we send data from an android device to another android device directly (p2p) without server in the middle?)
You can connect them via bluetooth using BluetoothSockets. Android developer website has pretty good documentation on this.
http://developer.android.com/guide/topics/wireless/bluetooth.html
Or if you'd rather (and have internet on both devices), you can use regular Socket's.
http://developer.android.com/reference/java/net/ServerSocket.html for server side http://developer.android.com/reference/java/net/Socket.html for client side
If you have a large amount of data to transfer, internet sockets have a greater data capacity and will be faster. The other advantage is that there is no such thing as "out of range". You can connect the two devices wherever internet is available, whereas with bluetooth they have to be within bluetooth range of each other
Depends on what you are doing. If you have a server, you may be able to send some message to it and have it pulled by the other device (assuming both clients have the app installed). I think this would be the most intuitive way (but it really depends on what you are communicating).
Text messaging and email might work, but you (or the user) needs to know the numbers/emails associated with a device to do that.
you should have a look at WifiDirect
Wi-Fi peer-to-peer (P2P) allows Android 4.0 (API level 14) or later devices with the appropriate hardware to connect directly to each other via Wi-Fi without an intermediate access point.