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

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

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

    <tfoot id='KTmXw'></tfoot>

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

    1. <legend id='KTmXw'><style id='KTmXw'><dir id='KTmXw'><q id='KTmXw'></q></dir></style></legend>
      1. 使用 Wifi 時查找當前位置有效,但使用 GPS 時失敗

        Finding current location works when using Wifi, but fails when using GPS(使用 Wifi 時查找當前位置有效,但使用 GPS 時失敗)
      2. <i id='nPY6z'><tr id='nPY6z'><dt id='nPY6z'><q id='nPY6z'><span id='nPY6z'><b id='nPY6z'><form id='nPY6z'><ins id='nPY6z'></ins><ul id='nPY6z'></ul><sub id='nPY6z'></sub></form><legend id='nPY6z'></legend><bdo id='nPY6z'><pre id='nPY6z'><center id='nPY6z'></center></pre></bdo></b><th id='nPY6z'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='nPY6z'><tfoot id='nPY6z'></tfoot><dl id='nPY6z'><fieldset id='nPY6z'></fieldset></dl></div>

            <legend id='nPY6z'><style id='nPY6z'><dir id='nPY6z'><q id='nPY6z'></q></dir></style></legend>
          • <tfoot id='nPY6z'></tfoot>
            • <bdo id='nPY6z'></bdo><ul id='nPY6z'></ul>

                <tbody id='nPY6z'></tbody>

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

                  本文介紹了使用 Wifi 時查找當前位置有效,但使用 GPS 時失敗的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我開發了一個使用 GPS 查找用戶位置的應用程序.

                  I have developed an application to find the user's location using GPS.

                  這里沒有錯誤.它使用 Wifi 正確找到位置,但在 GPS 模式下它不返回任何值.我在清單中添加了所需的權限,并且 GPS 已打開.

                  In this there is no error. It finds the location using Wifi correctly, but in GPS mode it doesn't return any values. I added the needed permission in the manifest and GPS is on.

                  誰能告訴我如何使用 Gps 獲取位置?

                  Can someone please tell me how to get the location using Gps?

                  我在這里包含了我的代碼:

                  I have included my code here:

                  package c.g.a.loation;
                  
                  public class UseGps extends Activity {
                  
                      @Override
                      public void onCreate(Bundle savedInstanceState) {
                          super.onCreate(savedInstanceState);
                          LocationManager mlocManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
                          LocationListener mlocListener = new MyLocationListener();
                          mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,
                                  mlocListener);
                      }
                  
                      /* Class My Location Listener */
                      public class MyLocationListener implements LocationListener {
                  
                          @Override
                          public void onLocationChanged(Location loc) {
                              Geocoder gp = new Geocoder(getBaseContext());
                              try {
                                  ArrayList<Address> address = (ArrayList<Address>) gp
                                          .getFromLocation(loc.getLatitude(), loc.getLongitude(),
                                                  1);
                                  if (address != null && address.size() > 0) {
                                      Toast.makeText(getBaseContext(), address.get(0).toString(),
                                              Toast.LENGTH_LONG).show();
                                  }
                              } catch (IOException e) {
                                  e.printStackTrace();
                              }
                          }
                  
                          @Override
                          public void onProviderDisabled(String provider) {}
                  
                          @Override
                          public void onStatusChanged(String arg0, int arg1, Bundle arg2) {}
                  
                          @Override
                          public void onProviderEnabled(String arg0) {}
                      }
                  
                      public void onProviderEnabled(String provider) {
                          // Toast.makeText(
                          // getApplicationContext(),"Gps Enabled",Toast.LENGTH_SHORT).show();
                      }
                  
                      public void onStatusChanged(String provider, int status, Bundle extras) {}
                  }
                  

                  推薦答案

                  我有兩個想法...

                  1. 您的代碼未檢查以確保 GPS 提供程序已啟用.我看到注釋掉的代碼在啟用任何提供程序時發送 Toast,但您可能需要檢查是否在 onCreate() 中啟用了 GPS 提供程序.

                  1. Your code is not checking to make sure the GPS provider is enabled. I see commented out code send a Toast when ANY provider is enabled, but you might want to check that the GPS provider is enabled in onCreate().

                  您需要等待多長時間才能獲得 GPS 位置?GPS_PROVIDER 有時可能需要一段時間才能獲得 GPS 定位.我已經在兩分鐘前看到了 TTFF(修復拳頭的時間)值.更糟糕的是,我發現不同版本的 Android 以及不同的設備在 TTFF 上存在巨大差異.

                  How long are you waiting to get the GPS location? The GPS_PROVIDER can sometimes take a while to get a GPS fix. I have seen TTFF (time to fist fix) values of over two minutes before. To make matters worse, I have seen drastic TTFF differences in different versions of Android as well as different devices.

                  我建議您也嘗試從其他應用獲取 GPS 定位,看看需要多長時間.我通常會啟動谷歌地圖或 GPS 狀態(從市場上免費),以了解他們需要多長時間才能獲得 GPS 修復.如果您嘗試使用 Google 地圖,請確保它正在獲取 GPS 定位,而不僅僅是來自 NETWORK_PROVIDER 的位置(屏幕頂部的 GPS 圖標應該停止閃爍).

                  I would recommend that you also try getting a GPS fix from another app to see how long that takes. I generally launch either Google Maps, or GPS Status (free from the market) to get a feeling for how long they take to get a GPS fix. If you try Google Maps, be sure that it is getting the GPS fix and not only a location from the NETWORK_PROVIDER (the GPS icon at the top of your screen should stop flashing).

                  這篇關于使用 Wifi 時查找當前位置有效,但使用 GPS 時失敗的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  Help calculating X and Y from Latitude and Longitude in iPhone(幫助從 iPhone 中的緯度和經度計算 X 和 Y)
                  Get user#39;s current location using GPS(使用 GPS 獲取用戶的當前位置)
                  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 或網絡提供商)

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

                  <tfoot id='eJ0yh'></tfoot>

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

                          1. 主站蜘蛛池模板: 欧美一区二区大片 | 国产欧美日韩在线一区 | 日韩三级电影在线看 | 久久精彩 | 亚洲高清视频在线观看 | 综合五月婷 | 在线播放第一页 | 日韩高清一区 | 免费看黄色片 | 青青草av网站 | 国产精品视频中文字幕 | 一级毛片视频在线观看 | 久久综合一区二区三区 | 成人一级黄色毛片 | 老头搡老女人毛片视频在线看 | 美女爽到呻吟久久久久 | 国产中文视频 | av一区二区在线观看 | 成人精品国产一区二区4080 | 日韩成人一区二区 | 精品视频一区二区三区在线观看 | 国产精品欧美一区喷水 | 国产一级免费视频 | 毛片视频网站 | 日韩成人免费av | 欧美成人手机在线 | 中文字幕三区 | 91视频在线 | 国产高清在线 | 高清国产午夜精品久久久久久 | 精品国产一区二区在线 | 精品国产鲁一鲁一区二区张丽 | 久色一区| 蜜月va乱码一区二区三区 | 中文字幕日韩欧美一区二区三区 | 久久久久久av | 久久精品国产久精国产 | 日韩欧美在线视频观看 | 久久国产精品久久 | 一区二区在线不卡 | 一区在线观看 |