功能"/>
java实现定位功能
之前已经完成了百度地图SDK和百度定位SDK的配置。
实现百度定位的功能,最好仔细看看官方的文档,看了好几次才有点明白。
我初步想实现如下功能:点击findme按钮,进入新的activity,即在地图上显示我的位置。
首先是完成androidManifest.xml的相关设置
package="com.example.TraceMe">
android:name="com.example.TraceMe.TraceMe"
android:icon="@drawable/icon"
android:label="@string/app_name">
android:name="com.example.TraceMe.Activity_Main"
android:configChanges="orientation"
android:label="TraceMe"
android:screenOrientation="sensor" >
android:name="com.baidu.location.f"
android:enabled="true"
android:process=":remote" >
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="false"
android:resizeable="true"
android:smallScreens="true" />
然后在layout目录下完成相关activtiy的设计
其中百度地图的控件声明如下:
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:layout_weight="1"
然后在Activity_showMyLocation中完成定位操作并显示在地图上
package com.example.TraceMe;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import an
更多推荐
java实现定位功能
发布评论