×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    26

    geting a phones IP Address

    hello, i have an application thats connecting to a webservice implemented with ejbs and i would like to keep the phone's ip address in a session bean.

    the problem is how can i get the ip of the phone? does the ip change once connected to the internet?
    i would like to use the ip to later push info the the client.

    thanks alot.

  2. #2
    Super Contributor
    Join Date
    May 2008
    Location
    Helsinki, Finland
    Posts
    1,100

    Re: geting a phones IP Address

    Hi there, kemmal

    Have a look at this thread might provide helpful information: http://www.forum.nokia.com/forum/showthread.php?t=41865


    Best Regards,
    [FONT="Comic Sans MS"][COLOR="Blue"][/COLOR][I]Marko Lumivuori
    Technical Support
    +358 40 8019330
    [email]marko.lumivuori@nokia.com[/email][/I][/FONT]

  3. #3
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: geting a phones IP Address

    the problem is how can i get the ip of the phone? does the ip change once connected to the internet?
    i would like to use the ip to later push info the the client.
    Connection.getLocalAddress() will get you your IP address, which can be localhost if GPRS connection is not active at that time.

    Yes, this address can change when you connect to internet evreytime from different locations while roaming.

    IP based push can work only on some networks like IDEN, where the operators provide fix routeable ips on all other networks these device ips are dyanmic and non-ruoteable hence you cannot initiate connection to them from outside internet world.

    Best is to use SMS based push with PushRegistry.


    thanks,
    ~Amitabh

  4. #4
    Registered User
    Join Date
    Oct 2009
    Posts
    26

    Re: geting a phones IP Address

    thanks alot for the help.

    i took a look at SMS based PushRegistry and i noticed that it operates with sockets. and to my understanding sockets are not always available in every phone.

    is there any way i can asynchronously send a message from the server to a midlet without using sockets?

    (i have a midlet that accesses a webservice, after some time, i would like to asynchronously push info to the midlet, thats what i mean by message)

  5. #5
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: geting a phones IP Address

    Quote Originally Posted by kemmal View Post
    i took a look at SMS based PushRegistry and i noticed that it operates with sockets.
    SMS doesn't operate with sockets. PushRegistry urls can be sms:// (SMS, not sockets), or "socket://" (sockets, but available only between processes running on the same device).

    Quote Originally Posted by kemmal View Post
    is there any way i can asynchronously send a message from the server to a midlet
    Only by using SMS.

    On devices supported sockets (assuming they're suitably configured), you can keep the socket open, probably for some time before it closes itself.

    Otherwise, you'll need to poll the server from the device.

    Graham.

  6. #6
    Registered User
    Join Date
    Oct 2009
    Posts
    26

    Re: geting a phones IP Address

    thanks alot Graham. how about is there any way a webservice can just push text to a midlet without having to poll it?

  7. #7
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: geting a phones IP Address

    It is not a question of the web service. The only technology for sending information to to the phone is SMS.

    Most push email systems, like Microsoft DirectPush, work by opening a socket connection from the device to the server, and keeping it open for as along as possible. Then, when the server needs to send information to the device, there is already a connection open to send it down.

    Graham.

  8. #8
    Registered User
    Join Date
    Oct 2009
    Posts
    26

    Re: geting a phones IP Address

    ok thanks alot Graham.

  9. #9
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: geting a phones IP Address

    The only technology for sending information to to the phone is SMS.
    Apart from Networks that keep live - always on connection with the device like IDEN networks & motorola IDEN device - where we can use push registry on socket.

    Apart from Blackberry - going thu BES server you can send PIN messages to the device and connect directly to device from server.

    And On iphone - use APNS services to send any Push Notification from server to any iphone device.

    thanks,
    ~Amitabh

  10. #10
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: geting a phones IP Address

    Quote Originally Posted by im2amit View Post
    Apart from Networks that keep live - always on connection with the device like IDEN networks & motorola IDEN device - where we can use push registry on socket.
    Nokia only make GSM and CDMA devices, and only a tiny fraction of people even have the option of using iDEN.

    Quote Originally Posted by im2amit View Post
    Apart from Blackberry - going thu BES server you can send PIN messages to the device and connect directly to device from server.
    BlackBerry devices are the only ones that support genuine push. This relies on the BlackBerry infrastruсture, and on using a network that supports BlackBerry services. Again, this doesn't work on Nokia devices.

    Quote Originally Posted by im2amit View Post
    And On iphone - use APNS services to send any Push Notification from server to any iphone device.
    APNS, despite it's name, is not strictly a push technology. Like DirectPush, it works by initiating a socket connection from the device and keeping it open. As I've said, this can be replicated on a Java device, subject to security, device, network and other limitations.

    Graham.

  11. #11
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: geting a phones IP Address

    BlackBerry devices are the only ones that support genuine push. This relies on the BlackBerry infrastruсture, and on using a network that supports BlackBerry services. Again, this doesn't work on Nokia devices.
    I have seen few operators adversting Blackberry services packages for Nokia N95 and E series... is it possible ? any ideas how..

    thanks,
    ~Amitabh

  12. #12
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: geting a phones IP Address

    Yes. You can get BlackBerry Connect software for Symbian and Windows Mobile. This then enables the device to connect with BlackBerry services in the same way as a BlackBerry handset.

    The BlackBerry magic doesn't depend much on the handset (other than having the right software). It mainly depends on the BlackBerry services infrastructure, and the connection it has into the network operators. The network operator must provide the device with a reasonably static IP address, and must maintain a mapping of BlackBerry PINs (unique device identifiers) to IP addresses. Commercial arrangements between RIM (makers of BlackBerry) and the operators allow the BlackBerry infrastructure to find out through which network a device is currently connected, and push data directly into that mobile network.

    Because RIM have direct access into the mobile network, the device doesn't need an internet IP address, just a private address inside the mobile network.

    So, when you push to BlackBerry devices (or other devices with BlackBerry software), you don't push directly to the device. You push to the BlackBerry network (assuming you have the correct contracts with RIM to allow you to do that) and they push it to the mobile network for you (assuming RIM have the right contracts with the mobile network).

    Graham.

Similar Threads

  1. how to determine phone's IP address?
    By xchip in forum Symbian
    Replies: 12
    Last Post: 2008-04-20, 15:24
  2. Help! Help! My IP address is changing like crazy !!
    By jwynn_in_nh in forum Mobile Java General
    Replies: 0
    Last Post: 2003-07-22, 22:10
  3. Nokia 6360i and HTTP with a URL with the IP address instead of hostname
    By stefano_fornari in forum Mobile Java General
    Replies: 0
    Last Post: 1970-01-01, 02:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •