Solved

j2me ip show

Posted on 2006-07-18
3
225 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
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

792 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