Traceroute on android

ε祈祈猫儿з 提交于 2019-12-03 20:19:25

问题


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

  1. Is it possible to make such 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.


回答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.




回答2:


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



来源:https://stackoverflow.com/questions/4203374/traceroute-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!