Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1f72eeda03

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

MacAddress plugin for Phonegap (Android)

By Olivier Brand

Adding the Plugin to your project

  1. To install the plugin, move MacAddress.js to your project's www folder and include a reference to it in your html files.

    <script src="MacAddress.js"></script>

  2. Create a folder called 'com/phonegap/plugin/macaddress' within your project's src folder.

  3. And copy the java file into that new folder.
    mkdir -p /src/com/phonegap/plugin/macaddress
    cp ./ /src/com/phonegap/plugin/macaddress
  1. Set the permissions into the Android Manifest for accessing the mac address.
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
  1. Add a plugin line to res/xml/plugins.xml

    <plugin name="MacAddress" value="com.phonegap.plugin.macaddress.MacAddressPlugin" />

Using the plugin

 var networkInterface = {};
 // Get network interface   
 networkInterface = window.plugins.macaddress.getMacAddress();
Something went wrong with that request. Please try again.