大佬教程收集整理的这篇文章主要介绍了android – 从GeoPoints创建GPX文件,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
@Override public void onLOCATIOnChanged(android.LOCATIOn.LOCATIOn LOCATIOn) { lat = LOCATIOn.getLatitude(); lon = LOCATIOn.getLongitude(); currGeo = new GeoPoint((int)(lat*1e6),(int)(lon*1e6)); //Store GeoPoint to GPX file }
我读过How to parse and plot gpx file has an android MapView,但我正在寻找一个更简单的解决方案.
// open file handle OutputStream fout = getFiLeoutputStream("gpxFile.gpx"); fout.write("<gpx>"); for (GeoPoint gp : listOfGeoPoints) { fout.write("<gpxPoint>" + getGeoPointAsStringForFile(gp) + "</gpxPoint>"); } fout.write("</gpx>"); // close file,cleanup,etc
这将要求您实现getFILeoutputStream()方法和getGeoPointAsStringForFile()方法,但是您知道您的目标是什么格式,这将让您只需创建文件而无需经历大量的箍.
以上是大佬教程为你收集整理的android – 从GeoPoints创建GPX文件全部内容,希望文章能够帮你解决android – 从GeoPoints创建GPX文件所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。