Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make Google Map v2 working in background
    primarykey
    data
    text
    <p>I am stucking at one point in my project.</p> <p>I am working on one Bike Tracking project, which is draw the path continuosly when Bike is running , path is drawing not an issue there, but when activity would go c<code>enter code here</code>lose or minimize at that time Track will work in background and when user comes back to the activity he can found whole track.</p> <p>For that I have used, services but there is problem in Google map. </p> <p>In Services I have used Location Manager methods to get latitude and longitude, but its not accurate its vary everytime.</p> <p>But before in Activity when I have used Google map's onMyLocationChangeListener at that time data will come exact point by point.</p> <p>This is the code for fetch location in Services, using LocationManager.</p> <pre><code> mLocManager = (LocationManager) getSystemService(TrackService.this.LOCATION_SERVICE); mListner = new LocationListner(); if (mLocManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) mLocManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, mListner); else { Toast.makeText(TrackService.this, "GPS is not on", Toast.LENGTH_SHORT).show(); onDestroy(); } try { mlocManager = (LocationManager) getSystemService(getApplicationContext().LOCATION_SERVICE); mListner = new LocationListner(); try { mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, mListner); } catch (Throwable e) { e.printStackTrace(); } try { mlocManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, mListner); } catch (Throwable e) { e.printStackTrace(); } } catch (Throwable e) { e.printStackTrace(); } </code></pre> <p>and in Listener I have did my code stuff.</p> <p>So I need Google map in services or Google map <code>onMyLocationChange</code> method to access in services or how can I handle this stuff in background.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload