Android开发程序获取GPS信息步骤

1、获取LOCATION_SERVICE系统服务。
2、创建Criteria对象,调用该对象的set方法设置查询条件。
3、调用LocationManager.getBestProvider(Criteria criteria,Boolean enabledOnly)方法,传入创建好的Criteria对象,获取最能满足给定标准(Criteria对象)的提供者名称。
4、调用LocationManager.getLastKnowLocation(),传入提供者名称,获取最后已知位置信息。
5、调用LocationManager.requstLocationUpdates(),添加LocationListener监听器。

posted @ 2015-04-07 23:17  算盘  阅读(676)  评论(0编辑  收藏  举报