Solved

j2me ip show

Posted on 2006-07-18
3
218 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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This is an explanation of a simple data model to help parse a JSON feed
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now