File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Android and the fly likes InetAddress isReachable Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Mobile » Android
Reply Bookmark "InetAddress isReachable" Watch "InetAddress isReachable" New topic
Author

InetAddress isReachable

Niklas Andersson
Greenhorn

Joined: Feb 09, 2012
Posts: 2
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

Joined: Oct 12, 2008
Posts: 1365

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.


[List of FAQs] | [Android FAQ] | [My Blog] | [Samuh Varta]
Niklas Andersson
Greenhorn

Joined: Feb 09, 2012
Posts: 2
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...
 
 
subject: InetAddress isReachable
 
Threads others viewed
Socket reuse and security
SSL Communication between Java and VC++
Inter-process communication between two JVMs
Android Emulator as server in Socket communication
socket's http connection
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture