title: phonegap plugin not working - connection undefined
body: <p>According to the <a href="https://build.phonegap.com/plugins/626">phone gap docs</a> I should be able to add the network cocnnection plugin by simply adding <code>&lt;gap:plugin name="org.apache.cordova.network-information" /&gt;</code> to <code>config.xml</code> </p>
  
  <p>I'm using the <a href="https://github.com/apache/cordova-plugin-network-information/blob/cd67d7a30f51efe7b2e3adb098ae65409d292d21/doc/index.md">example js function</a> to test the connection and it does not seem to work. LogCat is showing <strong>'cannot read property 'type' of undefined'</strong> which makes me think the plugin was never added.</p>
  
  <pre><code>function checkConnection() {
  var networkState = navigator.connection.type;
  
  var states = {};
  states[Connection.UNKNOWN]  = 'Unknown connection';
  states[Connection.ETHERNET] = 'Ethernet connection';
  states[Connection.WIFI]     = 'WiFi connection';
  states[Connection.CELL_2G]  = 'Cell 2G connection';
  states[Connection.CELL_3G]  = 'Cell 3G connection';
  states[Connection.CELL_4G]  = 'Cell 4G connection';
  states[Connection.CELL]     = 'Cell generic connection';
  states[Connection.NONE]     = 'No network connection';
  
  alert('Connection type: ' + states[networkState]);
  </code></pre>
  
  <p>}</p>
  
  <p><strong>config.xml:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;widget xmlns   = "http://www.w3.org/ns/widgets"
      xmlns:gap   = "http://phonegap.com/ns/1.0"
      id          = "#myapp#"
      versionCode = "10" 
      version     = "1.0.0" &gt;
  
  &lt;!-- versionCode is optional and Android only --&gt;
  
  &lt;name&gt;#myapp#"&lt;/name&gt;
  
  &lt;description&gt;
      #myapp#"
  &lt;/description&gt;
  
  &lt;author href="#myapp#"" email="#myapp#""&gt;#myapp#"&lt;/author&gt;
  </code></pre>
  
  <p>
      </p>
  
  <pre><code>&lt;!-- Customize your app and platform with the preference element. --&gt;
  &lt;preference name="phonegap-version"           value="3.1.0" /&gt;          &lt;!-- all: current version of PhoneGap --&gt;
  &lt;preference name="orientation"                value="default" /&gt;        &lt;!-- all: default means both landscape and portrait are enabled --&gt;
  &lt;preference name="target-device"              value="universal" /&gt;      &lt;!-- all: possible values handset, tablet, or universal --&gt;
  &lt;preference name="fullscreen"                 value="false" /&gt;           &lt;!-- all: hides the status bar at the top of the screen --&gt;
  &lt;preference name="prerendered-icon"           value="true" /&gt;           &lt;!-- ios: if icon is prerendered, iOS will not apply it's gloss to the app's icon on the user's home screen --&gt;
  &lt;preference name="ios-statusbarstyle"         value="black-opaque" /&gt;   &lt;!-- ios: black-translucent will appear black because the PhoneGap webview doesn't go beneath the status bar --&gt;
  &lt;preference name="detect-data-types"          value="true" /&gt;           &lt;!-- ios: controls whether data types (such as phone no. and dates) are automatically turned into links by the system --&gt;
  &lt;preference name="exit-on-suspend"            value="false" /&gt;          &lt;!-- ios: if set to true, app will terminate when home button is pressed --&gt;
  &lt;preference name="auto-hide-splash-screen"    value="true" /&gt;           &lt;!-- ios: if set to false, the splash screen must be hidden using a JavaScript API --&gt;
  &lt;preference name="disable-cursor"             value="false" /&gt;          &lt;!-- blackberry: prevents a mouse-icon/cursor from being displayed on the app --&gt;
  &lt;preference name="android-minSdkVersion"      value="14" /&gt;              &lt;!-- android: MIN SDK version supported on the target device. MAX version is blank by default. --&gt;
  &lt;preference name="android-installLocation"    value="auto" /&gt;           &lt;!-- android: app install location. 'auto' will choose. 'internalOnly' is device memory. 'preferExternal' is SDCard. --&gt;
  &lt;preference name="splash-screen-duration"     value="10000"/&gt;
  
  
  &lt;!-- Plugins --&gt;
  
  &lt;!-- Core plugins
  &lt;gap:plugin name="org.apache.cordova.battery-status" /&gt;
  &lt;gap:plugin name="org.apache.cordova.camera" /&gt;
  &lt;gap:plugin name="org.apache.cordova.media-capture" /&gt;
  &lt;gap:plugin name="org.apache.cordova.console" /&gt;
  &lt;gap:plugin name="org.apache.cordova.contacts" /&gt;
  &lt;gap:plugin name="org.apache.cordova.device" /&gt;
  &lt;gap:plugin name="org.apache.cordova.device-motion" /&gt;
  &lt;gap:plugin name="org.apache.cordova.device-orientation" /&gt;
  &lt;gap:plugin name="org.apache.cordova.dialogs" /&gt;
  &lt;gap:plugin name="org.apache.cordova.file" /&gt;
  &lt;gap:plugin name="org.apache.cordova.file-transfer" /&gt;
  &lt;gap:plugin name="org.apache.cordova.geolocation" /&gt;
  &lt;gap:plugin name="org.apache.cordova.globalization" /&gt;
  &lt;gap:plugin name="org.apache.cordova.inappbrowser" /&gt;
  &lt;gap:plugin name="org.apache.cordova.media" /&gt;
  &lt;gap:plugin name="org.apache.cordova.splashscreen" /&gt;
  &lt;gap:plugin name="org.apache.cordova.vibration" /&gt;
  --&gt;
  &lt;gap:plugin name="org.apache.cordova.network-information" /&gt;
  
  &lt;!-- Third party plugins --&gt;
  &lt;!-- A list of available plugins are available at https://build.phonegap.com/plugins --&gt;
  &lt;!-- 
      &lt;gap:plugin name="com.phonegap.plugins.barcodescanner" /&gt;
  --&gt;
  
  &lt;!-- Define app icon for each platform.     --&gt;
  
  &lt;icon src="icon.png" /&gt;
  &lt;icon src="tools/images/icons/36.png"   gap:platform="android"    gap:density="ldpi" /&gt;
  &lt;icon src="tools/images/icons/48.png"   gap:platform="android"    gap:density="mdpi" /&gt;
  &lt;icon src="tools/images/icons/72.png"   gap:platform="android"    gap:density="hdpi" /&gt;
  &lt;icon src="tools/images/icons/96.png"   gap:platform="android"    gap:density="xhdpi" /&gt;
  &lt;icon src="tools/images/icons/57.png"   gap:platform="ios"        width="57" height="57" /&gt;
  &lt;icon src="tools/images/icons/72.png"   gap:platform="ios"        width="72" height="72" /&gt;
  &lt;icon src="tools/images/icons/114.png"  gap:platform="ios"        width="114" height="114" /&gt;
  &lt;icon src="tools/images/icons/144.png"  gap:platform="ios"        width="144" height="144" /&gt;
  &lt;icon src="tools/images/icons/64.png"   gap:platform="webos" /&gt;
  &lt;icon src="tools/images/icons/48.png"   gap:platform="winphone" /&gt;
  &lt;icon src="tools/images/icons/173.png"  gap:platform="winphone"   gap:role="background" /&gt;
  
  &lt;!-- Define app splash screen for each platform.    --&gt;
  &lt;gap:splash src="tools/images/splash/android/320x426.9.png" gap:platform="android" gap:density="ldpi" /&gt;
  &lt;gap:splash src="tools/images/splash/android/320x470.9.png" gap:platform="android" gap:density="mdpi" /&gt;
  &lt;gap:splash src="tools/images/splash/android/480x640.9.png" gap:platform="android" gap:density="hdpi" /&gt;
  &lt;gap:splash src="tools/images/splash/android/720x960.9.png" gap:platform="android" gap:density="xhdpi" /&gt;
  &lt;gap:splash src="tools/images/splash/ios/320x480.jpg"       gap:platform="ios"     width="320" height="480" /&gt;
  &lt;gap:splash src="tools/images/splash/ios/640x960.jpg"       gap:platform="ios"     width="640" height="960" /&gt;
  &lt;gap:splash src="tools/images/splash/ios/768x1024.jpg"      gap:platform="ios"     width="768" height="1024" /&gt;
  &lt;gap:splash src="tools/images/splash/ios/1024x768.jpg"      gap:platform="ios"     width="1024" height="768" /&gt;
  &lt;gap:splash src="tools/images/splash/ios/320x480.jpg"       gap:platform="winphone" /&gt;
  &lt;!--
      Define access to external domains.
  
      &lt;access /&gt;            - a blank access tag denies access to all external resources.
      &lt;access origin="*" /&gt; - a wildcard access tag allows access to all external resource.
  
      Otherwise, you can specify specific domains:
  --&gt;
  &lt;access origin="*"/&gt; &lt;!-- allow local pages --&gt;
  &lt;!--
      &lt;access origin="http://phonegap.com" /&gt;                    - allow any secure requests to http://phonegap.com/
      &lt;access origin="http://phonegap.com" subdomains="true" /&gt;  - same as above, but including subdomains, such as http://build.phonegap.com/
  --&gt;
  </code></pre>
  
  <p></p>
  
  <p>Im new to phonegap, and have never used a phonegap plugin before. </p>
  
  <p><em>I'm using phonegap version 3.1</em></p>