• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Implementing a LocationListerner and Display Google Map

ac4android

Well-Known Member
Hi.

I need to get the location of my pizza-delivery guy ( not Spiderman ) and end up with something like this :
Code:
LocationListener listener = new LocationListener() 
LocationManager locMgr = (LocationManager)getSystemService(Context.LOCTION_SERVICE);
logMgr.requestLocationUpdates(LocatoinManager.GPS_PROVIDER, 10000, 1, listener);
I can also get the distance traveled. But what I need is the GPS location on the Google Map and there's where I am a bit lost. How do I display the Map with the location?

Thanks in advance.
 
Java:
double lat, lon;
Marker mymarker= map.addMarker(new MarkerOptions().position(new LatLng(lat, lon))
      .title("Pizza Guy Location"));
So you have his long and lat of the pizza guy? if you have the lat and long you could try something like this
 
Hi. I am seeking some hi-level advice on how to approach this.

In simple terms, I'll accessing a transactional database on a server via web service and getting back a dataset of 120 records on average ( could be as many as 500 ) from which I will pull 6 to 7 into SQLite. The fragment will be using a Cursor via a SimpleCursorAdaper to display the list view which the user can scroll.

ListView will have a click listener and onclick will call on the next fragment which displays the location of the pizza delivery guy on the city map.

QUESTION: the transactional records on the server database get updated about once every 30 seconds (the pizza guy is really fast on his bike). Since HTTPS is stateless, I have to replace all the records on SQLite every 30 seconds too. Does that sound right? Is that the right approach? Do you see any potential pitfalls and "gotchas", before I nock myself out coding the impossible?

I don't see how else I can update the values of the displayed records on the list view and the location on the map without refreshing the whole dataset for the cursor.

Is this how you would approach it? What do you think?
 
Back
Top Bottom