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

  • <tfoot id='tZosK'></tfoot>
      • <bdo id='tZosK'></bdo><ul id='tZosK'></ul>

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

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

      2. 從另一臺設備實時定位安卓設備

        Realtime locating of the android device from another device(從另一臺設備實時定位安卓設備)

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

                1. <small id='tQkXi'></small><noframes id='tQkXi'>

                  <legend id='tQkXi'><style id='tQkXi'><dir id='tQkXi'><q id='tQkXi'></q></dir></style></legend>

                  本文介紹了從另一臺設備實時定位安卓設備的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個應用程序,我想在其中找到設備的確切位置.就像你坐出租車一樣,我想找到出租車的確切位置.出租車司機將使用安卓設備.因此,我想通過該設備為其他想要查看出租車位置的用戶定位出租車位置.

                  I have an app where i wanted to locate the exact location of the device. Like if you take taxi, i wanted to locate where exactly the taxi. Taxi driver will be using android device. So from that device i wanted to locate the cab location for other users who wants to see where the cab is.

                  我嘗試使用 requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener) 將出租車司機的當前位置上傳到服務器,因為出租車移動了幾米,我已經完成了這個更新位置當駕駛室按下某個啟動按鈕或其他東西時,駕駛室的駕駛室會不斷發送設備的當前位置 X 米.

                  I have tried uploading current location of cab driver to server as cab moves for few meters by using requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener) and I have done this updating location of cab when the cab press some start button or something it keeps sending the current location of the device for X meters.

                  其他用戶將從該更新位置調用服務并找到出租車的當前位置.

                  From that updated location other users will call the service and find the current location of cab.

                  在用戶端會有一張地圖,他可以在其中看到出租車的當前位置.用戶調用該服務以查看更新的位置.我通過在該活動上設置 TIMER 來調用服務,因此它會一次又一次地刷新并調用服務器.(設置定時器是最好的方法或任何其他方法).

                  At user side there will be a map where he can see the current location of cab. User calls the service to see updated location. I am calling the service by setting the TIMER on that activity so it refreshes and calls the server again and again.(Setting a timer is it best approach or any other ways of doing it).

                  但這種方法需要大量數據和電池,甚至不是實時的.有沒有最好的方法來定位 android 設備,使它看起來至少是實時的.

                  But this approach takes lot of data and battery and it is not even realtime. Is there any best approach to locate the android device so that it seems to be realtime atleast.

                  推薦答案

                  Is there any best approach to locate the android device
                  

                  您可以使用GCM 服務.

                  how it will help you?
                  

                  它可以在駕駛室移動時發送帶有當前latlng(每次位置更新)的推送消息.

                  It can send push messages with current latlng (for each location update) when the cab moves.

                  前:

                  @Override
                  public void onLocationChanged(Location location) {
                      String latitude = String.valueOf(location.getLatitude());
                      String longitude= String.valueOf(location.getLongitude());
                      //Send push messages with current location
                      // sendpushMessage(from_Number, to_Number/s, "Location "+ latitude +" "+ longitude;
                  }
                  

                  您可以重復啟動 IntentService,然后是 AlarmManager,并在每 5/10 秒內發送消息(位置),并在您喜歡時停止(例如,當 cab 在用戶位置范圍內時或類似情況時).

                  You can start repetitively an IntentService followed by AlarmManager and send messages(location) in each 5/10 seconds and stop whenever you like (e.g when cab is in range of user's location or something like this).

                  在用戶的設備中,您可以收到有關出租車司機更改位置的消息.只需將這些更新的位置放在地圖中并顯示給用戶.所以用戶可以完美地看到正在運行的駕駛室.

                  In user's device you can get messages with cab driver's changing location. Just put these updated locations in map and show to the user. So the user can see the running cab perfectly.

                  在用戶的設備中.. EX:

                  In User's Device.. EX:

                  GCMIntentService 的 onMessage() 方法中獲取所有消息,例如:

                   @Override
                  protected void onMessage(Context context, Intent intent) {
                     String message = intent.getExtras().getString("message");
                     //tokenize the string and get driver's location(latitude, longitude)
                     //then update each latlng and show cab marker in user's map with a static method
                  }
                  

                  注意:我們總是從這里開始通知(onMessage()).所以請確保您沒有使用任何通知,否則它會通過帶有新位置消息的多個通知來干擾用戶.

                  這種方法對電池很有幫助.此外,您不必每次都檢查服務器以繼續更新.它會在您需要時自動將消息推送到用戶的設備,并且接收者可以完美地接收每條消息.

                  This approach is very helpful for battery. Also you don;t have to check the server each time for continue update. it will automatically push messages to user's device whenever you want and the receiver can able to receive each message perfectly.

                  這篇關于從另一臺設備實時定位安卓設備的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 有多可靠,多久更新一次?)
                  How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網絡提供商)
                  Get current location during app launch(在應用啟動期間獲取當前位置)
                    • <i id='qUMlx'><tr id='qUMlx'><dt id='qUMlx'><q id='qUMlx'><span id='qUMlx'><b id='qUMlx'><form id='qUMlx'><ins id='qUMlx'></ins><ul id='qUMlx'></ul><sub id='qUMlx'></sub></form><legend id='qUMlx'></legend><bdo id='qUMlx'><pre id='qUMlx'><center id='qUMlx'></center></pre></bdo></b><th id='qUMlx'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='qUMlx'><tfoot id='qUMlx'></tfoot><dl id='qUMlx'><fieldset id='qUMlx'></fieldset></dl></div>

                      <tfoot id='qUMlx'></tfoot>

                        <bdo id='qUMlx'></bdo><ul id='qUMlx'></ul>

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

                              <tbody id='qUMlx'></tbody>
                          • <legend id='qUMlx'><style id='qUMlx'><dir id='qUMlx'><q id='qUMlx'></q></dir></style></legend>
                            主站蜘蛛池模板: 亚洲精品一区二区三区在线 | 日韩电影免费在线观看中文字幕 | 精品一二区 | www.国产精品 | 久久6| 午夜丰满寂寞少妇精品 | 亚洲精品视频在线播放 | 啪视频在线| 欧美日韩在线一区二区 | 中文字幕第5页 | 亚洲一区二区久久久 | 久久精品视频免费观看 | 精品小视频 | 国产一区二区精品在线观看 | 99av成人精品国语自产拍 | 日韩精品免费视频 | 国产精品我不卡 | 国产精品综合色区在线观看 | 欧美成人一区二免费视频软件 | 亚洲高清视频一区二区 | 中文字幕一级毛片视频 | 干干天天| www.亚洲 | 一区二区三区欧美 | 中文字幕一区二区三区日韩精品 | 国产精品福利在线 | 午夜天堂 | 免费午夜电影 | 国产欧美视频一区二区三区 | 欧美精品免费观看二区 | 97国产一区二区精品久久呦 | 伊人狠狠操 | 999精品视频 | 国产精品一区二区av | 91国产视频在线 | 午夜精品一区二区三区在线观看 | 夜夜撸av| 中文字幕一二三区 | 国产极品车模吞精高潮呻吟 | 狠狠久 | www.精品一区 |