- 浏览: 518745 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
tangyunliang:
大哥你太历害了谢谢
Android基于XMPP Smack Openfire开发IM【四】初步实现两个客户端通信 -
u013015029:
LZ,请问下,在// 添加消息到聊天窗口 , 这里获取Ed ...
Android基于XMPP Smack Openfire开发IM【四】初步实现两个客户端通信 -
endual:
怎么保持会话,我搞不懂啊
Android基于XMPP Smack Openfire开发IM【一】登录openfire服务器 -
donala_zq:
显示:[2013-11-30 11:50:36 - Andro ...
android-----------新浪微博 -
donala_zq:
哥,运行不了啊
android-----------新浪微博
工程结构图:
[img]
[/img]
效果图:
[img]
[/img]
main.xml
AndroidManifest.xml:
Activity01:
[img]
[/img]
效果图:
[img]
[/img]
main.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <com.google.android.maps.MapView android:id="@+id/MapView01" android:layout_width="fill_parent" android:layout_height="fill_parent" android:apiKey="0axCo4Wu7FStW2yuF-kfg0X8Rr50919GvKpiCrA"/> </RelativeLayout>
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.magus.map" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="8" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <uses-library android:name="com.google.android.maps" /> <activity android:name="Activity01" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> </manifest>
Activity01:
package com.magus.map; import java.util.List; import com.google.android.maps.GeoPoint; import com.google.android.maps.MapActivity; import com.google.android.maps.MapController; import com.google.android.maps.MapView; import com.google.android.maps.Overlay; import android.app.Activity; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Point; import android.os.Bundle; public class Activity01 extends MapActivity { private MapView mMapView; private MapController mMapController; private GeoPoint mGeoPoint; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mMapView = (MapView) findViewById(R.id.MapView01); // 设置为交通模式 mMapView.setTraffic(true); // 设置为卫星模式 //mMapView.setSatellite(true); // 设置为街景模式 // mMapView.setStreetView(false); // 取得MapController对象(控制MapView) mMapController = mMapView.getController(); mMapView.setEnabled(true); mMapView.setClickable(true); // 设置地图支持缩放 mMapView.setBuiltInZoomControls(true); // 设置起点为成都 mGeoPoint = new GeoPoint((int) (30.659259 * 1000000), (int) (104.065762 * 1000000)); // 定位到成都 mMapController.animateTo(mGeoPoint); // 设置倍数(1-21) mMapController.setZoom(12); // 添加Overlay,用于显示标注信息 MyLocationOverlay myLocationOverlay = new MyLocationOverlay(); List<Overlay> list = mMapView.getOverlays(); list.add(myLocationOverlay); } protected boolean isRouteDisplayed() { return false; } class MyLocationOverlay extends Overlay { public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { super.draw(canvas, mapView, shadow); Paint paint = new Paint(); Point myScreenCoords = new Point(); // 将经纬度转换成实际屏幕坐标 mapView.getProjection().toPixels(mGeoPoint, myScreenCoords); paint.setStrokeWidth(1); paint.setARGB(255, 255, 0, 0); paint.setStyle(Paint.Style.STROKE); Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.home); canvas.drawBitmap(bmp, myScreenCoords.x, myScreenCoords.y, paint); canvas.drawText("天府广场", myScreenCoords.x, myScreenCoords.y, paint); return true; } } }
发表评论
-
Android中如何模拟一次点击(touch)事件
2014-05-06 10:41 0在Android中有时需要模拟某一个View的touch事件, ... -
Android程序Crash时的异常上报
2014-04-28 18:15 0http://blog.csdn.net/singwhatiw ... -
android程序中证书签名校验的方法
2014-04-28 17:58 1909android程序中证书签名校验的方法一 2013-02 ... -
MD5理解错了,哎
2014-03-17 14:14 0MD5只对数据加密是无法解密的,也就是说,你把100加密后,就 ... -
Android 获取网络时间
2014-03-12 11:42 2015Android 获取网络时间 在网上看到的最常见的方式有: ... -
SQLite清空表并将自增列归零
2014-03-05 18:02 1476SQLite清空表并将自增列归零 作者:Zhu Yanfeng ... -
Handler小看一下
2013-11-11 16:42 0android handler调用post方法还是阻塞 su ... -
Frame Animation小看一下
2013-10-12 16:30 724Demo运行效果图: 源码: -
动画小学一下
2013-10-12 16:14 697转自: http://www.eoeandroid.com/f ... -
Android 动画之ScaleAnimation应用详解
2013-10-12 15:49 967===============eoeAndroid社区推荐:= ... -
android开发中的一个工具类
2013-06-19 16:04 0package com.wanpu.login.dialog; ... -
android TextView怎么设置个别字体颜色并换行?
2013-06-20 09:25 1643(1)、TextView 设置个别字体颜色 TextView ... -
Android开发之文件下载,状态时显示下载进度,点击自动安装
2013-05-07 15:38 1374在进行软件升级时,需要进行文件下载,在这里实现自定义的文件下载 ... -
android中的状态保存
2013-04-07 14:21 938package com.zzl.call; import ... -
android动画基础:tween动画
2013-04-06 11:21 1184工程结构图: [img] [/img] 四个动画的xml ... -
面试中遇到的几个问题
2013-06-09 11:56 949SAX与DOM之间的区别 SAX ( ... -
Android获取其他包的Context实例,然后调用它的方法,反射!!!
2013-03-25 10:32 1164Android中有Context的概念,想必大家都知道。Con ... -
Android的内存机制和常见泄漏情形
2013-03-06 16:55 760一、 Android的内存机制 Android的程序由Ja ... -
JUnit测试小小demo
2013-03-06 16:37 1093运行效果图: [img] [/img] 项目结构图 ... -
android开发中的异常小工具
2013-03-04 15:53 866package com.zzl.tools; impor ...
相关推荐
GOOGLE MAP api 7个案例。 CurrentAddress 得到当前位置 gMap 地形 路线 GoogleMapDemo 当前位置 ...MapView 放大缩小 WeatherMap 在MAP上添加图片 WorldCities 城市经纬度的切换 以及 动画切换效果
Canvas 小游戏 旋转补正 demo
Android中MapView的使用方法.pdf 学习资料 复习资料 教学资源
NULL 博文链接:https://llhdf.iteye.com/blog/521201
android 开发中的基础知识 对mapview 的掌握
Android MapView 应用,基于Android开发,应用Android SDK 1.5
Android:如何在tab中添加mapview
android:apiKey="Map_Demo" android:clickable="true" /> android:layout_height="wrap_content" android:text="输入查询地址" android:selectAll/> </RelativeLayout> 然后, 创建一个...
NULL 博文链接:https://zhchzh1000.iteye.com/blog/800450
mapview+biee资料,mapview+biee资料,mapview+biee资料,mapview+biee资料
在android的mapview上添加浮动按钮,并固定在右下角
使用Qt开发的,地图查看示例,只有基本功能
一款支持平移,缩放,点击事件的自定义地图控件,根据地图坐标点进行比例缩放,实现真实定位场景
使用ItemizedOverlay在mapview上创建浮动按钮,可以为坐标创建一个单击事件。
android MapView地图测试,现在共享下。
xml_mapView.txt
##MKAnnotationView ####.自定义MKAnnotationView,支持ios5、6、7 ####.支持导航、跳转到第三方应用、包括google、苹果、高德、百度 ####.支持应用内绘图 ####.支持定位功能 ####.支持搜索功能
资源来自pypi官网。 资源全名:kivy_garden.mapview-1.0.5.tar.gz