Posts Tagged ‘Snippet’

Android: Howto find the hardware MAC address of a remote host

Monday, February 7th, 2011

I recently needed to find the MAC address of a remote host in my LAN by its IP address.

Unfortunately, Java/Android does not offer an API to find a MAC address by IP. :-(
The DatagramPacket class does not reveal this information for the source host, either.

But Android is Linux, and hence we can try to find the MAC by accessing the ARP cache information!

(more…)

If you like my work, buy me a beer. (Suggested: 3€ for a beer, or more for more beer ;-) )