java实现定位功能

编程入门 行业动态 更新时间:2024-10-25 04:23:42

java实现定位<a href=https://www.elefans.com/category/jswz/34/1771378.html style=功能"/>

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实现定位功能

本文发布于:2024-02-14 15:32:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1764232.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:功能   java

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!