Having 2 phones communicate is the same as having 2 programs communicate (at the moment, as there is no bluetooth yet ), use java socket programming and a network(/internet) server or a on phone server or p2p system.