If the tablets support Bluetooth and you need to share data where the tablets are in close proximity then that would be the easiest approach.
An alternative approach where the tablets are on a local network is to use Multicast DNS to discover other devices. This is what Apples Bonjour service uses. The problem with this is that mDNS is not supported on all Android devices.
There is a
mDNS libraryfor Java which would be a starting point.
Otherwise as Erel says you will need some sort of server.