如何获得的经度和纬度线下android中? [英] How to get latitude and longitude offline in android ?

查看:153
本文介绍了如何获得的经度和纬度线下android中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得当前位置(经度和放大器;经度),Wi-Fi连接和放大器; GPS是关闭。它可以从移动SIM卡的网络获得的经度和纬度。我搜索更多关于谷歌,但我没有得到满足的答案。

I want to get current location (latitude & longitude) , when WiFi & Gps is off .It is possible to get latitude and longitude from mobile sim network. I searched more on google but i did not get satisfies answers.

推荐答案

试试这个

 LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE); 
    Location location = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
    if(location==null){
        location = lm.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
    }

这篇关于如何获得的经度和纬度线下android中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆