当前位置: 首页 > news >正文

网站内容管理系统产品全网营销推广

网站内容管理系统,产品全网营销推广,建网站麻烦拍照备案审核多久,网站开发基础班内容有哪些1.申请Google API Key#xff0c;参考前面文章 2.实现GPS的功能需要使用模拟器进行经纬度的模拟设置#xff0c;请参考前一篇文章进行设置 3.创建一个Build Target为Google APIs的项目 4.修改Androidmanifest文件#xff1a; view plainuses-library android:name… 1.申请Google API Key参考前面文章 2.实现GPS的功能需要使用模拟器进行经纬度的模拟设置请参考前一篇文章进行设置 3.创建一个Build Target为Google APIs的项目 4.修改Androidmanifest文件   view plain uses-library android:namecom.google.android.maps /  uses-permission android:nameandroid.permission.INTERNET/       uses-permission android:nameandroid.permission.ACCESS_COARSE_LOCATION/       uses-permission android:nameandroid.permission.ACCESS_FINE_LOCATION/     5.修改main.xml文件   view plain com.google.android.maps.MapView      android:idid/MapView01      android:layout_widthfill_parent      android:layout_heightfill_parent      android:apiKey0f8FBFJliR7j_7aNwDxClBv6VW8O12V2Y21W_CQ/     注意这里的apiKey值请相应修改为自己的key值 6.代码清单:     view plain package com.hoo.android.LocationMap;  import java.io.IOException;  import java.util.List;  import java.util.Locale;  import android.content.Context;  import android.graphics.Bitmap;  import android.graphics.BitmapFactory;  import android.graphics.Canvas;  import android.graphics.Paint;  import android.graphics.Point;  import android.location.Address;  import android.location.Criteria;  import android.location.Geocoder;  import android.location.Location;  import android.location.LocationListener;  import android.location.LocationManager;  import android.os.Bundle;  import android.widget.TextView;  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;  public class ActivityLocationMap extends MapActivity   {      public MapController mapController;      public MyLocationOverlay myPosition;      public MapView myMapView;            public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          setContentView(R.layout.main);          //取得LocationManager实例          LocationManager locationManager;          String contextContext.LOCATION_SERVICE;          locationManager(LocationManager)getSystemService(context);          myMapView(MapView)findViewById(R.id.MapView01);          //取得MapController实例控制地图          mapControllermyMapView.getController();          //设置显示模式为街景模式          myMapView.setStreetView(true);                    //*************使用系统自带的控件放大缩小视图***************************          //取得MapController对象(控制MapView)          mapController  myMapView.getController();           //设置地图支持设置模式          myMapView.setEnabled(true);          //设置地图支持点击          myMapView.setClickable(true);             //设置缩放控制,这里我们自己实现缩放菜单          myMapView.displayZoomControls(true);            myMapView.setBuiltInZoomControls(true);           //*******************************************************************               设置设置地图目前缩放大小倍数(从1到21)          mapController.setZoom(17);          //设置使用MyLocationOverlay来绘图          myPositionnew MyLocationOverlay();                    ListOverlay overlaysmyMapView.getOverlays();          overlays.add(myPosition);          //设置Criteria标准服务商的信息          Criteria criteria new Criteria();          //*****设置服务商提供的精度要求以供筛选提供商************************          criteria.setAccuracy(Criteria.POWER_HIGH);//表明所要求的经纬度的精度                      criteria.setAltitudeRequired(false); //高度信息是否需要提供          criteria.setBearingRequired(false);  //压力气压信息是否需要提供          criteria.setCostAllowed(false);  //是否会产生费用          criteria.setPowerRequirement(Criteria.POWER_MEDIUM);//最大需求标准          //*****************************************************          //取得效果最好的criteria          String providerlocationManager.getBestProvider(criteria, true);          //得到坐标相关的信息          Location locationlocationManager.getLastKnownLocation(provider);          //更新位置信息          updateWithNewLocation(location);          //注册一个周期性的更新3000ms更新一次0代表最短距离          //locationListener用来监听定位信息的改变OnLocationChanged          locationManager.requestLocationUpdates(provider, 3000, 0,locationListener);      }            //更新位置信息      private void updateWithNewLocation(Location location)       {          String latLongString; //声明经纬度的字符串          TextView myLocationText  (TextView)findViewById(R.id.TextView01);          //初始化地址为没有找到便于处理特殊情况          String addressString没有找到地址/n;          if(location!null)          {              //****************获取当前的经纬度并定位到目标*************************              //为绘制标志的类设置坐标              myPosition.setLocation(location);              //取得经度和纬度              Double geoLatlocation.getLatitude()*1E6;              Double geoLnglocation.getLongitude()*1E6;              //将其转换为int型              GeoPoint pointnew GeoPoint(geoLat.intValue(),geoLng.intValue());              //定位到指定坐标              mapController.animateTo(point);              //*********************************************************************              double latlocation.getLatitude();  //获得经纬度              double lnglocation.getLongitude();              latLongString经度lat/n纬度lng;   //设置经纬度字符串                           // double latitudelocation.getLatitude();              //double longitudelocation.getLongitude();              //根据地理位置来确定编码              Geocoder gcnew Geocoder(this,Locale.getDefault());              try              {                  //取得地址相关的一些信息经度、纬度                  ListAddress addressesgc.getFromLocation(lat, lng,1);                  StringBuilder sbnew StringBuilder();                  if(addresses.size()0)                  {                      Address addressaddresses.get(0);                      for(int i0;iaddress.getMaxAddressLineIndex()-1;i)                          sb.append(address.getAddressLine(i)).append(,);                                               //获得地址sb.append(address.getLocality()).append(/n);                          //获得邮编sb.append(address.getPostalCode()).append(/n);                          sb.append(address.getCountryName());                          addressStringsb.toString();                  }              }catch(IOException e){}          }          else          {              latLongString没有找到坐标./n;          }          //显示          myLocationText.setText(您当前的位置如下:/nlatLongString/naddressString);      }      //监听位置信息的改变      private final LocationListener locationListenernew LocationListener()      {          //当坐标改变时触发此函数          public void onLocationChanged(Location location)          {              updateWithNewLocation(location);          }          //Provider被disable时触发此函数比如GPS被关闭           public void onProviderDisabled(String provider)          {              updateWithNewLocation(null);          }          //Provider被enable时触发此函数比如GPS被打开          public void onProviderEnabled(String provider){}          //Provider的转态在可用、暂时不可用和无服务三个状态直接切换时触发此函数          public void onStatusChanged(String provider,int status,Bundle extras){}      };      //方法默认是true服务器所知的状态列信息是否需要显示      protected boolean isRouteDisplayed()      {          return false;      }            class MyLocationOverlay extends Overlay      {          Location mLocation;          //在更新坐标以便画图          public void setLocation(Location location)          {              mLocation  location;          }          Override          public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when)          {              super.draw(canvas, mapView, shadow);                          Paint paint  new Paint();              Point myScreenCoords  new Point();              // 将经纬度转换成实际屏幕坐标              GeoPoint tmpGeoPoint  new GeoPoint((int)(mLocation.getLatitude()*1E6),(int)(mLocation.getLongitude()*1E6));                  mapView.getProjection().toPixels(tmpGeoPoint, myScreenCoords);              //*********paint相关属性设置*********              paint.setStrokeWidth(0);//文              paint.setARGB(255, 255, 0, 0);              paint.setStyle(Paint.Style.STROKE);              //***********************************              Bitmap bmp  BitmapFactory.decodeResource(getResources(), R.drawable.green_dot);              canvas.drawBitmap(bmp, myScreenCoords.x, myScreenCoords.y, paint);              canvas.drawText(您目前的位置, myScreenCoords.x, myScreenCoords.y, paint);              return true;          }      }  }     代码参考网络加以修改优化谢谢 7.程序运行截图前提是在命令行下输入geo fix 121.5 31.24定位到上海东方明珠在命令行下可以输入其他坐标系统会根据坐标显示其他位置如接着输入geo fix 113.325 23.113定位到广州海心沙不知为什么输入坐标的时候经常会不识别有时能够成功而有时不行郁闷求解…… 转载于:https://www.cnblogs.com/Free-Thinker/p/3606475.html
http://www.yutouwan.com/news/51710/

相关文章:

  • 系统学做网站做外贸网站的都有哪些类型的公司
  • 大庆网站制作传奇世界网页版在线玩
  • 公司网站建设注意点网络促销
  • 网站打开的速度特别慢的原因制作网站页面怎么做
  • 博客网站怎么做cpa网站建设 教学视频教程
  • 昭通市住房和城乡建设局网站做自己的免费网站
  • 做网站课程企业信息公开查询
  • 网站公司推荐青海网站开发建设
  • 怎么才能建设免费网站学建筑的女生后悔吗
  • 小米路由做网站服务器搜索引擎营销的实现方法有哪些
  • 做优化的网站建筑工程管理系统平台
  • 黑彩网站怎么做seo软文是什么
  • 建设网站公司哪家性价比高广东装修公司排名前十强
  • 淮安网站建设找谁好宝塔系统搭建wordpress
  • 淘宝客网站怎么做的人少了上海高品质网站建设
  • 图书馆网站建设的作用铁路建设工程网
  • 免费建网站无广告网站建设文章官网
  • 深圳网站建站的公司桂林生活网官网首页
  • 怎么创办自己的网站php做简单网站教程视频
  • 坂田网站设计学网站ui设计
  • 网站页面设计费用用discuz做的门户网站
  • 如何在本地搭建网站网站验收技术指标
  • 企业网站报价方案模板下载有人做网站花了10几万
  • 越野车网站模板企业网站空间选择
  • 织梦大气蓝色门户资讯网站模板房产经纪人如何做网站吸客
  • 网站接口怎么做网站栏目排序
  • 做的好微信商城网站戴尔网站建设成功
  • 游戏源代码网站wordpress禁用自动保存
  • 未备案个人网站 如何挣钱门户网站简称
  • 做网站公奇闻司郑州汉狮什么网站做详情页好