<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      秋·風

        博客園 :: 首頁 :: 博問 :: 閃存 :: 新隨筆 :: 聯系 :: 訂閱 訂閱 :: 管理 ::
      如果用xe6自帶的LocationSensor控件,默認優先使用網絡位置,網絡位置定位精度不準確,不能滿足高精度定位的要求。但xe6自帶的LocationSensor控件不能指定網絡定位優先還是GPS定位優先,如果調用java API是可以指定優先使用GPS定位,以下代碼經實測證實是可以直接指定GPS定位的。
       
      uses Androidapi.JNI.Location, Androidapi.JNIBridge, Androidapi.JNI.JavaTypes, 
        Androidapi.JNI.Os,FMX.Helpers.Android,Androidapi.JNI.GraphicsContentViewText;
       
      type
        TLocationListener = class;
        TForm1 = class(TForm)
       
        . . . . . .
       
        private
          { Private declarations }
          FLocationManager : JLocationManager;
          locationListener : TLocationListener;
        public
          destructor Destroy; override;
          { Public declarations }
          procedure onLocationChanged(location: JLocation);
        end;
        //Sensore GPS
        TLocationListener = class(TJavaLocal, JLocationListener)
        private
          [weak]
          FParent : TForm1;
        public
          constructor Create(AParent : TForm1);
          procedure onLocationChanged(location: JLocation); cdecl;
          procedure onProviderDisabled(provider: JString); cdecl;
          procedure onProviderEnabled(provider: JString); cdecl;
          procedure onStatusChanged(provider: JString; status: Integer; extras: JBundle); cdecl;
        end;
       
      . . . . .
       
      constructor TLocationListener.Create(AParent: TForm1);
      begin
        inherited Create;
        FParent := AParent;
      end;
       
      procedure TLocationListener.onLocationChanged(location: JLocation);
      begin
        FParent.onLocationChanged(location);
      end;
       
      procedure TLocationListener.onProviderDisabled(provider: JString);
      begin
      end;
       
      procedure TLocationListener.onProviderEnabled(provider: JString);
      begin
      end;
       
      procedure TLocationListener.onStatusChanged(provider: JString; status: Integer; extras: JBundle);
      begin
      end;
       
      destructor TForm1.Destroy;
      begin
        if Assigned(locationListener) then
          FLocationManager.removeUpdates(locationListener);
        inherited;
      end;
       
      procedure TForm1.onLocationChanged(location: JLocation);//位置發生變化時,顯示經、緯度
      begin
        if Assigned(location) then
        begin
           //variabili da recuperare dal sensore
           Label4.Text := location.getLatitude.ToString;
           Label5.Text := location.getLongitude.ToString;
           Label6.Text := location.getAltitude.ToString;
           Label8.Text := location.getSpeed.ToString;
           Label10.Text := location.getTime.ToString;
        end;
      end;
       
      procedure TForm1.FormCreate(Sender: TObject);
      var LocationManagerService: JObject;
          location : JLocation;
      begin 
        if not Assigned(FLocationManager) then
        begin
          LocationManagerService := SharedActivityContext.getSystemService(TJContext.JavaClass.LOCATION_SERVICE);
          FLocationManager := TJLocationManager.Wrap((LocationManagerService as ILocalObject).GetObjectID);
          if not Assigned(locationListener) then locationListener := TLocationListener.Create(self);
          FLocationManager.requestLocationUpdates(TJLocationManager.JavaClass.GPS_PROVIDER, 1000, 0, locationListener, TJLooper.JavaClass.getMainLooper);
            // 監聽狀態
            // 綁定監聽,有4個參數
            // 參數1,設備:有GPS_PROVIDER和NETWORK_PROVIDER兩種
            // 參數2,位置信息更新周期,單位毫秒
            // 參數3,位置變化最小距離:當位置距離變化超過此值時,將更新位置信息
            // 參數4,監聽
            // 備注:參數2和3,如果參數3不為0,則以參數3為準;參數3為0,則通過時間來定時更新;兩者為0,則隨時刷新
            // 1秒更新一次,或最小位移變化超過1米更新一次;
            // 注意:此處更新準確度非常低,推薦在service里面啟動一個Thread,在run中sleep(10000);然后執行handler.sendMessage(),更新位置
        end;
       FLocationManager.isProviderEnabled(TJLocationManager.JavaClass.GPS_PROVIDER);
        FLocationManager.isProviderEnabled(TJLocationManager.JavaClass.NETWORK_PROVIDER);
        onLocationChanged(location);
      end
      posted on 2014-04-29 12:02  秋·風  閱讀(2087)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 国产AV福利第一精品| 91在线国内在线播放老师| 亚洲欧洲久久激情久av| 国产成人精品一区二三区| 亚洲影院丰满少妇中文字幕无码| 成人性生交大片免费看| 曰韩无码二三区中文字幕| 久久人人爽人人爽人人av| 东京热高清无码精品| 91中文字幕在线一区 | 亚洲色大成网站www永久男同 | AV无码免费不卡在线观看| 亚洲欧洲一区二区福利片| 久久久久人妻精品一区二区三区| 日韩乱码视频一区二区三区| 无码一区二区三区AV免费| 精品国产中文字幕懂色| 国产一级精品在线免费看| 欧美最猛性xxxxx大叫| 国产无套内射又大又猛又粗又爽| 人妻另类 专区 欧美 制服| 日韩精品人妻黄色一级片| 国产精品爽爽爽一区二区| 色偷偷亚洲男人的天堂| 97精品尹人久久大香线蕉| 日韩AV高清在线看片| 精品久久久久中文字幕日本 | 黑人巨大av无码专区| 成人动漫综合网| 男女猛烈无遮挡免费视频APP| 欧美大胆老熟妇乱子伦视频| 亚洲特黄色片一区二区三区| 亚洲综合国产伊人五月婷| 精品国产亚洲区久久露脸| 亚洲尤码不卡av麻豆| 精品国产高清中文字幕| 亚洲国产一区二区三区最新| 麻豆成人精品国产免费| 亚洲av综合av一区| 欧美熟妇性XXXX欧美熟人多毛| 18禁无遮挡啪啪无码网站破解版|