久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    • <bdo id='CZDNa'></bdo><ul id='CZDNa'></ul>

  • <legend id='CZDNa'><style id='CZDNa'><dir id='CZDNa'><q id='CZDNa'></q></dir></style></legend>

    1. <tfoot id='CZDNa'></tfoot>

    2. <i id='CZDNa'><tr id='CZDNa'><dt id='CZDNa'><q id='CZDNa'><span id='CZDNa'><b id='CZDNa'><form id='CZDNa'><ins id='CZDNa'></ins><ul id='CZDNa'></ul><sub id='CZDNa'></sub></form><legend id='CZDNa'></legend><bdo id='CZDNa'><pre id='CZDNa'><center id='CZDNa'></center></pre></bdo></b><th id='CZDNa'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='CZDNa'><tfoot id='CZDNa'></tfoot><dl id='CZDNa'><fieldset id='CZDNa'></fieldset></dl></div>
    3. <small id='CZDNa'></small><noframes id='CZDNa'>

        查找位置:Google Play 位置服務(wù)或 Android 平臺位置

        Finding Location : Google Play Location Service or Android platform location APIs(查找位置:Google Play 位置服務(wù)或 Android 平臺位置 API)

            <small id='s3W5O'></small><noframes id='s3W5O'>

            <legend id='s3W5O'><style id='s3W5O'><dir id='s3W5O'><q id='s3W5O'></q></dir></style></legend>
          1. <i id='s3W5O'><tr id='s3W5O'><dt id='s3W5O'><q id='s3W5O'><span id='s3W5O'><b id='s3W5O'><form id='s3W5O'><ins id='s3W5O'></ins><ul id='s3W5O'></ul><sub id='s3W5O'></sub></form><legend id='s3W5O'></legend><bdo id='s3W5O'><pre id='s3W5O'><center id='s3W5O'></center></pre></bdo></b><th id='s3W5O'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='s3W5O'><tfoot id='s3W5O'></tfoot><dl id='s3W5O'><fieldset id='s3W5O'></fieldset></dl></div>
                <bdo id='s3W5O'></bdo><ul id='s3W5O'></ul>

                  <tbody id='s3W5O'></tbody>
                <tfoot id='s3W5O'></tfoot>

                • 本文介紹了查找位置:Google Play 位置服務(wù)或 Android 平臺位置 API的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在嘗試為我的新導(dǎo)航應(yīng)用獲取用戶位置.我想經(jīng)常檢查用戶的位置,它必須是準確的.我使用示例中的以下代碼來獲取位置.

                  i am trying to get the users location for my new navigation app. i want to check the users location frequently and it has to be accurate . I use the following code from sample to get the location .

                  public class MainActivity extends Activity implements LocationListener {
                  private LocationManager locationManager;
                  private String provider;
                  private TextView a;
                  private TextView b;
                  
                  @Override
                  public void onCreate(Bundle savedInstanceState) {
                  
                      super.onCreate(savedInstanceState);
                      setContentView(R.layout.activity_main);
                  
                      a = (TextView) findViewById(R.id.a);
                      b = (TextView) findViewById(R.id.b);
                  
                      locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
                      Criteria criteria = new Criteria();
                      provider = locationManager.getBestProvider(criteria, false);
                      Location location = locationManager.getLastKnownLocation(provider);
                  
                      if (location != null) {
                          System.out.println("Provider " + provider + " has been selected.");
                          onLocationChanged(location);
                      } else {
                          a.setText("Location not available");
                          b.setText("Location not available");
                      }
                  }
                  
                  @Override
                  protected void onResume() {
                      super.onResume();
                      locationManager.requestLocationUpdates(provider,0, 1, this);
                  }
                  
                  @Override
                  protected void onPause() {
                      super.onPause();
                      locationManager.removeUpdates(this);
                  }
                  
                  @Override
                  public void onLocationChanged(Location location) {
                      Double lat =  location.getLatitude();
                      Double lng =  location.getLongitude();
                      a.setText(String.valueOf(lat));
                      b.setText(String.valueOf(lng));
                  }
                  
                  @Override
                  public void onStatusChanged(String provider, int status, Bundle extras) {
                      // TODO Auto-generated method stub
                  
                  }
                  
                  @Override
                  public void onProviderEnabled(String provider) {
                      Toast.makeText(this, "Enabled new provider " + provider,
                              Toast.LENGTH_SHORT).show();
                  
                  }
                  
                  @Override
                  public void onProviderDisabled(String provider) {
                      Toast.makeText(this, "Disabled provider " + provider,
                              Toast.LENGTH_SHORT).show();
                  }
                  }
                  

                  但是當(dāng)我移動時,位置坐標并沒有更新,我總是得到一個恒定的值......有沒有更好的方法來獲取位置?根據(jù) android 文檔,我可以為此使用 Google Play 位置服務(wù)或 Android 平臺位置 API.我檢查了兩者的示例代碼,它實現(xiàn)了 LocationListener 接口來獲取用戶位置.那么它們之間的實際區(qū)別是什么?

                  But location cordinates are not updating as i move,i get a constant value always ... is there any better way to get location ? According to to android docs i can use Google Play Location Service or Android platform location APIs for this . I checked the sample code for both and it implements the LocationListener interface to get the user location .So whats the actual difference between them?

                  推薦答案

                  絕對使用新的 google play 定位服務(wù).他們在室內(nèi)的工作比舊的位置經(jīng)理好得多.我創(chuàng)建了一個使用新的 google play 位置服務(wù)并定期在后臺運行的示例.看看吧:

                  Absolutely use the new google play location services. They work much better indoors than the old location manager. I have created a sample that uses the new google play location services and works in the background periodically. Check it out:

                  https://github.com/nickfox/GpsTracker/tree/master/phoneClients/android

                  這篇關(guān)于查找位置:Google Play 位置服務(wù)或 Android 平臺位置 API的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Help calculating X and Y from Latitude and Longitude in iPhone(幫助從 iPhone 中的緯度和經(jīng)度計算 X 和 Y)
                  Get user#39;s current location using GPS(使用 GPS 獲取用戶的當(dāng)前位置)
                  IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                  How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                  CLLocation returning negative speed(CLLocation 返回負速度)
                  How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網(wǎng)絡(luò)提供商)
                      <bdo id='M0mWD'></bdo><ul id='M0mWD'></ul>

                      <small id='M0mWD'></small><noframes id='M0mWD'>

                        <i id='M0mWD'><tr id='M0mWD'><dt id='M0mWD'><q id='M0mWD'><span id='M0mWD'><b id='M0mWD'><form id='M0mWD'><ins id='M0mWD'></ins><ul id='M0mWD'></ul><sub id='M0mWD'></sub></form><legend id='M0mWD'></legend><bdo id='M0mWD'><pre id='M0mWD'><center id='M0mWD'></center></pre></bdo></b><th id='M0mWD'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='M0mWD'><tfoot id='M0mWD'></tfoot><dl id='M0mWD'><fieldset id='M0mWD'></fieldset></dl></div>
                        <legend id='M0mWD'><style id='M0mWD'><dir id='M0mWD'><q id='M0mWD'></q></dir></style></legend>
                          <tfoot id='M0mWD'></tfoot>

                              <tbody id='M0mWD'></tbody>
                            主站蜘蛛池模板: 亚洲www啪成人一区二区 | 国产在线二区 | 久草新视频 | 成人免费视频观看视频 | 成人av播放 | 毛片免费在线 | 7777奇米影视| 人人爽日日躁夜夜躁尤物 | 国产精品视频二区三区 | 亚洲第一视频网 | 亚洲视频免费 | 免费国产一区二区 | 亚洲图片视频一区 | 玖玖国产精品视频 | 国产精品久久久亚洲 | 欧美性受xxx | 91精品久久久久久久久99蜜臂 | 国产激情视频在线 | 久久最新精品视频 | 色婷婷综合久久久久中文一区二区 | 亚洲欧美在线视频 | 国产精品美女久久久久久免费 | 成人久草 | 超级黄色一级片 | 成人在线影视 | 国产高清视频在线观看 | 国产99久久久国产精品下药 | 色橹橹欧美在线观看视频高清 | 精品伊人久久 | 欧美视频在线看 | 九九九久久国产免费 | 国内久久精品 | 久久久蜜桃 | 久久国产欧美日韩精品 | 国产美女久久久 | 久久99精品久久久久子伦 | 一区二区三区中文字幕 | 国产精品一区一区三区 | 久久久久久久亚洲精品 | 欧美日韩一区二区在线 | 啪视频在线 |