traceroute on android


Last Updated:

  1. loveyoucrazy

    loveyoucrazy New Member This Topic's Starter

    Joined:
    Aug 3, 2010
    Messages:
    3
    Likes Received:
    0
    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

    Joined:
    Jul 29, 2010
    Messages:
    18
    Likes Received:
    1
    You need to have root access.
     
  3. piyushmishra10@gmail.com

    piyushmishra10@gmail.com New Member

    Joined:
    Nov 17, 2010
    Messages:
    3
    Likes Received:
    0
    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

    Joined:
    Dec 26, 2010
    Messages:
    1
    Likes Received:
    0
    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...