从小数到度数的转换,你可以按以下方法进行
String strLongitude = Location.convert(location.getLongitude(), Location.FORMAT_DEGREES);
String strLatitude = Location.convert(location.getLatitude(), Location.FORMAT_DEGREES);
reference is 安卓开发者网站.
我已经尝试了以下的事情,并得到了输出。
strLongitude = Location.convert(location.getLongitude(), Location.FORMAT_DEGREES);
strLatitude = Location.convert(location.getLatitude(), Location.FORMAT_DEGREES);
OUTPUT : Long: 73.16584: Lat: 22.29924
strLongitude = Location.convert(location.getLongitude(), Location.FORMAT_SECONDS);
strLatitude = Location.convert(location.getLatitude(), Location.FORMAT_SECONDS);
OUTPUT : Long: 73:9:57.03876: Lat: 22:17:57.26472
strLongitude = Location.convert(location.getLongitude(), Location.FORMAT_MINUTES);
strLatitude = Location.convert(location.getLatitude(), Location.FORMAT_MINUTES);
OUTPUT : Long: 73:9.95065: Lat: 22:17.95441
根据你的要求,尝试不同的选项