title: Unity Android Location Services Plugin Issue
body: <p>I have created a Unity plugin to utilize Android's location services.  For all intents and purposes it should be working.  I subscribe listeners to location updates, but the LocationListeners' onChangeLocation callback never gets triggered.  Recently, I noticed this print out from unity in logcat: Unknown event structure (2).  I believe that this is the LocationManager attempting to notify the LocationListener of a location change, but obviously there is some issue.  I've searched the net for an answer to this problem, but as the log file gives me little to no information, I was unable to find much information.  I've added permissions to the manifest file. Below is the initialization and registration code for the listeners. </p>
  
  <p>Initialization:  </p>
  
  <pre><code>public static void Init(Context context)
  {
      if(_looper == null)
      {
          Looper.prepare();
          _looper = Looper.myLooper();
      }
      Log.d("LocationServices", "Initializing Location Services");
      try
      {
          _locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
  
          _netProviderIsEnabled = _locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
          _gpsProviderIsEnabled = _locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
  
          Log.d("LocationServices", "NetworkProviderEnabled: " + _netProviderIsEnabled);
          Log.d("LocationServices", "GPSProviderEnabled:" + _gpsProviderIsEnabled);
  
          _netLocationListener = new LocationListener()
          {
              public void onLocationChanged(Location location)
              {
                  Log.d("LocationServices", "got a new location");
                  makeUseOfNewLocation(location);
              }
  
              public void onStatusChanged(String provider, int status, Bundle extras) 
              {
                  Log.d("LocationServices", "NetStatus: " + status);
                  Map&lt;String, String&gt; statusMap = new HashMap&lt;String, String&gt;();
  
                  statusMap.put("Provider", provider);
                  statusMap.put("Status", "" + status);
  
                  JSONObject json = new JSONObject(statusMap);
  
                  //UnityPlayer.UnitySendMessage("RunView", "GetProviderStatus", json.toString());
              }
  
              public void onProviderEnabled(String provider) 
              {
                  _netProviderIsEnabled = true;
                  _locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, _netLocationListener);
              }
  
              public void onProviderDisabled(String provider) 
              {
                  _netProviderIsEnabled = false;
                  _locationManager.removeUpdates(_netLocationListener);
              }
          };
  
          _gpsLocationListener = new LocationListener()
          {
              public void onLocationChanged(Location location)
              {
                  Log.d("LocationServices", "got a new location");
                  makeUseOfNewLocation(location);
              }
  
              public void onStatusChanged(String provider, int status, Bundle extras) 
              {
                  Log.d("LocationServices", "GPSStatus: " + status);
                  Map&lt;String, String&gt; statusMap = new HashMap&lt;String, String&gt;();
  
                  statusMap.put("Provider", provider);
                  statusMap.put("Status", "" + status);
  
                  JSONObject json = new JSONObject(statusMap);
  
                  //UnityPlayer.UnitySendMessage("RunView", "GetProviderStatus", json.toString());
              }
  
              public void onProviderEnabled(String provider) 
              {
                  _gpsProviderIsEnabled = true;
                  _locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, _gpsLocationListener);
              }
  
              public void onProviderDisabled(String provider) 
              {
                  _gpsProviderIsEnabled = false;
                  _locationManager.removeUpdates(_gpsLocationListener);
              }
          };
      }
      catch(Exception ex)
      {
          Log.d("LocationServices", "Error: " + ex.getMessage());
      }
      _isTracking = false;
  }
  </code></pre>
  
  <p>Registration: </p>
  
  <pre><code>public static void StartTracking()
  {
      if(_isTracking)
          return;
  
      Log.d("LocationServices", "Starting Location Services");
      try
      {
          if(_netProviderIsEnabled)
              _locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, _netLocationListener);
          /*else
              UnityPlayer.UnitySendMessage("RunView", "GetNetProviderStatus", "False");*/
  
          if(_gpsProviderIsEnabled)
              _locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, _gpsLocationListener);
          /*else
              UnityPlayer.UnitySendMessage("RunView", "GetGpsProviderStatus", "False");*/
  
          _currentLocation = _locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
  
          String json = LocationToJson(_currentLocation);
          UnityPlayer.UnitySendMessage("RunView", "GetLocationData", json);
      }
      catch(Exception ex)
      {
          Log.d("LocationServices", "Error: " + ex.getMessage());
      }
  
      _isTracking = true;
  }
  </code></pre>
  
  <p>If you have any idea what could be causing this, any help would be appreciated.  If you have any questions let me know and I'll update the post.  Thanks all for you help!</p>