Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

checking for internet connectivity

 
Greg Schwartz
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know what code to use (MIDP 1.0 preferably) to check for internet connectivity on a Nokia or Sony Ericsson phone before trying make an HTTP connection?

When I use the following code, an exception is never thrown when I have my handset's internet connection turned off:


Thanks!
Greg
 
Yuri Magrisso
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to request the result code or to open the input stream. From my experience the phone does not try to establish connection before you call getResponseCode or getInputStream.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic