81 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
83 <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
84 <title>LocationRequest | Android Developers</title>
87 <link rel="stylesheet"
88 href="//fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic,bold" title="roboto">
89 <link href="/assets/css/default.css" rel="stylesheet" type="text/css">
94 <script src="//www.google.com/jsapi" type="text/javascript"></script>
95 <script src="/assets/js/android_3p-bundle.js" type="text/javascript"></script>
96 <script type="text/javascript">
100 <script src="/assets/js/docs.js" type="text/javascript"></script>
102 <script type="text/javascript">
103 var _gaq = _gaq || [];
104 _gaq.push(['_setAccount', 'UA-5831155-1']);
105 _gaq.push(['_trackPageview']);
108 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
109 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
110 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
114 <body class="gc-documentation google
115 develop" itemscope itemtype="http://schema.org/Article">
116 <div id="doc-api-level" class="" style="display:none"></div>
123 <div class="wrap" id="header-wrap">
124 <div class="col-3 logo">
125 <a href="/index.html">
126 <img src="/assets/images/dac_logo.png" width="123" height="25" alt="Android Developers" />
128 <div class="btn-quicknav" id="btn-quicknav">
129 <a href="#" class="arrow-inactive">Quicknav</a>
130 <a href="#" class="arrow-active">Quicknav</a>
133 <ul class="nav-x col-9">
135 <a href="/design/index.html"
138 ru-lang="Проектирование"
143 <li class="develop"><a href="/develop/index.html"
149 es-lang="Desarrollar"
151 <li class="distribute last"><a href="/distribute/index.html"
154 ru-lang="Распространение"
162 <div class="menu-container">
163 <div class="moremenu">
164 <div id="more-btn"></div>
166 <div class="morehover" id="moremenu">
167 <div class="top"></div>
169 <div class="header">Links</div>
171 <li><a href="https://play.google.com/apps/publish/">Google Play Developer Console</a></li>
172 <li><a href="http://android-developers.blogspot.com/">Android Developers Blog</a></li>
173 <li><a href="/about/index.html">About Android</a></li>
175 <div class="header">Android Sites</div>
177 <li><a href="http://www.android.com">Android.com</a></li>
178 <li class="active"><a>Android Developers</a></li>
179 <li><a href="http://source.android.com">Android Open Source Project</a></li>
184 <div class="header">Language</div>
185 <div id="language" class="locales">
186 <select name="language" onChange="changeLangPref(this.value, true)">
187 <option value="en">English</option>
188 <option value="es">Español</option>
189 <option value="ja">日本語</option>
190 <option value="ko">한국어</option>
191 <option value="ru">Русский</option>
192 <option value="zh-cn">中文 (中国)</option>
193 <option value="zh-tw">中文 (台灣)</option>
196 <script type="text/javascript">
205 <br class="clearfix" />
207 <div class="bottom"></div>
209 <div class="search" id="search-container">
210 <div class="search-inner">
211 <div id="search-btn"></div>
212 <div class="left"></div>
213 <form onsubmit="return submit_search()">
214 <input id="search_autocomplete" type="text" value="" autocomplete="off" name="q"
215 onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)"
216 onkeydown="return search_changed(event, true, '/')"
217 onkeyup="return search_changed(event, false, '/')" />
219 <div class="right"></div>
220 <a class="close hide">close</a>
221 <div class="left"></div>
222 <div class="right"></div>
226 <div class="search_filtered_wrapper reference">
227 <div class="suggest-card reference no-display">
228 <ul class="search_filtered">
233 <div class="search_filtered_wrapper docs">
234 <div class="suggest-card dummy no-display"> </div>
235 <div class="suggest-card develop no-display">
236 <ul class="search_filtered">
238 <div class="child-card guides no-display">
240 <div class="child-card training no-display">
243 <div class="suggest-card design no-display">
244 <ul class="search_filtered">
247 <div class="suggest-card distribute no-display">
248 <ul class="search_filtered">
257 <!-- Expanded quicknav -->
258 <div id="quicknav" class="col-9">
262 <li><a href="/design/index.html">Get Started</a></li>
263 <li><a href="/design/style/index.html">Style</a></li>
264 <li><a href="/design/patterns/index.html">Patterns</a></li>
265 <li><a href="/design/building-blocks/index.html">Building Blocks</a></li>
266 <li><a href="/design/downloads/index.html">Downloads</a></li>
267 <li><a href="/design/videos/index.html">Videos</a></li>
272 <li><a href="/training/index.html"
278 es-lang="Capacitación"
280 <li><a href="/guide/components/index.html"
283 ru-lang="Руководства по API"
286 es-lang="Guías de la API"
288 <li><a href="/reference/packages.html"
296 <li><a href="/tools/index.html"
299 ru-lang="Инструменты"
302 es-lang="Herramientas"
304 <ul><li><a href="/sdk/index.html">Get the SDK</a></li></ul>
306 <li><a href="/google/index.html">Google Services</a>
310 <li class="distribute last">
312 <li><a href="/distribute/index.html">Google Play</a></li>
313 <li><a href="/distribute/googleplay/publish/index.html">Publishing</a></li>
314 <li><a href="/distribute/googleplay/promote/index.html">Promoting</a></li>
315 <li><a href="/distribute/googleplay/quality/index.html">App Quality</a></li>
316 <li><a href="/distribute/googleplay/spotlight/index.html">Spotlight</a></li>
317 <li><a href="/distribute/open.html">Open Distribution</a></li>
322 <!-- /Expanded quicknav -->
328 <div id="searchResults" class="wrap" style="display:none;">
329 <h2 id="searchTitle">Results</h2>
330 <div id="leftSearchControl" class="search-control">Loading...</div>
335 <!-- Secondary x-nav -->
338 <ul class="nav-x col-9 develop" style="width:100%">
339 <li class="training"><a href="/training/index.html"
345 es-lang="Capacitación"
347 <li class="guide"><a href="/guide/components/index.html"
350 ru-lang="Руководства по API"
353 es-lang="Guías de la API"
355 <li class="reference"><a href="/reference/packages.html"
363 <li class="tools"><a href="/tools/index.html"
366 ru-lang="Инструменты"
369 es-lang="Herramientas"
371 <li class="google"><a href="/google/index.html"
378 <!-- /Sendondary x-nav -->
388 <div class="wrap clearfix" id="body-content">
389 <div class="col-4" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
390 <div id="devdoc-nav" class="scroll-pane">
391 <a class="totop" href="#top" data-g-event="left-nav-top">to top</a>
397 <li class="nav-section">
398 <div class="nav-section-header empty"><a href="/google/index.html">
399 <span class="en">Overview</span>
403 <li class="nav-section">
404 <div class="nav-section-header empty"><a href="/google/play-services/games.html">
405 <span class="en">Games</span>
408 <li class="nav-section">
409 <div class="nav-section-header empty"><a href="/google/play-services/location.html">
410 <span class="en">Location</span>
413 <li class="nav-section">
414 <div class="nav-section-header empty"><a href="/google/play-services/plus.html">
415 <span class="en">Google+</span>
418 <li class="nav-section">
419 <div class="nav-section-header empty"><a href="/google/play-services/maps.html">
420 <span class="en">Google Maps</span>
423 <li class="nav-section">
424 <div class="nav-section-header empty"><a href="/google/play-services/auth.html">
425 <span class="en">Authorization</span>
431 <li class="nav-section">
432 <div class="nav-section-header"><a href="/google/play-services/index.html">
433 <span class="en">Google Play Services</span></a>
436 <li><a href="/google/play-services/setup.html">
437 <span class="en">Setup</span></a>
439 <li id="gms-tree-list" class="nav-section">
440 <div class="nav-section-header">
441 <a href="/reference/gms-packages.html">
442 <span class="en">Reference</span>
450 <li class="nav-section">
451 <div class="nav-section-header"><a href="/google/play/billing/index.html">
452 <span class="en">Google Play In-app Billing</span></a>
455 <li><a href="/google/play/billing/billing_overview.html">
456 <span class="en">Overview</span></a>
458 <li class="nav-section"><div class="nav-section-header"><a href="/google/play/billing/api.html">
459 <span class="en">Version 3 API</span></a></div>
461 <li><a href="/google/play/billing/billing_integrate.html">
462 <span class="en">Implementing the API</span></a></li>
463 <li><a href="/google/play/billing/billing_reference.html">
464 <span class="en">Reference</span></a></li>
467 <li class="nav-section"><div class="nav-section-header"><a href="/google/play/billing/v2/api.html">
468 <span class="en">Version 2 API</span></a></div>
470 <li><a href="/google/play/billing/v2/billing_integrate.html">
471 <span class="en">Implementing the API</span></a></li>
472 <li><a href="/google/play/billing/v2/billing_subscriptions.html">
473 <span class="en">Subscriptions</span></a></li>
474 <li><a href="/google/play/billing/v2/billing_reference.html">
475 <span class="en">Reference</span></a></li>
478 <li><a href="/google/play/billing/billing_subscriptions.html">
479 <span class="en">Subscriptions</span></a>
481 <li><a href="/google/play/billing/billing_best_practices.html">
482 <span class="en">Security and Design</span></a>
484 <li><a href="/google/play/billing/billing_testing.html">
485 <span class="en">Testing In-app Billing</span></a>
487 <li><a href="/google/play/billing/billing_admin.html">
488 <span class="en">Administering In-app Billing</span></a>
490 <li><a href="/google/play/billing/gp-purchase-status-api.html">
491 <span class="en">Purchase Status API</span></a>
493 <li><a href="/google/play/billing/versions.html">
494 <span class="en">Version Notes</span></a>
501 <li class="nav-section">
502 <div class="nav-section-header"><a href="/google/gcm/index.html">
503 <span class="en">Google Cloud Messaging</span></a>
506 <li><a href="/google/gcm/gs.html">
507 <span class="en">Getting Started</span></a>
509 <li><a href="/google/gcm/gcm.html">
510 <span class="en">Architectural Overview</span></a>
512 <li><a href="/google/gcm/ccs.html">
513 <span class="en">Cloud Connection Server</span></a>
515 <li><a href="/google/gcm/notifications.html">
516 <span class="en">User Notifications</span></a>
518 <li><a href="/google/gcm/client.html">
519 <span class="en">GCM Client</span></a>
521 <li><a href="/google/gcm/server.html">
522 <span class="en">GCM Server</span></a>
524 <li><a href="/google/gcm/adv.html">
525 <span class="en">Advanced Topics</span></a>
527 <li><a href="/google/gcm/c2dm.html">
528 <span class="en">Migration</span></a>
530 <li id="gcm-tree-list" class="nav-section">
531 <div class="nav-section-header">
532 <a href="/reference/gcm-packages.html">
533 <span class="en">Reference</span>
540 <li class="nav-section">
541 <div class="nav-section-header"><a href="/google/play/dist.html">
542 <span class="en">Google Play Distribution</span></a>
545 <li><a href="/google/play/filters.html">
546 <span class="en">Filters on Google Play</span></a>
549 <li><a href="/google/play/publishing/multiple-apks.html">
550 <span class="en">Multiple APK Support</span></a>
552 <li><a href="/google/play/expansion-files.html">
553 <span class="en">APK Expansion Files</span></a>
555 <li class="nav-section">
556 <div class="nav-section-header"><a href="/google/play/licensing/index.html">
557 <span class="en">Application Licensing</span></a>
560 <li><a href="/google/play/licensing/overview.html">
561 <span class="en">Licensing Overview</span></a>
563 <li><a href="/google/play/licensing/setting-up.html">
564 <span class="en">Setting Up for Licensing</span></a>
566 <li><a href="/google/play/licensing/adding-licensing.html">
567 <span class="en">Adding Licensing to Your App</span></a>
569 <li><a href="/google/play/licensing/licensing-reference.html">
570 <span class="en">Licensing Reference</span></a>
575 <li class="nav-section">
576 <div class="nav-section-header"><a href="/google/backup/index.html">
577 Android Backup Service</a>
580 <li><a href="/google/backup/signup.html">
594 <script type="text/javascript">
597 changeNavLang(getLangPref());
605 <script type="text/javascript">
609 </div> <!-- end side-nav -->
611 $(document).ready(function() {
612 scrollIntoView("devdoc-nav");
621 <div class="col-12" id="doc-col">
623 <div id="api-info-block">
644 <div class="sum-details-links">
652 <a href="#constants">Constants</a>
656 | <a href="#inhconstants">Inherited Constants</a>
660 | <a href="#lfields">Fields</a>
667 | <a href="#pubmethods">Methods</a>
672 | <a href="#inhmethods">Inherited Methods</a>
674 | <a href="#" onclick="return toggleAllClassInherited()" id="toggleAllClassInherited">[Expand All]</a>
676 </div><!-- end sum-details-links -->
677 <div class="api-level">
683 </div><!-- end api-info-block -->
686 <!-- ======== START OF CLASS DATA ======== -->
694 <h1 itemprop="name">LocationRequest</h1>
714 </div><!-- end header -->
716 <div id="naMessage"></div>
718 <div id="jd-content" class="api apilevel-">
719 <table class="jd-inheritance-table">
724 <td colspan="2" class="jd-inheritance-class-cell">java.lang.Object</td>
730 <td class="jd-inheritance-space"> ↳</td>
732 <td colspan="1" class="jd-inheritance-class-cell">com.google.android.gms.location.LocationRequest</td>
744 <div class="jd-descr">
747 <h2>Class Overview</h2>
748 <p itemprop="articleBody">A data object that contains quality of service parameters for requests to
749 the <code><a href="/reference/com/google/android/gms/location/LocationClient.html">LocationClient</a></code>.
751 <p>LocationRequest objects are used to request a quality of service for location updates from
752 the <code><a href="/reference/com/google/android/gms/location/LocationClient.html">LocationClient</a></code>.
754 <p>For example, if your application wants high accuracy location it should create a location
755 request with <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setPriority(int)">setPriority(int)</a></code> set to <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_HIGH_ACCURACY">PRIORITY_HIGH_ACCURACY</a></code> and
756 <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">setInterval(long)</a></code> to 5 seconds. This would be appropriate for mapping applications that are
757 showing your location in real-time.
759 <p>At the other extreme, if you want negligible power impact, but to still receive location
760 updates when available, then create a location request with <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setPriority(int)">setPriority(int)</a></code> set to
761 <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_NO_POWER">PRIORITY_NO_POWER</a></code>. With this request your application will not trigger (and therefore
762 will not receive any power blame) any location updates, but will receive locations triggered by
763 other applications. This would be appropriate for applications that have no firm requirement
764 for location, but can take advantage when available.
766 <p>In between these two extremes is a very common use-case, where applications definitely want
767 to receive updates at a specified interval, and can receive them faster when available, but
768 still want a low power impact. These applications should consider
769 <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_BALANCED_POWER_ACCURACY">PRIORITY_BALANCED_POWER_ACCURACY</a></code> combined with a faster
770 <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setFastestInterval(long)">setFastestInterval(long)</a></code> (such as 1 minute) and a slower <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">setInterval(long)</a></code>
771 (such as 60 minutes). They will only be assigned power blame for the interval set by
772 <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">setInterval(long)</a></code>, but can still receive locations triggered by other applications at a rate
773 up to <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setFastestInterval(long)">setFastestInterval(long)</a></code>. This style of request is appropriate for many location aware
774 applications, including background usage. Do be careful to also throttle
775 <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setFastestInterval(long)">setFastestInterval(long)</a></code> if you perform heavy-weight work after receiving an update - such
776 as using the network.
778 <p>Activities should strongly consider removing all location request when entering
779 the background (for example at <code><a href="/reference/android/app/Activity.html#onPause()">onPause()</a></code>), or at least swap the
780 request to a larger interval and lower quality.
782 <p>Applications cannot specify the exact location sources, such as GPS, that are used by the
783 LocationClient. In fact, the system may have multiple location sources (providers) running and
784 may fuse the results from several sources into a single Location object.
786 <p>Location requests from applications with
787 <code><a href="/reference/android/Manifest.permission.html#ACCESS_COARSE_LOCATION">ACCESS_COARSE_LOCATION</a></code> and not
788 <code><a href="/reference/android/Manifest.permission.html#ACCESS_FINE_LOCATION">ACCESS_FINE_LOCATION</a></code> will be automatically throttled to a
789 slower interval, and the location object will be obfuscated to only show a coarse level of
792 <p>All location requests are considered hints, and you may receive locations that are
793 more/less accurate, and faster/slower than requested.
800 </div><!-- jd-descr -->
817 <div class="jd-descr">
834 <!-- =========== ENUM CONSTANT SUMMARY =========== -->
835 <table id="constants" class="jd-sumtable"><tr><th colspan="12">Constants</th></tr>
839 <tr class="alt-color api apilevel-" >
840 <td class="jd-typecol">String</td>
841 <td class="jd-linkcol"><a href="/reference/com/google/android/gms/location/LocationRequest.html#NULL">NULL</a></td>
842 <td class="jd-descrcol" width="100%"></td>
846 <tr class=" api apilevel-" >
847 <td class="jd-typecol">int</td>
848 <td class="jd-linkcol"><a href="/reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_BALANCED_POWER_ACCURACY">PRIORITY_BALANCED_POWER_ACCURACY</a></td>
849 <td class="jd-descrcol" width="100%">Used with <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setPriority(int)">setPriority(int)</a></code> to request "block" level accuracy.</td>
853 <tr class="alt-color api apilevel-" >
854 <td class="jd-typecol">int</td>
855 <td class="jd-linkcol"><a href="/reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_HIGH_ACCURACY">PRIORITY_HIGH_ACCURACY</a></td>
856 <td class="jd-descrcol" width="100%">Used with <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setPriority(int)">setPriority(int)</a></code> to request the most accurate locations available.</td>
860 <tr class=" api apilevel-" >
861 <td class="jd-typecol">int</td>
862 <td class="jd-linkcol"><a href="/reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_NO_POWER">PRIORITY_NO_POWER</a></td>
863 <td class="jd-descrcol" width="100%">Used with <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setPriority(int)">setPriority(int)</a></code> to request the best accuracy possible with zero additional
864 power consumption.</td>
875 <!-- =========== ENUM CONSTANT SUMMARY =========== -->
876 <table id="inhconstants" class="jd-sumtable"><tr><th>
877 <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a>
878 <div style="clear:left;">Inherited Constants</div></th></tr>
883 <tr class="api apilevel-" >
886 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-constants-android.os.Parcelable" class="jd-expando-trigger closed"
887 ><img id="inherited-constants-android.os.Parcelable-trigger"
888 src="/assets/images/triangle-closed.png"
889 class="jd-expando-trigger-img" /></a>From interface
890 android.os.Parcelable
891 <div id="inherited-constants-android.os.Parcelable">
892 <div id="inherited-constants-android.os.Parcelable-list"
893 class="jd-inheritedlinks">
895 <div id="inherited-constants-android.os.Parcelable-summary" style="display: none;">
896 <table class="jd-sumtable-expando">
900 <tr class="alt-color api apilevel-" >
901 <td class="jd-typecol">int</td>
902 <td class="jd-linkcol">CONTENTS_FILE_DESCRIPTOR</td>
903 <td class="jd-descrcol" width="100%"></td>
907 <tr class=" api apilevel-" >
908 <td class="jd-typecol">int</td>
909 <td class="jd-linkcol">PARCELABLE_WRITE_RETURN_VALUE</td>
910 <td class="jd-descrcol" width="100%"></td>
925 <!-- =========== FIELD SUMMARY =========== -->
926 <table id="lfields" class="jd-sumtable"><tr><th colspan="12">Fields</th></tr>
930 <tr class="alt-color api apilevel-" >
931 <td class="jd-typecol"><nobr>
935 <a href="/reference/com/google/android/gms/location/LocationRequestCreator.html">LocationRequestCreator</a></nobr></td>
936 <td class="jd-linkcol"><a href="/reference/com/google/android/gms/location/LocationRequest.html#CREATOR">CREATOR</a></td>
937 <td class="jd-descrcol" width="100%"></td>
954 <!-- ========== METHOD SUMMARY =========== -->
955 <table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr>
960 <tr class="alt-color api apilevel-" >
961 <td class="jd-typecol"><nobr>
967 <a href="/reference/com/google/android/gms/location/LocationRequest.html">LocationRequest</a></nobr>
969 <td class="jd-linkcol" width="100%"><nobr>
970 <span class="sympad"><a href="/reference/com/google/android/gms/location/LocationRequest.html#create()">create</a></span>()</nobr>
972 <div class="jd-descrdiv">Create a location request with default parameters.</div>
978 <tr class=" api apilevel-" >
979 <td class="jd-typecol"><nobr>
987 <td class="jd-linkcol" width="100%"><nobr>
988 <span class="sympad"><a href="/reference/com/google/android/gms/location/LocationRequest.html#describeContents()">describeContents</a></span>()</nobr>
994 <tr class="alt-color api apilevel-" >
995 <td class="jd-typecol"><nobr>
1003 <td class="jd-linkcol" width="100%"><nobr>
1004 <span class="sympad"><a href="/reference/com/google/android/gms/location/LocationRequest.html#equals(java.lang.Object)">equals</a></span>(Object object)</nobr>
1010 <tr class=" api apilevel-" >
1011 <td class="jd-typecol"><nobr>
1019 <td class="jd-linkcol" width="100%"><nobr>
1020 <span class="sympad"><a href="/reference/com/google/android/gms/location/LocationRequest.html#getExpirationTime()">getExpirationTime</a></span>()</nobr>
1022 <div class="jd-descrdiv">Get the request expiration time, in milliseconds since boot.</div>
1028 <tr class="alt-color api apilevel-" >
1029 <td class="jd-typecol"><nobr>
1037 <td class="jd-linkcol" width="100%"><nobr>
1038 <span class="sympad"><a href="/reference/com/google/android/gms/location/LocationRequest.html#getFastestInterval()">getFastestInterval</a></span>()</nobr>
1040 <div class="jd-descrdiv">Get the fastest interval of this request, in milliseconds.</div>
1046 <tr class=" api apilevel-" >
1047 <td class="jd-typecol"><nobr>
1055 <td class="jd-linkcol" width="100%"><nobr>
1056 <span class="sympad"><a href="/reference/com/google/android/gms/location/LocationRequest.html#getInterval()">getInterval</a></span>()</nobr>
1058 <div class="jd-descrdiv">Get the desired interval of this request, in milliseconds.</div>
1064 <tr class="alt-color api apilevel-" >
1065 <td class="jd-typecol"><nobr>
1073 <td class="jd-linkcol" width="100%"><nobr>
1074 <span class="sympad"><a href="/reference/com/google/android/gms/location/LocationRequest.html#getNumUpdates()">getNumUpdates</a></span>()</nobr>
1076 <div class="jd-descrdiv">Get the number of updates requested.</div>
1082 <tr class=" api apilevel-" >
1083 <td class="jd-typecol"><nobr>
1091 <td class="jd-linkcol" width="100%"><nobr>
1092 <span class="sympad"><a href="/reference/com/google/android/gms/location/LocationRequest.html#getPriority()">getPriority</a></span>()</nobr>
1094 <div class="jd-descrdiv">Get the quality of the request.</div>
1100 <tr class="alt-color api apilevel-" >
1101 <td class="jd-typecol"><nobr>
1109 <td class="jd-linkcol" width="100%"><nobr>
1110 <span class="sympad"><a href="/reference/com/google/android/gms/location/LocationRequest.html#getSmallestDisplacement()">getSmallestDisplacement</a></span>()</nobr>
1112 <div class="jd-descrdiv">Get the minimum displacement between location updates in meters
1114 <p>By default this is 0.</div>
1120 <tr class=" api apilevel-" >
1121 <td class="jd-typecol"><nobr>
1129 <td class="jd-linkcol" width="100%"><nobr>
1130 <span class="sympad"><a href="/reference/com/google/android/gms/location/LocationRequest.html#hashCode()">hashCode</a></span>()</nobr>
1136 <tr class="alt-color api apilevel-" >
1137 <td class="jd-typecol"><nobr>
1143 <a href="/reference/com/google/android/gms/location/LocationRequest.html">LocationRequest</a></nobr>
1145 <td class="jd-linkcol" width="100%"><nobr>
1146 <span class="sympad"><a href="/reference/com/google/android/gms/location/LocationRequest.html#setExpirationDuration(long)">setExpirationDuration</a></span>(long millis)</nobr>
1148 <div class="jd-descrdiv">Set the duration of this request, in milliseconds.</div>
1154 <tr class=" api apilevel-" >
1155 <td class="jd-typecol"><nobr>
1161 <a href="/reference/com/google/android/gms/location/LocationRequest.html">LocationRequest</a></nobr>
1163 <td class="jd-linkcol" width="100%"><nobr>
1164 <span class="sympad"><a href="/reference/com/google/android/gms/location/LocationRequest.html#setExpirationTime(long)">setExpirationTime</a></span>(long millis)</nobr>
1166 <div class="jd-descrdiv">Set the request expiration time, in millisecond since boot.</div>
1172 <tr class="alt-color api apilevel-" >
1173 <td class="jd-typecol"><nobr>
1179 <a href="/reference/com/google/android/gms/location/LocationRequest.html">LocationRequest</a></nobr>
1181 <td class="jd-linkcol" width="100%"><nobr>
1182 <span class="sympad"><a href="/reference/com/google/android/gms/location/LocationRequest.html#setFastestInterval(long)">setFastestInterval</a></span>(long millis)</nobr>
1184 <div class="jd-descrdiv">Explicitly set the fastest interval for location updates, in milliseconds.</div>
1190 <tr class=" api apilevel-" >
1191 <td class="jd-typecol"><nobr>
1197 <a href="/reference/com/google/android/gms/location/LocationRequest.html">LocationRequest</a></nobr>
1199 <td class="jd-linkcol" width="100%"><nobr>
1200 <span class="sympad"><a href="/reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">setInterval</a></span>(long millis)</nobr>
1202 <div class="jd-descrdiv">Set the desired interval for active location updates, in milliseconds.</div>
1208 <tr class="alt-color api apilevel-" >
1209 <td class="jd-typecol"><nobr>
1215 <a href="/reference/com/google/android/gms/location/LocationRequest.html">LocationRequest</a></nobr>
1217 <td class="jd-linkcol" width="100%"><nobr>
1218 <span class="sympad"><a href="/reference/com/google/android/gms/location/LocationRequest.html#setNumUpdates(int)">setNumUpdates</a></span>(int numUpdates)</nobr>
1220 <div class="jd-descrdiv">Set the number of location updates.</div>
1226 <tr class=" api apilevel-" >
1227 <td class="jd-typecol"><nobr>
1233 <a href="/reference/com/google/android/gms/location/LocationRequest.html">LocationRequest</a></nobr>
1235 <td class="jd-linkcol" width="100%"><nobr>
1236 <span class="sympad"><a href="/reference/com/google/android/gms/location/LocationRequest.html#setPriority(int)">setPriority</a></span>(int priority)</nobr>
1238 <div class="jd-descrdiv">Set the priority of the request.</div>
1244 <tr class="alt-color api apilevel-" >
1245 <td class="jd-typecol"><nobr>
1251 <a href="/reference/com/google/android/gms/location/LocationRequest.html">LocationRequest</a></nobr>
1253 <td class="jd-linkcol" width="100%"><nobr>
1254 <span class="sympad"><a href="/reference/com/google/android/gms/location/LocationRequest.html#setSmallestDisplacement(float)">setSmallestDisplacement</a></span>(float smallestDisplacementMeters)</nobr>
1256 <div class="jd-descrdiv">Set the minimum displacement between location updates in meters
1258 <p>By default this is 0.</div>
1264 <tr class=" api apilevel-" >
1265 <td class="jd-typecol"><nobr>
1273 <td class="jd-linkcol" width="100%"><nobr>
1274 <span class="sympad"><a href="/reference/com/google/android/gms/location/LocationRequest.html#toString()">toString</a></span>()</nobr>
1280 <tr class="alt-color api apilevel-" >
1281 <td class="jd-typecol"><nobr>
1289 <td class="jd-linkcol" width="100%"><nobr>
1290 <span class="sympad"><a href="/reference/com/google/android/gms/location/LocationRequest.html#writeToParcel(android.os.Parcel, int)">writeToParcel</a></span>(Parcel parcel, int flags)</nobr>
1304 <!-- ========== METHOD SUMMARY =========== -->
1305 <table id="inhmethods" class="jd-sumtable"><tr><th>
1306 <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a>
1307 <div style="clear:left;">Inherited Methods</div></th></tr>
1310 <tr class="api apilevel-" >
1312 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed"
1313 ><img id="inherited-methods-java.lang.Object-trigger"
1314 src="/assets/images/triangle-closed.png"
1315 class="jd-expando-trigger-img" /></a>
1320 <div id="inherited-methods-java.lang.Object">
1321 <div id="inherited-methods-java.lang.Object-list"
1322 class="jd-inheritedlinks">
1324 <div id="inherited-methods-java.lang.Object-summary" style="display: none;">
1325 <table class="jd-sumtable-expando">
1330 <tr class="alt-color api apilevel-" >
1331 <td class="jd-typecol"><nobr>
1339 <td class="jd-linkcol" width="100%"><nobr>
1340 <span class="sympad">clone</span>()</nobr>
1346 <tr class=" api apilevel-" >
1347 <td class="jd-typecol"><nobr>
1355 <td class="jd-linkcol" width="100%"><nobr>
1356 <span class="sympad">equals</span>(Object arg0)</nobr>
1362 <tr class="alt-color api apilevel-" >
1363 <td class="jd-typecol"><nobr>
1371 <td class="jd-linkcol" width="100%"><nobr>
1372 <span class="sympad">finalize</span>()</nobr>
1378 <tr class=" api apilevel-" >
1379 <td class="jd-typecol"><nobr>
1385 Class<?></nobr>
1387 <td class="jd-linkcol" width="100%"><nobr>
1388 <span class="sympad">getClass</span>()</nobr>
1394 <tr class="alt-color api apilevel-" >
1395 <td class="jd-typecol"><nobr>
1403 <td class="jd-linkcol" width="100%"><nobr>
1404 <span class="sympad">hashCode</span>()</nobr>
1410 <tr class=" api apilevel-" >
1411 <td class="jd-typecol"><nobr>
1419 <td class="jd-linkcol" width="100%"><nobr>
1420 <span class="sympad">notify</span>()</nobr>
1426 <tr class="alt-color api apilevel-" >
1427 <td class="jd-typecol"><nobr>
1435 <td class="jd-linkcol" width="100%"><nobr>
1436 <span class="sympad">notifyAll</span>()</nobr>
1442 <tr class=" api apilevel-" >
1443 <td class="jd-typecol"><nobr>
1451 <td class="jd-linkcol" width="100%"><nobr>
1452 <span class="sympad">toString</span>()</nobr>
1458 <tr class="alt-color api apilevel-" >
1459 <td class="jd-typecol"><nobr>
1467 <td class="jd-linkcol" width="100%"><nobr>
1468 <span class="sympad">wait</span>()</nobr>
1474 <tr class=" api apilevel-" >
1475 <td class="jd-typecol"><nobr>
1483 <td class="jd-linkcol" width="100%"><nobr>
1484 <span class="sympad">wait</span>(long arg0, int arg1)</nobr>
1490 <tr class="alt-color api apilevel-" >
1491 <td class="jd-typecol"><nobr>
1499 <td class="jd-linkcol" width="100%"><nobr>
1500 <span class="sympad">wait</span>(long arg0)</nobr>
1512 <tr class="api apilevel-" >
1514 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-android.os.Parcelable" class="jd-expando-trigger closed"
1515 ><img id="inherited-methods-android.os.Parcelable-trigger"
1516 src="/assets/images/triangle-closed.png"
1517 class="jd-expando-trigger-img" /></a>
1520 android.os.Parcelable
1522 <div id="inherited-methods-android.os.Parcelable">
1523 <div id="inherited-methods-android.os.Parcelable-list"
1524 class="jd-inheritedlinks">
1526 <div id="inherited-methods-android.os.Parcelable-summary" style="display: none;">
1527 <table class="jd-sumtable-expando">
1532 <tr class="alt-color api apilevel-" >
1533 <td class="jd-typecol"><nobr>
1541 <td class="jd-linkcol" width="100%"><nobr>
1542 <span class="sympad">describeContents</span>()</nobr>
1548 <tr class=" api apilevel-" >
1549 <td class="jd-typecol"><nobr>
1557 <td class="jd-linkcol" width="100%"><nobr>
1558 <span class="sympad">writeToParcel</span>(Parcel arg0, int arg1)</nobr>
1572 </div><!-- jd-descr (summary) -->
1583 <!-- XML Attributes -->
1586 <!-- Enum Values -->
1592 <!-- ========= ENUM CONSTANTS DETAIL ======== -->
1600 <div class="jd-details api apilevel-">
1601 <h4 class="jd-details-title">
1602 <span class="normal">
1610 <div class="api-level">
1616 <div class="jd-details-descr">
1618 <div class="jd-tagdata jd-tagdescr"><p></p></div>
1621 <div class="jd-tagdata">
1622 <span class="jd-tagtitle">Constant Value: </span>
1625 "SAFE_PARCELABLE_NULL_STRING"
1635 <A NAME="PRIORITY_BALANCED_POWER_ACCURACY"></A>
1637 <div class="jd-details api apilevel-">
1638 <h4 class="jd-details-title">
1639 <span class="normal">
1645 PRIORITY_BALANCED_POWER_ACCURACY
1647 <div class="api-level">
1653 <div class="jd-details-descr">
1655 <div class="jd-tagdata jd-tagdescr"><p>Used with <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setPriority(int)">setPriority(int)</a></code> to request "block" level accuracy.
1657 <p>Block level accuracy is considered to be about 100 meter accuracy. Using a coarse
1658 accuracy such as this often consumes less power.
1662 <div class="jd-tagdata">
1663 <span class="jd-tagtitle">Constant Value: </span>
1677 <A NAME="PRIORITY_HIGH_ACCURACY"></A>
1679 <div class="jd-details api apilevel-">
1680 <h4 class="jd-details-title">
1681 <span class="normal">
1687 PRIORITY_HIGH_ACCURACY
1689 <div class="api-level">
1695 <div class="jd-details-descr">
1697 <div class="jd-tagdata jd-tagdescr"><p>Used with <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setPriority(int)">setPriority(int)</a></code> to request the most accurate locations available.
1699 <p>This will return the finest location available.
1703 <div class="jd-tagdata">
1704 <span class="jd-tagtitle">Constant Value: </span>
1718 <A NAME="PRIORITY_NO_POWER"></A>
1720 <div class="jd-details api apilevel-">
1721 <h4 class="jd-details-title">
1722 <span class="normal">
1730 <div class="api-level">
1736 <div class="jd-details-descr">
1738 <div class="jd-tagdata jd-tagdescr"><p>Used with <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setPriority(int)">setPriority(int)</a></code> to request the best accuracy possible with zero additional
1741 <p>No locations will be returned unless a different client has requested location updates
1742 in which case this request will act as a passive listener to those locations.
1746 <div class="jd-tagdata">
1747 <span class="jd-tagtitle">Constant Value: </span>
1765 <!-- ========= FIELD DETAIL ======== -->
1771 <A NAME="CREATOR"></A>
1773 <div class="jd-details api apilevel-">
1774 <h4 class="jd-details-title">
1775 <span class="normal">
1779 <a href="/reference/com/google/android/gms/location/LocationRequestCreator.html">LocationRequestCreator</a>
1783 <div class="api-level">
1789 <div class="jd-details-descr">
1791 <div class="jd-tagdata jd-tagdescr"><p></p></div>
1800 <!-- Public ctors -->
1804 <!-- ========= CONSTRUCTOR DETAIL ======== -->
1805 <!-- Protected ctors -->
1809 <!-- ========= METHOD DETAIL ======== -->
1810 <!-- Public methdos -->
1812 <h2>Public Methods</h2>
1816 <A NAME="create()"></A>
1818 <div class="jd-details api apilevel-">
1819 <h4 class="jd-details-title">
1820 <span class="normal">
1826 <a href="/reference/com/google/android/gms/location/LocationRequest.html">LocationRequest</a>
1828 <span class="sympad">create</span>
1829 <span class="normal">()</span>
1831 <div class="api-level">
1837 <div class="jd-details-descr">
1839 <div class="jd-tagdata jd-tagdescr"><p>Create a location request with default parameters.
1841 <p>Default parameters are for a block accuracy, slowly updated location. It can then be
1842 adjusted as required by the applications before passing to the <code><a href="/reference/com/google/android/gms/location/LocationClient.html">LocationClient</a></code>.</p></div>
1843 <div class="jd-tagdata">
1844 <h5 class="jd-tagtitle">Returns</h5>
1845 <ul class="nolist"><li>a new location request
1853 <A NAME="describeContents()"></A>
1855 <div class="jd-details api apilevel-">
1856 <h4 class="jd-details-title">
1857 <span class="normal">
1865 <span class="sympad">describeContents</span>
1866 <span class="normal">()</span>
1868 <div class="api-level">
1874 <div class="jd-details-descr">
1876 <div class="jd-tagdata jd-tagdescr"><p></p></div>
1882 <A NAME="equals(java.lang.Object)"></A>
1884 <div class="jd-details api apilevel-">
1885 <h4 class="jd-details-title">
1886 <span class="normal">
1894 <span class="sympad">equals</span>
1895 <span class="normal">(Object object)</span>
1897 <div class="api-level">
1903 <div class="jd-details-descr">
1905 <div class="jd-tagdata jd-tagdescr"><p></p></div>
1911 <A NAME="getExpirationTime()"></A>
1913 <div class="jd-details api apilevel-">
1914 <h4 class="jd-details-title">
1915 <span class="normal">
1923 <span class="sympad">getExpirationTime</span>
1924 <span class="normal">()</span>
1926 <div class="api-level">
1932 <div class="jd-details-descr">
1934 <div class="jd-tagdata jd-tagdescr"><p>Get the request expiration time, in milliseconds since boot.
1936 <p>This value can be compared to <code><a href="/reference/android/os/SystemClock.html#elapsedRealtime()">elapsedRealtime()</a></code> to determine the time
1937 until expiration.</p></div>
1938 <div class="jd-tagdata">
1939 <h5 class="jd-tagtitle">Returns</h5>
1940 <ul class="nolist"><li>expiration time of request, in milliseconds since boot including suspend
1948 <A NAME="getFastestInterval()"></A>
1950 <div class="jd-details api apilevel-">
1951 <h4 class="jd-details-title">
1952 <span class="normal">
1960 <span class="sympad">getFastestInterval</span>
1961 <span class="normal">()</span>
1963 <div class="api-level">
1969 <div class="jd-details-descr">
1971 <div class="jd-tagdata jd-tagdescr"><p>Get the fastest interval of this request, in milliseconds.
1973 <p>The system will never provide location updates faster than the minimum of
1974 <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#getFastestInterval()">getFastestInterval()</a></code> and <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#getInterval()">getInterval()</a></code>.</p></div>
1975 <div class="jd-tagdata">
1976 <h5 class="jd-tagtitle">Returns</h5>
1977 <ul class="nolist"><li>fastest interval in milliseconds, exact
1985 <A NAME="getInterval()"></A>
1987 <div class="jd-details api apilevel-">
1988 <h4 class="jd-details-title">
1989 <span class="normal">
1997 <span class="sympad">getInterval</span>
1998 <span class="normal">()</span>
2000 <div class="api-level">
2006 <div class="jd-details-descr">
2008 <div class="jd-tagdata jd-tagdescr"><p>Get the desired interval of this request, in milliseconds.</p></div>
2009 <div class="jd-tagdata">
2010 <h5 class="jd-tagtitle">Returns</h5>
2011 <ul class="nolist"><li>desired interval in milliseconds, inexact
2019 <A NAME="getNumUpdates()"></A>
2021 <div class="jd-details api apilevel-">
2022 <h4 class="jd-details-title">
2023 <span class="normal">
2031 <span class="sympad">getNumUpdates</span>
2032 <span class="normal">()</span>
2034 <div class="api-level">
2040 <div class="jd-details-descr">
2042 <div class="jd-tagdata jd-tagdescr"><p>Get the number of updates requested.
2044 <p>By default this is <code><a href="/reference/java/lang/Integer.html#MAX_VALUE">MAX_VALUE</a></code>, which indicates that locations are updated
2045 until the request is explicitly removed.</p></div>
2046 <div class="jd-tagdata">
2047 <h5 class="jd-tagtitle">Returns</h5>
2048 <ul class="nolist"><li>number of updates
2056 <A NAME="getPriority()"></A>
2058 <div class="jd-details api apilevel-">
2059 <h4 class="jd-details-title">
2060 <span class="normal">
2068 <span class="sympad">getPriority</span>
2069 <span class="normal">()</span>
2071 <div class="api-level">
2077 <div class="jd-details-descr">
2079 <div class="jd-tagdata jd-tagdescr"><p>Get the quality of the request.</p></div>
2080 <div class="jd-tagdata">
2081 <h5 class="jd-tagtitle">Returns</h5>
2082 <ul class="nolist"><li>an accuracy constant
2090 <A NAME="getSmallestDisplacement()"></A>
2092 <div class="jd-details api apilevel-">
2093 <h4 class="jd-details-title">
2094 <span class="normal">
2102 <span class="sympad">getSmallestDisplacement</span>
2103 <span class="normal">()</span>
2105 <div class="api-level">
2111 <div class="jd-details-descr">
2113 <div class="jd-tagdata jd-tagdescr"><p>Get the minimum displacement between location updates in meters
2115 <p>By default this is 0.</p></div>
2116 <div class="jd-tagdata">
2117 <h5 class="jd-tagtitle">Returns</h5>
2118 <ul class="nolist"><li>minimum displacement between location updates in meters
2126 <A NAME="hashCode()"></A>
2128 <div class="jd-details api apilevel-">
2129 <h4 class="jd-details-title">
2130 <span class="normal">
2138 <span class="sympad">hashCode</span>
2139 <span class="normal">()</span>
2141 <div class="api-level">
2147 <div class="jd-details-descr">
2149 <div class="jd-tagdata jd-tagdescr"><p></p></div>
2155 <A NAME="setExpirationDuration(long)"></A>
2157 <div class="jd-details api apilevel-">
2158 <h4 class="jd-details-title">
2159 <span class="normal">
2165 <a href="/reference/com/google/android/gms/location/LocationRequest.html">LocationRequest</a>
2167 <span class="sympad">setExpirationDuration</span>
2168 <span class="normal">(long millis)</span>
2170 <div class="api-level">
2176 <div class="jd-details-descr">
2178 <div class="jd-tagdata jd-tagdescr"><p>Set the duration of this request, in milliseconds.
2180 <p>The duration begins immediately (and not when the request is passed to the location
2181 client), so call this method again if the request is re-used at a later time.
2183 <p>The location client will automatically stop updates after the request expires.
2185 <p>The duration includes suspend time. Values less than 0 are allowed, but indicate that
2186 the request has already expired.</p></div>
2187 <div class="jd-tagdata">
2188 <h5 class="jd-tagtitle">Parameters</h5>
2189 <table class="jd-tagtable">
2192 <td>duration of request in milliseconds</td>
2196 <div class="jd-tagdata">
2197 <h5 class="jd-tagtitle">Returns</h5>
2198 <ul class="nolist"><li>the same object, so that setters can be chained
2206 <A NAME="setExpirationTime(long)"></A>
2208 <div class="jd-details api apilevel-">
2209 <h4 class="jd-details-title">
2210 <span class="normal">
2216 <a href="/reference/com/google/android/gms/location/LocationRequest.html">LocationRequest</a>
2218 <span class="sympad">setExpirationTime</span>
2219 <span class="normal">(long millis)</span>
2221 <div class="api-level">
2227 <div class="jd-details-descr">
2229 <div class="jd-tagdata jd-tagdescr"><p>Set the request expiration time, in millisecond since boot.
2231 <p>This expiration time uses the same time base as <code><a href="/reference/android/os/SystemClock.html#elapsedRealtime()">elapsedRealtime()</a></code>.
2233 <p>The location client will automatically stop updates after the request expires.
2235 <p>The duration includes suspend time. Values before <code><a href="/reference/android/os/SystemClock.html#elapsedRealtime()">elapsedRealtime()</a></code>
2236 are allowed, but indicate that the request has already expired.</p></div>
2237 <div class="jd-tagdata">
2238 <h5 class="jd-tagtitle">Parameters</h5>
2239 <table class="jd-tagtable">
2242 <td>expiration time of request, in milliseconds since boot including suspend</td>
2246 <div class="jd-tagdata">
2247 <h5 class="jd-tagtitle">Returns</h5>
2248 <ul class="nolist"><li>the same object, so that setters can be chained
2256 <A NAME="setFastestInterval(long)"></A>
2258 <div class="jd-details api apilevel-">
2259 <h4 class="jd-details-title">
2260 <span class="normal">
2266 <a href="/reference/com/google/android/gms/location/LocationRequest.html">LocationRequest</a>
2268 <span class="sympad">setFastestInterval</span>
2269 <span class="normal">(long millis)</span>
2271 <div class="api-level">
2277 <div class="jd-details-descr">
2279 <div class="jd-tagdata jd-tagdescr"><p>Explicitly set the fastest interval for location updates, in milliseconds.
2281 <p>This controls the fastest rate at which your application will receive location updates,
2282 which might be faster than <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">setInterval(long)</a></code> in some situations (for example, if other
2283 applications are triggering location updates).
2285 <p>This allows your application to passively acquire locations at a rate faster than it
2286 actively acquires locations, saving power.
2288 <p>Unlike <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">setInterval(long)</a></code>, this parameter is exact. Your application will never
2289 receive updates faster than this value.
2291 <p>If you don't call this method, a fastest interval will be selected for you. It will be
2292 a value faster than your active interval (<code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">setInterval(long)</a></code>).
2294 <p>An interval of 0 is allowed, but not recommended, since location updates may be
2295 extremely fast on future implementations.
2297 <p>If <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setFastestInterval(long)">setFastestInterval(long)</a></code> is set slower than <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">setInterval(long)</a></code>, then your
2298 effective fastest interval is <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">setInterval(long)</a></code>.</p></div>
2299 <div class="jd-tagdata">
2300 <h5 class="jd-tagtitle">Parameters</h5>
2301 <table class="jd-tagtable">
2304 <td>fastest interval for updates in milliseconds, exact</td>
2308 <div class="jd-tagdata">
2309 <h5 class="jd-tagtitle">Returns</h5>
2310 <ul class="nolist"><li>the same object, so that setters can be chained
2313 <div class="jd-tagdata">
2314 <h5 class="jd-tagtitle">Throws</h5>
2315 <table class="jd-tagtable">
2317 <th>IllegalArgumentException</td>
2318 <td>if the interval is less than zero</td>
2327 <A NAME="setInterval(long)"></A>
2329 <div class="jd-details api apilevel-">
2330 <h4 class="jd-details-title">
2331 <span class="normal">
2337 <a href="/reference/com/google/android/gms/location/LocationRequest.html">LocationRequest</a>
2339 <span class="sympad">setInterval</span>
2340 <span class="normal">(long millis)</span>
2342 <div class="api-level">
2348 <div class="jd-details-descr">
2350 <div class="jd-tagdata jd-tagdescr"><p>Set the desired interval for active location updates, in milliseconds.
2352 <p>The location client will actively try to obtain location updates for your application
2353 at this interval, so it has a direct influence on the amount of power used by your
2354 application. Choose your interval wisely.
2356 <p>This interval is inexact. You may not receive updates at all (if no location sources
2357 are available), or you may receive them slower than requested. You may also receive them
2358 faster than requested (if other applications are requesting location at a faster interval).
2359 The fastest rate that that you will receive updates can be controlled with
2360 <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setFastestInterval(long)">setFastestInterval(long)</a></code>. By default this fastest rate is 6x the interval frequency.
2362 <p>Applications with only the coarse location permission may have their interval silently
2365 <p>An interval of 0 is allowed, but not recommended, since location updates may be extremely
2366 fast on future implementations.
2368 <p><code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setPriority(int)">setPriority(int)</a></code> and <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">setInterval(long)</a></code> are the most important parameters
2369 on a location request.</p></div>
2370 <div class="jd-tagdata">
2371 <h5 class="jd-tagtitle">Parameters</h5>
2372 <table class="jd-tagtable">
2375 <td>desired interval in millisecond, inexact</td>
2379 <div class="jd-tagdata">
2380 <h5 class="jd-tagtitle">Returns</h5>
2381 <ul class="nolist"><li>the same object, so that setters can be chained
2384 <div class="jd-tagdata">
2385 <h5 class="jd-tagtitle">Throws</h5>
2386 <table class="jd-tagtable">
2388 <th>IllegalArgumentException</td>
2389 <td>if the interval is less than zero</td>
2398 <A NAME="setNumUpdates(int)"></A>
2400 <div class="jd-details api apilevel-">
2401 <h4 class="jd-details-title">
2402 <span class="normal">
2408 <a href="/reference/com/google/android/gms/location/LocationRequest.html">LocationRequest</a>
2410 <span class="sympad">setNumUpdates</span>
2411 <span class="normal">(int numUpdates)</span>
2413 <div class="api-level">
2419 <div class="jd-details-descr">
2421 <div class="jd-tagdata jd-tagdescr"><p>Set the number of location updates.
2423 <p>By default locations are continuously updated until the request is explicitly removed,
2424 however you can optionally request a set number of updates. For example, if your
2425 application only needs a single fresh location, then call this method with a value of 1
2426 before passing the request to the location client.</p></div>
2427 <div class="jd-tagdata">
2428 <h5 class="jd-tagtitle">Parameters</h5>
2429 <table class="jd-tagtable">
2432 <td>the number of location updates requested</td>
2436 <div class="jd-tagdata">
2437 <h5 class="jd-tagtitle">Returns</h5>
2438 <ul class="nolist"><li>the same object, so that setters can be chained
2441 <div class="jd-tagdata">
2442 <h5 class="jd-tagtitle">Throws</h5>
2443 <table class="jd-tagtable">
2445 <th>IllegalArgumentException</td>
2446 <td>if numUpdates is 0 or less</td>
2455 <A NAME="setPriority(int)"></A>
2457 <div class="jd-details api apilevel-">
2458 <h4 class="jd-details-title">
2459 <span class="normal">
2465 <a href="/reference/com/google/android/gms/location/LocationRequest.html">LocationRequest</a>
2467 <span class="sympad">setPriority</span>
2468 <span class="normal">(int priority)</span>
2470 <div class="api-level">
2476 <div class="jd-details-descr">
2478 <div class="jd-tagdata jd-tagdescr"><p>Set the priority of the request.
2480 <p>Use with a priority constant such as <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_HIGH_ACCURACY">PRIORITY_HIGH_ACCURACY</a></code>. No other values
2483 <p>The priority of the request is a strong hint to the LocationClient for which location
2484 sources to use. For example, <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_HIGH_ACCURACY">PRIORITY_HIGH_ACCURACY</a></code> is more likely to use GPS, and
2485 <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_BALANCED_POWER_ACCURACY">PRIORITY_BALANCED_POWER_ACCURACY</a></code> is more likely to use WIFI & Cell tower
2486 positioning, but it also depends on many other factors (such as which sources are available)
2487 and is implementation dependent.
2489 <p><code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setPriority(int)">setPriority(int)</a></code> and <code><a href="/reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">setInterval(long)</a></code> are the most important parameters
2490 on a location request.</p></div>
2491 <div class="jd-tagdata">
2492 <h5 class="jd-tagtitle">Parameters</h5>
2493 <table class="jd-tagtable">
2496 <td>an accuracy or power constant</td>
2500 <div class="jd-tagdata">
2501 <h5 class="jd-tagtitle">Returns</h5>
2502 <ul class="nolist"><li>the same object, so that setters can be chained
2505 <div class="jd-tagdata">
2506 <h5 class="jd-tagtitle">Throws</h5>
2507 <table class="jd-tagtable">
2509 <th>IllegalArgumentException</td>
2510 <td>if the quality constant is not valid</td>
2519 <A NAME="setSmallestDisplacement(float)"></A>
2521 <div class="jd-details api apilevel-">
2522 <h4 class="jd-details-title">
2523 <span class="normal">
2529 <a href="/reference/com/google/android/gms/location/LocationRequest.html">LocationRequest</a>
2531 <span class="sympad">setSmallestDisplacement</span>
2532 <span class="normal">(float smallestDisplacementMeters)</span>
2534 <div class="api-level">
2540 <div class="jd-details-descr">
2542 <div class="jd-tagdata jd-tagdescr"><p>Set the minimum displacement between location updates in meters
2544 <p>By default this is 0.</p></div>
2545 <div class="jd-tagdata">
2546 <h5 class="jd-tagtitle">Parameters</h5>
2547 <table class="jd-tagtable">
2549 <th>smallestDisplacementMeters</td>
2550 <td>the smallest displacement in meters the user must move
2551 between location updates.</td>
2555 <div class="jd-tagdata">
2556 <h5 class="jd-tagtitle">Returns</h5>
2557 <ul class="nolist"><li>the same object, so that setters can be chained
2560 <div class="jd-tagdata">
2561 <h5 class="jd-tagtitle">Throws</h5>
2562 <table class="jd-tagtable">
2564 <th>IllegalArgumentException</td>
2565 <td>if smallestDisplacementMeters is negative</td>
2574 <A NAME="toString()"></A>
2576 <div class="jd-details api apilevel-">
2577 <h4 class="jd-details-title">
2578 <span class="normal">
2586 <span class="sympad">toString</span>
2587 <span class="normal">()</span>
2589 <div class="api-level">
2595 <div class="jd-details-descr">
2597 <div class="jd-tagdata jd-tagdescr"><p></p></div>
2603 <A NAME="writeToParcel(android.os.Parcel, int)"></A>
2605 <div class="jd-details api apilevel-">
2606 <h4 class="jd-details-title">
2607 <span class="normal">
2615 <span class="sympad">writeToParcel</span>
2616 <span class="normal">(Parcel parcel, int flags)</span>
2618 <div class="api-level">
2624 <div class="jd-details-descr">
2626 <div class="jd-tagdata jd-tagdescr"><p></p></div>
2635 <!-- ========= METHOD DETAIL ======== -->
2639 <!-- ========= END OF CLASS DATA ========= -->
2640 <A NAME="navbar_top"></A>
2642 <div id="footer" class="wrap" >
2645 <div id="copyright">
2647 Except as noted, this content is licensed under <a
2648 href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</a>.
2649 For details and restrictions, see the <a href="/license.html">
2650 Content License</a>.
2652 <div id="build_info">
2654 <script src="/timestamp.js" type="text/javascript"></script>
2655 <script>document.write(BUILD_TIMESTAMP)</script>
2660 <div id="footerlinks">
2663 <a href="/about/index.html">About Android</a> |
2664 <a href="/legal.html">Legal</a> |
2665 <a href="/support.html">Support</a>
2669 </div> <!-- end footer -->
2670 </div> <!-- jd-content -->
2672 </div><!-- end doc-content -->
2674 </div> <!-- end body-content -->