简体   繁体   中英

How can I print the location information I get in the background from logcat to a text file in Android Studio?

In my project, I print the location information I get in the background every 4 seconds to logcat. But I want to print from logcat to text file or to text in android studio. How do I do this? The code block I printed to logcat:

if (locationResult != null && locationResult.getLastLocation() != null) {
                double latitude = locationResult.getLastLocation().getLatitude();
                double longitude = locationResult.getLastLocation().getLongitude();
                Log.d("LOCATION_UPDATE", latitude + ", " + longitude);
            }

It's called a GPX file.

Check out this library for handling GPX files https://github.com/jenetics/jpx

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