1. Check out our app, Forums for Android! Download and leave feedback here!

traceroute on android

Discussion in 'Application Development' started by loveyoucrazy, Aug 3, 2010.

  1. loveyoucrazy

    loveyoucrazy New Member
    Thread Starter
    5

    Aug 3, 2010
    3
    0
    5
    Hi guys,
    I tried to launch traceroute and capture its output in my android app, but I got an IOException, even if I type the command in android's console, it says permission is denied. Any one knows how to solve the problem? Thanks~
     

    Advertisement

  2. DiscGolfer17

    DiscGolfer17 Member
    16

    Jul 29, 2010
    18
    1
    16
    You need to have root access.
     
  3. piyushmishra10@gmail.com

    25

    Nov 17, 2010
    3
    0
    25
    I also want to work on this API but i have following quires to discuss with you.

    Actually java didnt support low level programming, mean we can capture the UDP packets but to deal with ICMP java didnt support it well for this we have to import external libraries in java case its JPCAP or many available, So my question is : In android is there any kind of inbuilt library to support in capturing the packets or we have to import any external library, if yes then please tell me the library name.

    thanks :)
     
  4. pweltz

    pweltz New Member
    5

    Dec 26, 2010
    1
    0
    5
    IMHO the problem is not with the Java API. Even if you try to use the NDK/ C socket API, you can't create yourself ICMP packets, because you can't create a socket SOCK_RAW. You need to be root for that. In UNIX/Linux you can execute ping/traceroute thanks to the SETUID bit on the commands (i.e. they run as 'root'). In Android as far as I tested, you can run the 'ping' command, but not 'traceroute' (denied)... It is up those building the OS (google/the operators/the manufacturers) to authorize this I suppose...
     

Share This Page

Loading...