MAC address from NDK

2,098 views
Skip to first unread message

Oceanblue

unread,
Feb 14, 2011, 10:18:18 AM2/14/11
to android-ndk
Hi folks,

I need to get the MAC address from the NDK layer. I know how to do it
from the java layer, but because of design requirements, I need to get
it from within the C program (called by the JNI layer).

Could anyone please help me?

Thanks!

Igor R

unread,
Feb 14, 2011, 10:28:34 AM2/14/11
to andro...@googlegroups.com
> I need to get the MAC address from the NDK layer. I know how to do it
> from the java layer, but because of design requirements, I need to get
> it from within the C program (called by the JNI layer).

Use getifaddrs() function.
http://www.kernel.org/doc/man-pages/online/pages/man3/getifaddrs.3.html

Oceanblue

unread,
Feb 14, 2011, 1:03:53 PM2/14/11
to android-ndk
Igor,

Thanks for your reply.

Using this function, requires including ifaddrs.h, and my NDK/arch-arm/
usr/include does not seems to contain this header file. Could I still
use it, getting either the header file from somewhere or using another
header file?

(I'm using Ubuntu, NDK r5)

Thanks!

İsmail Dönmez

unread,
Feb 14, 2011, 1:09:45 PM2/14/11
to andro...@googlegroups.com
Have a look at https://groups.google.com/forum/#!topic/android-ndk/3JIvD0PFaU4

ismail
> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages