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

<tfoot id='rKSuj'></tfoot>

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

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

      使用 LocationClient 定期獲取更新最省電的方法是什

      What#39;s the most battery-efficient approach of using LocationClient to periodically get updates?(使用 LocationClient 定期獲取更新最省電的方法是什么?)
        <i id='zdBDG'><tr id='zdBDG'><dt id='zdBDG'><q id='zdBDG'><span id='zdBDG'><b id='zdBDG'><form id='zdBDG'><ins id='zdBDG'></ins><ul id='zdBDG'></ul><sub id='zdBDG'></sub></form><legend id='zdBDG'></legend><bdo id='zdBDG'><pre id='zdBDG'><center id='zdBDG'></center></pre></bdo></b><th id='zdBDG'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='zdBDG'><tfoot id='zdBDG'></tfoot><dl id='zdBDG'><fieldset id='zdBDG'></fieldset></dl></div>
            <tbody id='zdBDG'></tbody>

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

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

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

                本文介紹了使用 LocationClient 定期獲取更新最省電的方法是什么?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                我正在考慮設(shè)置兩個(gè)單獨(dú)的警報(bào)來每小時(shí)收集用戶的位置數(shù)據(jù),一個(gè)每 59 分鐘觸發(fā)一次以連接"客戶端,另一個(gè)用于實(shí)際獲取位置,然后斷開客戶端.

                I am thinking about having two separate alarms to gather a user's location data every hour, one that goes off every 59 minutes to "connect" the client and a second to actually get the location and then subsequently disconnect the client.

                在電池壽命方面,如果獲取用戶的位置將成為應(yīng)用程序的主要消耗,我還應(yīng)該考慮做些什么?或者,是否有不同的方法來設(shè)置兩個(gè)警報(bào)?我最初只有一個(gè)警報(bào),但執(zhí)行 (!mLocationClient.isConnected) 然后進(jìn)行連接檢查并沒有給客戶端足夠的時(shí)間來連接.

                In terms of battery life, is there anything else I should consider doing if getting the user's location will be the primary drain of the app? Or, is there a different approach to having two alarms? I originally only had a single alarm, but performing a (!mLocationClient.isConnected) then connect check does not give the client enough time to connect.

                感謝您的洞察力.

                兩個(gè)警報(bào)會(huì)像這樣響起:

                The two alarms would go off something like this:

                private int PERIODIC_UPDATE = 60000*60;  //gets location and disconnects every hour
                private int PERIODIC_RECONNECTION_UPDATE = 60000*59;  //connects 1 minute before getLocation call
                
                    Timer toReconnect = new Timer();
                    toReconnect.schedule(new TimerTask() {
                
                        @Override
                        public void run() {
                            mLocationClient.connect();
                        }
                    }, 5000, PERIODIC_RECONNECTION_UPDATE);
                
                    Timer theTimer = new Timer(); 
                    theTimer.schedule(new TimerTask(){
                        @Override
                        public void run() {
                            try {
                                if(!mLocationClient.isConnected()) {
                                    mLocationClient.connect();
                                    //This will not have much affect because cannot so quickly, will remove. 
                                }
                
                                Location theLocation = mLocationClient.getLastLocation();
                                if(theLocation!=null) {
                                    checkPostLocation(theLocation); 
                
                                    mLocationClient.disconnect();
                                }
                            } catch (Exception e) {
                                e.printStackTrace();
                            }   
                        }}, 5000, PERIODIC_UPDATE);
                

                推薦答案

                你真的需要跟蹤用戶嗎?

                Do you actually need to track the user?

                如果只是關(guān)于 UI,則使用 getLastKnownLocation(PASSIVE_PROVIDER),假設(shè)他們在其他地方使用手機(jī)上的定位服務(wù),您應(yīng)該會(huì)得到一些半準(zhǔn)確的信息.

                If it's just about UI, then use getLastKnownLocation(PASSIVE_PROVIDER) and you should get something semi-accurate assuming they used location services on their phone somewhere else.

                如果您需要實(shí)際對(duì)用戶進(jìn)行三角測量,請實(shí)現(xiàn)不同的供應(yīng)商使用不同的電池.被動(dòng)<網(wǎng)絡(luò)<全球定位系統(tǒng).

                If you need to actually triangulate the user, realize the different providers use different battery. Passive < Network < GPS.

                定位用戶越多,GPS 消耗的電量和時(shí)間就越多.

                The more you locate the user, the more battery with GPS taking the most battery and time.

                按計(jì)劃啟動(dòng)服務(wù),1 小時(shí)或其他任何時(shí)間,只需要一項(xiàng)服務(wù).最多只能活 1 分鐘(或更短),收聽所有位置提供商.在分鐘或準(zhǔn)確度足夠好后,您保存結(jié)果并關(guān)閉服務(wù).

                Start the service by intent one a schedule, 1 hour or whatever, only one service necessary. Only live for a maximum of 1 minute (or less), listen on all Location providers. After the minute or accuracy is good enough, you save the result and shut down the service.

                這篇關(guān)于使用 LocationClient 定期獲取更新最省電的方法是什么?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持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)度計(jì)算 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 返回負(fù)速度)
                How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網(wǎng)絡(luò)提供商)

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

                        <legend id='ZDMwH'><style id='ZDMwH'><dir id='ZDMwH'><q id='ZDMwH'></q></dir></style></legend>
                        • <bdo id='ZDMwH'></bdo><ul id='ZDMwH'></ul>
                        • <small id='ZDMwH'></small><noframes id='ZDMwH'>

                          主站蜘蛛池模板: 亚洲不卡视频 | 日韩精品一区二区三区视频播放 | 日日操日日舔 | 欧美一级片在线看 | 欧美日韩精品一区二区三区蜜桃 | 亚洲三区在线观看 | 亚洲精品视频免费 | 国产精品久久久久久久久久久免费看 | 超碰地址 | 久久久精品 | 精品日韩一区二区 | 日韩在线日韩 | 成人在线免费电影 | 亚洲人久久 | 国产日韩免费视频 | 亚洲一区二区在线视频 | 我要看免费一级毛片 | 国产精品久久久久久久久久三级 | 久久香蕉网 | 日本不卡一区 | 国产一级精品毛片 | 久久99精品视频 | 一区二区免费在线视频 | 99精品国自产在线 | 国产区在线看 | 国产精品福利一区二区三区 | 成人精品在线观看 | 精品中文在线 | 亚洲麻豆 | 亚洲欧洲一区二区 | 91精品国产色综合久久不卡98 | 国产色在线| 在线视频成人 | 不卡一二区| 成人免费视频 | 5060网一级毛片 | wwww.8888久久爱站网 | 亚洲视频一区在线播放 | 毛片大全 | av一区二区三区四区 | 超碰97在线免费 |