简体   繁体   English

如何将我在后台从 logcat 获得的位置信息打印到 Android Studio 中的文本文件?

[英]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.

相关问题 我如何将所有logcat条目存储到android中的文件 - How can i get all logcat entries stored to a file in android 如何在图像上打印文本? | Android 工作室 | Java - How can I print text on an image? | Android Studio | Java 如何从后台服务更新Android活动中的信息 - How can I update information in an Android Activity from a background Service 如何在Android Studio中以字符串形式获取地图标记的位置? - How can I get the location, as a string, of a map marker in Android studio? 如何从第三方库(分支)打印到 Android Studio Logcat? - How to print to Android Studio Logcat from (fork of) Third Party Library? 如何使用ddmlib获取logcat数据? - How can I get logcat data with ddmlib? 当活动屏幕首次在 Android Studio 上加载时,如何在隐藏背景中发送带有当前位置数据的 SMS 文本消息? - How do I send a SMS text message in the hidden background with current location data when the activity screen first loads on Android Studio? 如何从 Android 中的 gridview 获取项目的背景颜色? - How can I get the background color of an item from gridview in Android? 从Android Studio中的CSV文件中获取信息? - Get the information from CSV file in Android studio? 如何在 Android Studio 中通过 java 获取用户当前位置 - How do I get the users current location by java in Android Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM