[英]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.在我的项目中,我每 4 秒将我在后台获得的位置信息打印到 logcat。 But I want to print from logcat to text file or to text in android studio.
但我想从 logcat 打印到文本文件或 android 工作室中的文本。 How do I do this?
我该怎么做呢? The code block I printed to logcat:
我打印到 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.它被称为 GPX 文件。
Check out this library for handling GPX files https://github.com/jenetics/jpx查看此库以处理 GPX 文件https://github.com/jenetics/jpx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.