<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: location aware gps realtime (android) in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18473#M116</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as I know, autoPanMode will pan, but it will not zoom, so perhaps you can set the zoom level you wish to use before you start the navigation? One way to do this automatically might be to set the AutoPanMode to OFF, set the LocationListener, and start() the LocationDisplayManager. Then &lt;EM&gt;just in the first call&lt;/EM&gt; to onLocationChanged, set the zoom level there, and then switch the AutoPanMode to NAVIGATION. I've added some code as an example below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I will make a note that we could add a sample to demonstrate navigation auto-pan mode, along with the initial zoom in, to the SDK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14061954450079405" jivemacro_uid="_14061954450079405" modifiedtitle="true"&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; mLocationDisplayManager = mMapView.getLocationDisplayManager();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; mLocationDisplayManager.setAutoPanMode(AutoPanMode.OFF);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; mLocationDisplayManager.setLocationListener(new LocationListener() {&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; boolean locationChanged = false;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onLocationChanged(Location location) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!locationChanged) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Point currentPt = new Point(location.getLongitude(), location.getLatitude());&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Point currentMapPt = (Point) GeometryEngine.project(currentPt, SpatialReference.create(4326), mMapView.getSpatialReference());&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Use a suitable value for the typical app usage for when no accuracy is available.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; float accuracy = 100;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (location.hasAccuracy()) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; accuracy = location.getAccuracy();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Convert the accuracy to units of the map, and apply a suitable zoom factor for the app.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Unit mapUnits = mMapView.getSpatialReference().getUnit();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double zoomToWidth = 50 * Unit.convertUnits(accuracy, Unit.create(LinearUnit.Code.METER), mapUnits);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Envelope zoomExtent = new Envelope(currentMapPt, zoomToWidth, zoomToWidth);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Make sure that the initial zoom is dont WITHOUT animation, or it may interfere with autopan.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mMapView.setExtent(zoomExtent, 0, false);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Dont run this again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; locationChanged = true;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Now switch to navigation mode.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mLocationDisplayManager.setAutoPanMode(AutoPanMode.NAVIGATION);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onProviderDisabled(String provider) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onProviderEnabled(String provider) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onStatusChanged(String provider, int status, Bundle extras) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; mLocationDisplayManager.start();&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Jul 2014 09:27:56 GMT</pubDate>
    <dc:creator>ShellyGill1</dc:creator>
    <dc:date>2014-07-24T09:27:56Z</dc:date>
    <item>
      <title>location aware gps realtime (android)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18465#M108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Where do I find the android sdk to allow gps in realtime. Like the ESRI app where the gps move with you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 18:46:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18465#M108</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-07-21T18:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: location aware gps realtime (android)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18466#M109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Android SDK&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Location-based applications are now commonplace, but due to the less than optimal accuracy, user movement, the multitude of methods to obtain the location&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="getting-location.png" class="jive-image image-1" src="http://developer.android.com/images/location/getting-location.png" style="width: 620px; height: 168px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="typ"&gt;String&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; locationProvider &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="typ"&gt;LocationManager&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;NETWORK_PROVIDER&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;
&lt;/SPAN&gt;&lt;SPAN class="com"&gt;// Or, use GPS location data:&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;
&lt;/SPAN&gt;&lt;SPAN class="com"&gt;// String locationProvider = LocationManager.GPS_PROVIDER;&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;

locationManager&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;requestLocationUpdates&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;locationProvider&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="lit"&gt;0&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="lit"&gt;0&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; locationListener&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;);&lt;/SPAN&gt;



&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://developer.android.com/guide/topics/location/strategies.html" title="http://developer.android.com/guide/topics/location/strategies.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Location Strategies | Android Developers&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:44:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18466#M109</guid>
      <dc:creator>Mapperzmap</dc:creator>
      <dc:date>2021-12-10T20:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: location aware gps realtime (android)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18467#M110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are building a map with the MapView from the ArcGIS Runtime SDK for Android, then you can use the LocationDisplayManager to set the map to automatically pan in navigation mode. See the &lt;A href="http://developers.arcgis.com/android/api-reference/reference/com/esri/android/map/LocationDisplayManager.html"&gt;LocationDisplayManager&lt;/A&gt; class: use the &lt;A href="http://developers.arcgis.com/android/api-reference/reference/com/esri/android/map/LocationDisplayManager.html#setAutoPanMode(com.esri.android.map.LocationDisplayManager.AutoPanMode)" title="setAutoPanMode"&gt;setAutoPan&lt;/A&gt; method and set the mode as NAVIGATION, and use the &lt;A href="http://developers.arcgis.com/android/api-reference/reference/com/esri/android/map/LocationDisplayManager.html#start()" title="start"&gt;start&lt;/A&gt; method to start the auto-panning behaviour. There are differerent auto-pan modes - see the &lt;A href="http://developers.arcgis.com/android/sample-code/nearby/" title="Nearby"&gt;Nearby Sample&lt;/A&gt; for an example of using the LOCATION mode in an app.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jul 2014 10:46:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18467#M110</guid>
      <dc:creator>ShellyGill1</dc:creator>
      <dc:date>2014-07-22T10:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: location aware gps realtime (android)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18468#M111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks , i'll give it a shot. Your the Best!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jul 2014 13:28:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18468#M111</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-07-22T13:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: location aware gps realtime (android)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18469#M112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the advice.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jul 2014 13:28:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18469#M112</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-07-22T13:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: location aware gps realtime (android)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18470#M113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I followed LocationDisplayManager API, and it's still not working. My partial code is below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LocationDisplayManager &lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;ldm &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;mMapView&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;.getLocationDisplayManager();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;ldm&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;.setAutoPanMode(AutoPanMode.&lt;/SPAN&gt;&lt;EM style=": ; color: #0000c0; font-size: 10pt;"&gt;NAVIGATION&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls.start();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What it does is even it shows the GPS moving, but the map doesn't stay focus (center) on the GPS, hence, the GPS will eventually move off the map. What I did to temporarily fix this is to implement LocationListener, onLocationChanged(Location loc) and have to set the map to zoom at location's longitude/latitude all the time, but performance wise is not very good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldm = mMapView.getLocationDisplayManager();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldm.setAutoPanMode(AutoPanMode.LOCATION);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldm.setLocationListener(new LocationListener(){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onLocationChanged(Location loc) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (loc == null)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (isMapFocus) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapOption = new MapOptions(MapType.TOPO, loc.getLatitude(), loc.getLongitude(), 17);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mMapView.setMapOptions(mapOption);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any sample that exactly does this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks a lot,&lt;/P&gt;&lt;P&gt;Thom&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 16:01:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18470#M113</guid>
      <dc:creator>ThomNgo</dc:creator>
      <dc:date>2014-07-23T16:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: location aware gps realtime (android)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18471#M114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you're seeing the GPS updates on the map, first thing I would check is that you're not touching the map at all after the auto-pan is set - auto-panning is automatically turned off if the user interacts with the map and changes the extent manually (zooming or panning) or if the extent is changed programmatically - check getAutoPanMode(), and also worth checking that the location updates started correctly, using isStarted().&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 16:37:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18471#M114</guid>
      <dc:creator>ShellyGill1</dc:creator>
      <dc:date>2014-07-23T16:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: location aware gps realtime (android)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18472#M115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Shelly,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked isStarted() and it showed "true". Checked GetAutoPanMode(), it showed from NAVIGATION to OFF. The reason it went from NAVIGATION to OFF is because perhaps I zoomed to the GPS location after the map initialized. I have to zoom it because otherwise it only displays the world map from out of space view, which not really helping. Is there a way to setAutoPanMode from OFF back to NAVIGATION? Why autoPanMode not zooming to the GPS location automatically?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Thom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 17:51:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18472#M115</guid>
      <dc:creator>ThomNgo</dc:creator>
      <dc:date>2014-07-23T17:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: location aware gps realtime (android)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18473#M116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as I know, autoPanMode will pan, but it will not zoom, so perhaps you can set the zoom level you wish to use before you start the navigation? One way to do this automatically might be to set the AutoPanMode to OFF, set the LocationListener, and start() the LocationDisplayManager. Then &lt;EM&gt;just in the first call&lt;/EM&gt; to onLocationChanged, set the zoom level there, and then switch the AutoPanMode to NAVIGATION. I've added some code as an example below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I will make a note that we could add a sample to demonstrate navigation auto-pan mode, along with the initial zoom in, to the SDK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14061954450079405" jivemacro_uid="_14061954450079405" modifiedtitle="true"&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; mLocationDisplayManager = mMapView.getLocationDisplayManager();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; mLocationDisplayManager.setAutoPanMode(AutoPanMode.OFF);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; mLocationDisplayManager.setLocationListener(new LocationListener() {&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; boolean locationChanged = false;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onLocationChanged(Location location) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!locationChanged) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Point currentPt = new Point(location.getLongitude(), location.getLatitude());&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Point currentMapPt = (Point) GeometryEngine.project(currentPt, SpatialReference.create(4326), mMapView.getSpatialReference());&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Use a suitable value for the typical app usage for when no accuracy is available.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; float accuracy = 100;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (location.hasAccuracy()) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; accuracy = location.getAccuracy();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Convert the accuracy to units of the map, and apply a suitable zoom factor for the app.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Unit mapUnits = mMapView.getSpatialReference().getUnit();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double zoomToWidth = 50 * Unit.convertUnits(accuracy, Unit.create(LinearUnit.Code.METER), mapUnits);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Envelope zoomExtent = new Envelope(currentMapPt, zoomToWidth, zoomToWidth);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Make sure that the initial zoom is dont WITHOUT animation, or it may interfere with autopan.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mMapView.setExtent(zoomExtent, 0, false);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Dont run this again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; locationChanged = true;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Now switch to navigation mode.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mLocationDisplayManager.setAutoPanMode(AutoPanMode.NAVIGATION);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onProviderDisabled(String provider) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onProviderEnabled(String provider) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onStatusChanged(String provider, int status, Bundle extras) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; mLocationDisplayManager.start();&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 09:27:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18473#M116</guid>
      <dc:creator>ShellyGill1</dc:creator>
      <dc:date>2014-07-24T09:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: location aware gps realtime (android)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18474#M117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Shelly,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It worked. The difference between your code and my code is I used mMapView.zoomTo() to zoom, and it will stop AutoPan (because of animation?), even after I set autoPanMode back to Navigation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mMapView.setExtent() in your example should do the trick.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Thom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2014 20:27:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18474#M117</guid>
      <dc:creator>ThomNgo</dc:creator>
      <dc:date>2014-07-25T20:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: location aware gps realtime (android)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18475#M118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shelly,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From your sample, I'm wondering what's the use of zoomToWidth? When I debug, I saw this value changes but Envelope zoomExtent always the same, meaning the zoom scale at the end is the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With mMapView.setExtent(zoomExtent, &lt;SPAN class="number"&gt;0&lt;/SPAN&gt;, &lt;SPAN class="keyword"&gt;false&lt;/SPAN&gt;), the zoom is too close, I want to be able to adjust the zoom but some how, it doesn't matter what zoomToWidth I passed in, the zoom is always the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I'm not familiar with Geometry, what egs (SpatialReference.create(&lt;SPAN class="number"&gt;4326&lt;/SPAN&gt;)) and wm are used for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks a lot,&lt;/P&gt;&lt;P&gt;Thom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 18:57:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18475#M118</guid>
      <dc:creator>ThomNgo</dc:creator>
      <dc:date>2014-07-29T18:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: location aware gps realtime (android)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18476#M119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the sample code, the value of zoomToWidth would only change if the accuracy of the GPS location changes; if I change the factor from 50 to 200 or 10 for example, I see this reflected in the map scale when the location initially changes.&amp;nbsp; One thing that might be worth checking is that you map is initialized before you attempt to change the extent, and also make sure that your setExtent call is not conflicting with any specific zoom level or extent set when you create your MapView, maybe in the layout XML if you're using maptions in that. If you're having specific issues with setExtent not working it may be best if you started a new thread, and post some code that reproduces the specific problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SpatialReference is used to project the Point from the spatial reference of the location point (WGS 84) to the &lt;A href="https://developers.arcgis.com/android/guide/maps-and-layers.htm#ESRI_SECTION1_B71B38B912F842CEBC941E073A61232A"&gt;map spatial reference&lt;/A&gt; - by default the spatial reference of the map, if using the Esri basemaps, would be WGS 1984 Web Mercator Auxiliary Sphere. You can find a list of all spatial references at these locations - this shows the codes (like 4326) along with the definition of the :&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/android/guide/mobile-projected-coordinate-systems.htm" title="https://developers.arcgis.com/android/guide/mobile-projected-coordinate-systems.htm"&gt;Mobile projected coordinate systems—ArcGIS Runtime SDK for Android | ArcGIS for Developers&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/android/guide/mobile-geographic-coordinate-systems.htm" title="https://developers.arcgis.com/android/guide/mobile-geographic-coordinate-systems.htm"&gt;Mobile geographic coordinate systems—ArcGIS Runtime SDK for Android | ArcGIS for Developers&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;If you're developing applications with spatial data but are not familiar with spatial references, &lt;A href="https://developers.arcgis.com/qt/guide/coordinate-systems.htm"&gt;coordinate systems&lt;/A&gt;, projections and the like, it is worth familiarising yourself with these concepts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 10:52:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18476#M119</guid>
      <dc:creator>ShellyGill1</dc:creator>
      <dc:date>2014-07-30T10:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: location aware gps realtime (android)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18477#M120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Shelly,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works, the issue was that I also used the codes below, hence the accuracy never changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (location.hasAccuracy()) {&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; accuracy = location.getAccuracy();&amp;nbsp; &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;I commented them out and set &lt;SPAN style="font-size: 10pt;"&gt;accuracy = 400;&amp;nbsp; &lt;/SPAN&gt;to get the zoom scale I needed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, we tested the Navigation autopan mode in Washington DC street yesterday and noticed that if 4G signal is low, the map stopped navigating and got stuck even after 4G signal was back. I had to reopen the app to get the map reinitialized in order to see it auto pan again. Is there any trick to solve this? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2014 14:38:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18477#M120</guid>
      <dc:creator>ThomNgo</dc:creator>
      <dc:date>2014-07-31T14:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: location aware gps realtime (android)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18478#M121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried to reproduce the issue you described, leaving the map in autopan Navigation mode, and moving between signal and no-signal areas, but I found when I returned to an area of signal, and started getting location updates again, the map updated. Are you sure this is not a different case of accidentally catching the map, meanving some navigation is done and then the auto-pan mode is turned to OFF again? And does your LocationDisplayManager.LocationListener.onLocationChanged still get called with location updates? Perhaps you can add yourself a test button that checks the mode, and re-set that if it's turned to off, and also try checking the LocationDisplayManager isStarted remains true as well. If you are still finding your problem, maybe you can try stopping and re-starting the LocationDisplayManager.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2014 15:00:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18478#M121</guid>
      <dc:creator>ShellyGill1</dc:creator>
      <dc:date>2014-08-05T15:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: location aware gps realtime (android)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18479#M122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Shelly,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It could be device itself. Mine is Samsung Galaxy Note 10.1(2012 version) with Android 4.1.2. I've tried on 3-4 same devices, same thing happened. The Auto Pan got stuck, the map didn't pan while tablet moving. I tried to restart LocationDisplayManager but it still didn't work. The only way to get it to pan again is to get out and get back to the app. Also, we've tried on Samsung Galaxy Note 10.1 (2014 version) with Android 4.3, it is better. The entire trip (45 minutes on the bus) the map only get stuck once at the beginning, as compare to 2012 tablet which stucked more than 3-4 times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot,&lt;/P&gt;&lt;P&gt;Thom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Nov 2014 19:55:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/location-aware-gps-realtime-android/m-p/18479#M122</guid>
      <dc:creator>ThomNgo</dc:creator>
      <dc:date>2014-11-05T19:55:42Z</dc:date>
    </item>
  </channel>
</rss>

