• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

InetAddress isReachable

 
Niklas Andersson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
YO

InetAddress.isReachable only finds localhost

is there a solution to this?
google have not been kind too me...


i have also tried to create a Socket
but when i do
new Socket(address, port);
i get SocketTimeOutException

could there be a connection?

and i do have
<uses-permission android:name="android.permission.INTERNET" />
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Niklas: what exactly are you trying to do? Are you trying to check if a certain IP is reachable from your phone?
From what I have heard, InetAddress#isReachable() might not work as one might expect.
 
Niklas Andersson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Monu Tripathi wrote:Niklas: what exactly are you trying to do? Are you trying to check if a certain IP is reachable from your phone?
From what I have heard, InetAddress#isReachable() might not work as one might expect.


basicly
was trying to to find a way to ping an ip with random data

used that with my first attemt to get it to work

right now im starting a new process with the phones existing ping
and processing the output for the information


if you create a InetAddress from string address "www.google.com" for example
the InetAddress will have the correct IP
since that works i dont really understand why
isReachable() does not...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic