<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>

新聞中心

EEPW首頁(yè) > 汽車(chē)電子 > 設計應用 > 基于A(yíng)ndroid的位置實(shí)時(shí)監控系統的設計與實(shí)現

基于A(yíng)ndroid的位置實(shí)時(shí)監控系統的設計與實(shí)現

作者:張維文 孫耀杰 李利娟 時(shí)間:2015-04-23 來(lái)源:電子產(chǎn)品世界 收藏

  2.3 程序實(shí)現

本文引用地址:http://dyxdggzs.com/article/273085.htm

  一是定位功能的實(shí)現。充分利用智能手機內置定位模塊,基于Eclipse開(kāi)發(fā)平臺通過(guò)程序的調用,實(shí)現定位功能,手機運行結果如圖4所示。其實(shí)現代碼如下:

  /**
  * 將獲得的位置信息顯示出來(lái)
  * @param location
  */
  private void setLocation(Location location){
  if (location != null) {
  String latitudeStr = Double.toString(location.getLatitude());//經(jīng)度
  String longitudeStr = Double.toString(location.getLongitude());//緯度
  String altitudeStr = Double.toString(location.getAltitude());//海拔
  // 獲取當前時(shí)間
  SimpleDateFormat sDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss",Locale.CHINA);
  String dateStr = sDateFormat.format(new java.util.Date());
  gpsTime.setText(dateStr);
  if (latitudeStr != null && !latitudeStr.equals("")) {
  latitude.setText(latitudeStr);
  }
  if (longitudeStr != null && !longitudeStr.equals("")) {
  longitude.setText(longitudeStr);
  }
  if (altitudeStr != null && !altitudeStr.equals("")) {
  altitude.setText(altitudeStr);
  }
  } else {
  Log.v("location", "location為空");
  }
  }

  二是經(jīng)緯度信息發(fā)送功能的實(shí)現。根據事先設置好的監控端手機號碼,按照發(fā)送頻率(時(shí)間間隔),將經(jīng)緯度發(fā)送到監控端。其實(shí)現代碼如下:

  /**
  * 發(fā)送短信
  * @param smsContent 短信內容
  */
  private void sendSMS(String smsContent){
  //獲取短信管理器
  SmsManager smsManager = SmsManager.getDefault();
  //拆分短信內容
  List divideContents = smsManager.divideMessage(smsContent);
  if (curPhoneNum == null || curPhoneNum.equals("")) {
  new AlertDialog.Builder(MainActivity.this).setTitle("警告").setMessage("您還未設置目標電話(huà)號碼").create().show();
  return;
  }
  //發(fā)送短信
  for (String text : divideContents) {
  smsManager.sendTextMessage(curPhoneNum, null, text, null, null);
  }
  }



關(guān)鍵詞: Android GPS APP SDK 監控系統

評論


相關(guān)推薦

技術(shù)專(zhuān)區

關(guān)閉
国产精品自在自线亚洲|国产精品无圣光一区二区|国产日产欧洲无码视频|久久久一本精品99久久K精品66|欧美人与动牲交片免费播放
<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>