Android Open Source - GpsExample Location Receiver






From Project

Back to project page GpsExample.

License

The source code is released under:

MIT License

If you think the Android project GpsExample listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package me.kaipi.gpsexample;
//from   ww  w.  jav a 2  s .  c o m
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.location.Location;
import android.util.Log;

public class LocationReceiver extends BroadcastReceiver {
  private static final String TAG = "LocationReceiver";
  
  @Override
  public void onReceive(Context context, Intent intent) {
    Location location = intent.getParcelableExtra("location");
    Log.d(TAG, "Location received: " + location.getTime());
    Log.d(TAG, "Thread id: " + Thread.currentThread().getId());
  }

}




Java Source Code List

me.kaipi.gpsexample.BootReceiver.java
me.kaipi.gpsexample.GpsService.java
me.kaipi.gpsexample.LocationReceiver.java
me.kaipi.gpsexample.MainActivity.java