Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get one instance of a person's latitude/longitude position, without getting constant updates?  RSS feed

 
Fayyazuddin Syed
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a very basic question that is throwing me off right now. I want to get the user's location (i.e. current lat/lon co-ordinates) to be used to check against a sqlite database of location co-ordinates, and find the nearest ones. I am looking at the CLLocation class, but from what I can tell, I would use this class to get regular updates to the user's movement change which I don't need. I want to get the user's current latitude and longitude position, and based on that, determine what locations in the database are closest. How would I do this?

Thanks again for your time and help!

Sincerely;
Fayyaz
 
Alaa Nassef
Ranch Hand
Posts: 471
Hibernate Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CLLocationManager has a startUpdatingLocation and a stopUpdatingLocation. Check out the class reference, the sample code (links in the class reference) and this tutorial.
 
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like this tiny ad:
Thoughts on deprecation in Java
https://coderanch.com/t/683016/java/Deprecation-Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!