Android Port

1 reply [Last post]
alex-unstable
Offline
Joined: 08/24/2010

Hello Mark

I'm searching for a port of jNetPcap for Android devices but I don't think it exists yet. Despite libpcap is actually included in the tree, there isn't a simple, straightforward way in the SDK of accessing the data, so I think it'd be a great achievement for everybody to get your library running on Android.

So far, I've been surfing the internet and found you were also looking for that some months ago as I could understand by reading a discussion in the android-ndk mailing list. I'd be very interested in working on this too and thought you may know the way to accomplish this.

As far as I know all that's needed is cross-compiling the jni part of the project against an arm target to obtain a libjnetpcap.so that runs on Android. Then one could include the jar in the project and use the API *almost* transparently from the app. At this moment I'm trying to create an Android.mk and and a config.h for the library as explained in http://warpedtimes.wordpress.com/2010/02/03/building-open-source-librari..., but I haven't succeeded so far (working on that).

My question is: Did you do some deeper research on this? If so, could you point me in the right direction to get the same result? If you don't, what do you think it'd be the best way to get this done?

Many thanks in advance.

--Alex

Mark Bednarczyk
Mark Bednarczyk's picture
Offline
Joined: 03/22/2008
I inquired about this myself

I inquired about this myself a while ago. I do have a android dev phone and I have written apps for it. I have not tried using the NDK yet and when I asked I was told that I would not be able to port jnetpcap using the NDK for some reasons I don't recall anymore. So I dropped the issue. Of course the platform continues to develop so that may change in the future.

No I didn't not go into it any deeper then that. I'd love for someone to figure out how to do it and I'm sure we could add that into our build environment. jNetPcap uses gcc exclusively to compile so cross-compiling should be easy to ARM processor. It is android is linux underneath. I don't think there would be any issues with Dalvik JVM. Processors are getting powerful enough to handle packet capture and processing on the mobile devices.

Update:

Looking at one of the engineers reply to my questions (here), he states that libpcap does not support live captures and the main problem is with root access. You would need to root your phone in order to run this. This may be ok for starters and may be later we can figure out how to do it without root access. But if all we get with libpcap is offline captures, then pure java http://jnetstream.com may be a better fit for this. It already supports processing various capture file format and has extensive editing capabilities in java. To me not having the live-capture is the killer.

Sly Technologies, Inc.
R&D

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.