Back to project page trip-chain-android.
The source code is released under:
MIT License
If you think the Android project trip-chain-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package fi.aalto.tripchain.route; /*from w w w . ja v a2 s.co m*/ import java.util.List; import fi.aalto.tripchain.here.Address; import fi.aalto.tripchain.here.ReverseGeocoder; import android.app.Service; import android.content.Context; import android.location.Location; import android.os.Handler; import android.util.Log; import android.widget.Toast; import fi.aalto.tripchain.receivers.EventDispatcher; import fi.aalto.tripchain.receivers.LocationReceiver; /** * Receives Play Services locations and forwards them to Trip and EventDispatcher. * */ public class LocationListener extends LocationReceiver { private Trip trip; private static final String TAG = LocationListener.class.getSimpleName(); public LocationListener(Context context, Trip trip) { super(context); this.trip = trip; } @Override public void onLocationChanged(final Location location) { Log.d(TAG, "Provider: " + location.getProvider() + " Accuracy: " + location.getAccuracy() + " Latitude: " + location.getLatitude() + " Longitude: " + location.getLongitude()); trip.onLocation(location); EventDispatcher.onLocation(location); } }