How do you validate Location? seems that setting it to these values Location.setLatitude(999) & Location.setLongitude(999) are valid (means there’s no any validation). Is there a Android way to validate it? (i know the maximum and minimum values of it but just wondering if there’s already available using Android)
How do you validate Location? seems that setting it to these values Location.setLatitude(999) &
Share
I don’t think there is anything in Android to do this. Like you said, it’s probably best to just define the min and max.
On a side note, you could call Google’s Geocoding service and pass in your lat and long as input parameters to check the result for a valid location before calling Location.setLatitude():
http://code.google.com/apis/maps/documentation/geocoding/