简体   繁体   中英

Location Tracking with Android

I've been using really ugly and old GPS tracking in my app and decided to upgrade it. I've came into this class & interface: http://gabesechansoftware.com/location-tracking/

but I have no idea how to implement it.

I'm trying to get the user Latitude and Longitude in one of my application tabs, this way:

GPSTracker myGPS = new GPSTracker(getActivity());
        Toast.makeText(getActivity(),"Lat:" + myGPS.getLatitude(),Toast.LENGTH_LONG).show();

The output is 0.0 . Is there any way to know when the user GPS records have finally tracked?

The canonical way to get location is to use the google play location services which are available in API8 (2.2, Froyo) and above. With this library you can subscribe to location updates based on criteria such as distance moved, a set update frequency, and combinations.

There are more details available in the " Receiving Location Updates " training topic.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM