Traceroute on android

18,680

Solution 1

The simplest way I can think of is to just check for the traceroute Linux application, execute it, and parse its output.

Android has full networking support, however, Java doesn't expose an interface to alter the IP header. Hence, manually crafting ICMP packages is out of the question (JPCAP is no help here, since it relies on libpcap, which I suppose you won't find on any vanilla installation).

Another possible solution is to use the NDK and create a small library that handles the low-level number crunching. However, I'm not sure if the NDK would allow you to use setsockopt.

Solution 2

It's quite late - but someone might see it. i found this one and it worked for me: https://github.com/olivierg13/TraceroutePing

Solution 3

This is working pretty well for me, you may have to filter out the string results. To add this library, you have to download or clone the git repository and implement the folder "library" just as he does in the other module "app" for it to work properly.

Share:
18,680
PiyushMishra
Author by

PiyushMishra

Start-up enthusiast, who love everything related to start-ups. Founder and Co-Founder of 3 startups, with a strong programming background. I’ve been producing and managing large-scale applications across the web and mobile platforms for over a decade now. Expertise: Product Management, Project Management, Agile Development, Business Development, Strategic Partnerships, People Management, SEA Expansion for start-ups Skilled in Requirements Analysis, Scale-up the business, Project execution, Costing, Business Management, Java, C++, Android, iOS Mobile Applications, React Native, Python, Machine learning. Responsible to build the projects from scratch and convert into running a business. A strong business development professional, who knows the pulse of the market with a B.tech focused in Electronics and Telecommunication from IETE.

Updated on June 20, 2022

Comments

  • PiyushMishra
    PiyushMishra almost 2 years

    I am a beginner on android platform, and I want to build a tracerouting app. So these are my queries:

    1. Is it possible to make such an application in Android? if possible then guide me the way that I follow.

    2. Does Android support low-level programming to capture ICMP packets? or do I need to add some kind of JAR (in java) or some other libraries to support this application?

    3. In Java, there are JPCAP and docjar etc kind of libraries that we can import in our IDE or Eclipse so that Java support for making such kind of API's?

    I need valuable suggestions.

  • pamatt
    pamatt over 10 years
    Try and not post answer that are entirely in a link, because the content of your link may change. At the very least, you should try to post here some useful guideline to answer the question. Thanks.
  • Hanzala
    Hanzala over 7 years
    This library is not working in Samsung S4 5.0 will you help me
  • Hanzala
    Hanzala over 7 years
    will give an exapmle