Android 安卓:使用全球定位系统

Android 安卓:使用全球定位系统,android,Android,有什么方法可以让我在我的应用程序中获得最后一个GPS位置吗 是否有任何可用的API可以显示Lat和Long。我上次连接GPS的地方 任何帮助,非常感谢 谢谢您可以使用LocationManager 导入android.content.Context;导入android.location.LocationManager;LocationManager=(LocationManager)getSystemService(Context.LOCATION\u服务);manager.getLastKno

有什么方法可以让我在我的应用程序中获得最后一个GPS位置吗

是否有任何可用的API可以显示Lat和Long。我上次连接GPS的地方

任何帮助,非常感谢


谢谢

您可以使用LocationManager


导入android.content.Context;导入android.location.LocationManager;LocationManager=(LocationManager)getSystemService(Context.LOCATION\u服务);manager.getLastKnownLocation(LocationManager.GPS\U提供商);
LocationManager manager = (LocationManager)Context.getSystemService(Context.LOCATION_SERVICE);
manager.getLastKnownLocation(LocationManager.GPS_PROVIDER);