I would like to develop an J2ME application that you use Push Registry. I need start the application from a Socket Connection...
But to my server connect using socket in my device, I need to know the device IP adddress, how can I get it?
Joined: Feb 19, 2005
This should be moved to the J2ME forum.
Anyway, to know the phone's IP use method getLocalAddress() in ServerSocketConnection (or SocketConnection)
Also, according to the MIDP specs "The local hostname (if available) can be accessed from System.getProperty("microedition.hostname")"
Anyway, you may have a problem if the phone's IP changes over time. A possible solution to overcome this may be having your J2ME app register its IP regularly so that clients can contact you later, ie some kind of server registry mechanism. [ March 21, 2007: Message edited by: Eduardo Marques ]