Solved

j2me ip show

Posted on 2006-07-18
3
228 Views
Last Modified: 2008-02-01
i am using my mobile phone to connect to internet (gprs) from my laptop. i want to write a small java application for my mobile phone that shows my ip adress when it is executed. is this possible? if yes, any ideas for the code?
0
Comment
Question by:leventsatriani
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Accepted Solution

by:
bpmurray earned 500 total points
ID: 17130987
If you're using MIDP 1.0 you're out of luck, but 2.0 allows some access to that side of things. The reality is that you're probably behind your provider's Cone NAT, so you don't have much control over anything. Anyway, you should expect to have to manage a dynamically -assigned IP address. Anyway, there are two places where you might be able to find this based on the app that's running. Starting from the interfaces UDPDatagramConnection or ServerSocketConnection, there are the methods getLocalAddress and getLocalPort which should give you what you need.

Watch out, though: the IP address may be reassigned, so you can't depend on this address being permanent. I wonder when the providers will learn about IPv6!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to call a web service and get the results posted in a form in PHP 9 98
asp Google Map 2 92
statistics basics sources 2 74
junit initializtion error 2 21
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question