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

    1. <legend id='L2eQ6'><style id='L2eQ6'><dir id='L2eQ6'><q id='L2eQ6'></q></dir></style></legend>

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

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

        如何使用 Phonegap 跟蹤設備位置(iOS 和 Android)設備

        How to track the device location (iOS and Android) device using Phonegap(如何使用 Phonegap 跟蹤設備位置(iOS 和 Android)設備)
        • <bdo id='hatMg'></bdo><ul id='hatMg'></ul>

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

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

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

                  本文介紹了如何使用 Phonegap 跟蹤設備位置(iOS 和 Android)設備的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我想知道用戶何時到達或離開某個位置.我嘗試使用無線網絡(檢查移動設備)來執行此操作,但由于多種原因我無法做到.

                  I would like to know when a user arrives or leaves certain location. I was trying to do this using the wireless network (check for mobile devices), but I couldn't for several reasons.

                  1) 我需要實時更新或每 1 到 5 分鐘更新一次有關哪些設備已連接以及哪些設備剛剛斷開連接的信息.

                  1) I needed real time updates or every 1 - 5 min of the information about which devices are connected and which devices have just disconnected.

                  2) 我在同一網絡上從我的 PC 到我的 iPhone 的 ping 非常高(仍然不知道為什么).

                  2) I had very high ping from my PC to my iPhone on the same network (still don't know why).

                  現在我想使用在 iOS 上暫停或在 Android 中在后臺運行的 Phonegap 應用程序(在后臺運行)的地理定位.

                  Now I want to do it using geolocation from a Phonegap application (running in the background) suspended on iOS or running in the background in Android.

                  任何幫助將不勝感激.

                  推薦答案

                  2019 年 5 月 25 日更新

                  我下面的原始答案是 6 歲,相對于當前的移動操作系統版本已經過時.例如,部分喚醒鎖不再適用于現代 Android 版本.

                  My original answer below is 6 years old and out-of-date with respect to current mobile OS versions. For example partial wakelocks no longer work on modern Android versions.

                  今天我的建議是(如果你有一個嚴肅的商業應用程序而不是一個愛好項目)使用付費版本的 cordova-background-geolocation 插件 by 晶體管軟件.免費版適用于 iOS,但對于 Android 則需要許可證,費用約為數百美元.但是我認為這個價格是值得的:在我 10 多年創建位置感知移動應用程序的經驗中,這是我遇到的最復雜和最可靠的解決方案.只需支付許可證費用,您就可以訪問不斷更新和維護的私有存儲庫,以兼容新版本的 Android 和iOS.

                  Today my recommendation would be (if you have a serious commercial app and not a hobby project) to use the paid-for version of the cordova-background-geolocation plugin by Transistorsoft. The free version works for iOS but for Android a license is required which costs in the order of several hundred US dollars. However I think the price is worth it: in my 10+ years of experience in creating location-aware mobile apps, this has been the most sophisiticated and reliable solution I've encountered. For the cost of your license, you get access to the private repo which is continually updated and maintained to be compatible with new versions of Android & iOS.

                  如果您正在尋找免費/開源解決方案,我會選擇 cordova-plugin-background-geolocation 這是 Transistorsoft 原始插件的開源分支.然而,我對這個插件的體驗好壞參半;由于是免費/開源的,它沒有像付費的 Transistorsoft 插件那樣頻繁更新.由于最近版本的 Android 中對后臺位置的新的更嚴格的限制,我遇到了問題,這需要很長時間才能解決或根本沒有得到修復(請參閱插件的 問題列表).

                  If you're looking for a free/open-source solution, I would go with cordova-plugin-background-geolocation which is an open-source fork of the original plugin by Transistorsoft. However my experience with this plugin has been of mixed success; due to being free/open-source, it's not updated as frequently as the paid-for Transistorsoft plugin. I encountered problems due to new more stringent restrictions on background location in recent versions of Android which took a significant time to be resolved or have not been fixed at all (see the plugin's issue list).

                  原始答案(2013 年 6 月 11 日)

                  首先要說的是,創建一個在后臺運行時接收位置更新的 Phonegap 應用程序是完全可能的,但并非易事.我自己完成了,并在 Android 和 iOS 平臺上發布了應用程序.

                  The first thing to say is that creating a Phonegap app that receives location updates while running in the background is entirely possible, but not trivial. I've done it myself and released apps on both the Android and iOS platforms.

                  如果您需要準確且定期的位置更新,我建議您在目標設備上使用 GPS 接收器.在 Phonegap 中,您可以在請求位置更新時設置highAccuracy"標志.watchPosition() 函數將在設備接收到來自 GPS 接收器的更新時提供新的位置信息,因此您可以像這樣使用它:

                  If you need accurate and regular position updates, I'd suggest using the GPS receiver on the target devices. In Phonegap, you can do this setting the "highAccuracy" flag when requesting position updates. The watchPosition() function will deliver new position information as and when the device receives updates from the GPS receiver, so you use it something like this:

                  navigator.geolocation.watchPosition(successCallback, errorCallback, {
                    enableHighAccuracy: true,
                    timeout: 10000,
                    maximumAge: 0
                  });
                  

                  請參閱 Phonegap 地理位置 API 文檔了解更多詳細信息(請注意在 Android 和 iOS 上進行此操作所需的權限).

                  See the Phonegap geolocation API documentation for more details (note the permissions that are required to make this work on Android and iOS).

                  要讓您的應用在 Android 或 iOS 上的后臺運行,您需要設置各自的原生開發環境:適用于 Android 的 Eclipse,適用于 iOS 的 XCode.您將無法使用 Phonegap Build,因為在這兩種情況下都需要自定義設置才能使其正常工作.請參閱 Phonegap 平臺指南了解如何做到這一點.

                  To keep your app running in the background on either Android or iOS you will need to setup their respective native development environments: Eclipse for Android, XCode for iOS. You will not be able to use Phonegap Build because custom settings are needed in both cases to make it work. See the Phonegap platform guides for how to do this.

                  要讓您的應用在 Android 后臺運行,您需要編寫自定義 Android 服務,或者您可以像我一樣使用 Phonegap 插件獲取部分喚醒鎖"(看這里) 讓您的應用程序在后臺運行并在屏幕關閉時接收位置更新.請注意,此插件的原始版本已過時-date 并且不適用于更新版本的 Phonegap,也不支持部分喚醒鎖.但是,我已經對其進行了更新和擴展以供我自己使用:您可以在我對 這個問題.

                  To keep your app running in the background on Android, you either need to write a custom Android service, or you could do what I did and use a Phonegap plugin to acquire a "partial wakelock" (see here) to keep your app running in the background and receive position updates while the screen is off. Note that the original version of this plugin is out-of-date and doesn't work with more recent versions of Phonegap, and also doesn't support partial wakelocks. However, I've updated and extended it for my own use: you can find the source code for it in my answer to this question.

                  為了讓您的應用在 iOS 上保持在后臺運行,您需要做些不同的事情;您不需要插件,只需一個項目設置.

                  To keep your app running in the background on iOS, you need to do things slightly differently; you don't need a plugin, just a project setting.

                  您可以手動編輯項目 .plist 并添加值為location"的鍵UIBackgroundModes"鍵,或者在 XCode 中打開項目后,添加值為App"的Required Background Modes"鍵注冊位置更新".這將導致 iOS 在每次收到位置更新時觸發您使用 watchPosition() 注冊的 JS 回調函數.查看這里了解更多關于iOS 項目密鑰和后臺模式.

                  You can either manually edit the project .plist and add the key "UIBackgroundModes" key with a value of "location" or, with your project open in XCode, add the "Required Background Modes" key with a value of "App registers for location updates". This will cause iOS to trigger the JS callback function you have registered with watchPosition() each time a location update is received. See here for more about iOS project keys and background modes.

                  希望這會有所幫助!

                  這篇關于如何使用 Phonegap 跟蹤設備位置(iOS 和 Android)設備的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='CNVDR'></small><noframes id='CNVDR'>

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

                              <tbody id='CNVDR'></tbody>
                            主站蜘蛛池模板: 亚洲精品片 | 在线免费观看黄色av | 亚洲一区二区视频 | 日本一级淫片免费啪啪3 | 一级片aaa | 羞羞的视频免费在线观看 | 精品永久 | 欧美一级艳情片免费观看 | 拍真实国产伦偷精品 | 在线中文字幕视频 | 欧美久久久久久久久 | 一二区视频 | 日韩精品一区二区三区在线 | 自拍 亚洲 欧美 老师 丝袜 | 成人精品视频99在线观看免费 | 一级片免费在线观看 | 久久久久久久久99 | 久久91精品 | 蜜桃av鲁一鲁一鲁一鲁 | 亚洲精品在线免费 | 国产精品久久久久久亚洲调教 | 亚洲第一视频 | 91精品国产一区二区三区 | 欧美成人a∨高清免费观看 欧美日韩中 | 国产成人福利视频 | 91精品国产自产在线老师啪 | 欧美在线一区二区三区 | 神马九九 | 日韩乱码av| 日本免费一区二区三区四区 | 欧美高清免费 | 国产一区二区三区四区 | 日韩精品久久久久久 | 亚洲国产精品一区二区www | 日韩欧美在线播放 | 欧美黄色一级毛片 | 久久久久99 | 成人精品鲁一区一区二区 | 伊人热久久 | 日日日操 | 久久久久久综合 |