百度定位SDK5.x版本开发指南修正说明

来源:互联网 发布:淘宝信誉查询131458网 编辑:程序博客网 时间:2024/06/17 22:23

百度开发者中心有给出5.x版本(目前最新是5.2)开发指导说明,但无法成功定位。

除参考官网指导说明外,http://developer.baidu.com/map/index.php?title=android-locsdk/guide/v5-0,需注意一点,在manifest中需声明service组件,官网说明如下:

<service android:name="com.baidu.location.f" android:enabled="true" android:process=":remote"></service>

在5.x版本中,是无法成功实现定位功能。通过查看源码,应该修改为:

<serviceandroid:name="com.baidu.location.f"android:enabled="true"android:process=":remote"><intent-filter><action android:name="com.baidu.location.service_v2.2"></action></intent-filter></service>

关于locationoption可设置的属性,有几个也是略有出入的,在实际开发中可发现。

0 0
原创粉丝点击