• 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
Nov 3, 2015
198
29
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.
 
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?
 
Upvote 0
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones