Results 1 to 5 of 5

Thread: How to Retrieve IP address of a mobile phone

  1. #1
    Join Date
    Feb 2009
    Posts
    62

    How to Retrieve IP address of a mobile phone

    Hello,

    I have very Genuine Question, as we get connected to the internet through computer at that time we send our IP Address of a machine over internet, if I am accessing internet through Mobile phone so that can we retrieve the IP Address of a Mobile phone? is Mobile phone have an IP address? and which IP address do we get?

    Surely it is difficult, please try to solve.

    Thank you

  2. #2
    Join Date
    Nov 2008
    Posts
    118

    Re: How to Retrieve IP address of a mobile phone

    This is the recurring question. The final answer is of course, listing them all using the following code:

    Code:
    // - assumes socket is already Open
    // - allocate from heap, because this is large structure
    TSoInetInterfaceInfo *inf = new TSoInetInterfaceInfo;
    if (inf == NULL)
      return KErrNoMemory;
    TPckg<TSoInetInterfaceInfo> opt(*inf);
    TInt err = socket.SetOpt(KSoInetEnumInterfaces, KSolInetIfCtrl);
    if (err == KErrNone)
     {
     while (socket.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, inf) == 
    KErrNone)
       {
       if (inf().iAddress.IsUnspecified())
         {
         // Interface inf().iName has no address
         }
       else
         {
         // interface inf().iName has address inf().iAddress
         }
       }
     } 
    delete inf;
    Now, the question is which one do you use? When no interfaces are up, you only see the loopback addresses ("::" and 127.0.0.1).

    Other addresses are only defined when one or more interface is up.

    An interface can have multiple addresses.

    If your application is such that it actually connects to something, connecting does not need the knowledge of own address. After connect has been succesfull, you can find the correct address from the connected socket.

    If you are doing server application, you don't need to know your address either. Just use unspecified address. Of course, your server will not see anything from outside until some interface is up.

  3. #3
    Join Date
    Feb 2006
    Posts
    331

    Re: How to Retrieve IP address of a mobile phone

    You can send sms from your application by subscribing to one of the sms service provider like www.abtxt.com and implementing the API they provide in our application ..and for IP address you can use this link to retrieve

    xmlHttp.open("GET","http://api.hostip.info/?ip="+ip,true,null,null);
    xmlHttp.send(null);

  4. #4
    Join Date
    Apr 2008
    Posts
    117

    Re: How to Retrieve IP address of a mobile phone

    It was tricky to get the local IP address of the phone when using TCP, but not due to the complexity of the API method (it was something like RSocket::LocalAddress), but the timing. When RGenericAgent returned saying that "okay, connection is up", I still had to wait for a while until it was really up. Figuring out that "while" was tricky, when - as far as I remember, at least - it turned out that we had to wait for a special state change in the connection.

  5. #5
    Join Date
    Sep 2009
    Posts
    1

    question Re: How to Retrieve IP address of a mobile phone

    Couldn't you just access the internet from your mobile device and go to a site like: whatismyip.com
    ???
    That should display it one would think? Not sure don't really use phone for internet. Let me know if this works though I'm interested in this also
    Cheers


Similar Threads

  1. IP address of a GPRS mobile Phone
    By Strangers in forum Portable Devices
    Replies: 4
    Last Post: 23-11-2010, 06:03 AM
  2. MAC Address on Windows Mobile 6
    By Patricia-USA in forum Portable Devices
    Replies: 6
    Last Post: 10-06-2010, 03:27 AM
  3. Unable to retrieve MSN address book
    By Andre neil in forum Technology & Internet
    Replies: 3
    Last Post: 05-05-2009, 07:23 PM
  4. Retrieve the IP address
    By Holt in forum Networking & Security
    Replies: 2
    Last Post: 10-01-2009, 07:58 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,151,307.83991 seconds with 17 queries