• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Phone to phone/emulator comminication

Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello what i am doing is creating a program that will let me allow two android phones to communicate over TCP. The code that I have is



The problem is when I run the client on the emulator and then the server on the phone the client produces the following error. Note the server is running first and both programs have Internet permissions in the mainifest.

My aim is to use two phone where a phone is the server and the client is also on a phone. Any help would be much appreciated.
Saloon Keeper
Posts: 27882
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your first problem is that the "server" phone probably won't have a unique public tcp/ip address. When you're networking via the phone company's over-the-air service, they frequently use DHCP to allocate out of one or more of the private ip address pools.

Assuming, however, that you overcame that problem, you still can expect that there's a fairly serious firewall built into the phones themselves. Phones make very good targets, and there have already been incidents of exploits such as "bluejacking" phones at airports and other public places.

To reliably get 2 phones to converse, you'd need an intermediary that they both could contact. Kind of like Adobe's Acrobat conferencing tool.
Lasagna is spaghetti flvored cake. Just like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
    Bookmark Topic Watch Topic
  • New Topic