Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connecting two mobiles through socket connection

 
Harish Tiruvile
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Is it possible to connect two mobile\cellphones using socket connection(similar two one that we can do between two PC)

To establish socket connection ,I need IP address and a port .

i should assign IP address for each mobile ...Based on IP address i can identify the Mobile ..

Question:
1)Can i establish socket connection between
(a)Mobile - Mobile
(b)PC - Mobile
(c)Mobile - PC (i know this is possible,but i have doubt about a & b)

Suppose if we can establish socket connection between PC and Mobile can any one assist me in setting IP address and port .
 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
It is possible create a socket connection using the SocketConnection class in the GCF. But if you want to connect a PC to a mobile through socket connection, it will be a problem, cause it is a server push. You can use the PushRegistry to push data from the server to the phone. According to my knowledge it is not possible to configure a IP address to a phone, you will get one when you connect through GPRS. Hope this information helps you. Regards.
 
Eduardo Marques
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As long as two devices (PC or mobile) have IP addresses, they can be connected through SocketConnection or ServerSocketConnection on the J2ME side; whatever socket API you use on the PC.

ServerSocketConnection and Push Registry can be combined so that a MIDlet is started in response to an incoming socket connection on a specified port.

There is no standard way for assigning an IP to a mobile, it should be the one you get through GPRS. It is normally best to have the mobile contact a known server (ie the one you want) first to acknowledge its presente.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic