• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GPRS and servlets

 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider this...

A mobile phone is on the internet through GPRS and sends data to a servlet by invoking it through a URL say www.blah.com\blalet. The servlet accepts the data and then saves the data. Now... is it possible for this servlet to contact this mobile phone later to send some data to the phone ? Let us assume that the mobile phone has a J2ME application running that is listening on a port. My question is if it is possible for the servlet to contact the phone... how exactly would it go about doing it ? Does the mobile acquire an IP address when it connects to the internet !? Can the mobile phone uniquely identify itself on the web ? Does the dynamic IP address scheme apply to mobile phones ? Do IP addresses apply to mobile phoes ? Arrggghhh so many questions.
 
Eduardo Marques
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The MIDP API defines UDP datagram connections, TCP/IP socket connections
and SSL connections, that may be implemented by devices
apart from HTTP / HTTPS (but the later two may be WAP
based for example instead of IP-based).
So, yes, a mobile phone can be IP-aware.

But in terms of design, I think you should consider
the phone app to query the web service regularly
instead of trying to send a notification the other way round.
You see, apart from considering that the IP is dynamic,
you must account that the phone's connection is not permanent.

So it looks like a more workable design to have the phone contact
your server when it is online (and maybe poll it regularly)
rather than the server checking if the phone is online and what it is its IP.

Regards,
Eduardo
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is precisely what i was thinking of as an alternative, ask the server every now and then if there is any data to send. That solves that. thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic