I should make an app to take a picture and geotag it. I see 2 ways to do it:
setGpsLatitude()
etc.I'd like to know which is the best choice, or generally when is better using first or the second way.
I would use an intent to the camera and then geo tag it. Check out this documentation for the gps side of things. http://developer.android.com/guide/topics/location/obtaining-user-location.html
Just as an FYI if you want the gps to be super accurate it is not a pleasure to work with. Especially if the user is in a basement somewhere.
From my knowledge there are two main routes for gps. Fine gps and network. Network uses triangulation of service towers to tie down a gps corrd. Not super accurate but it works. Fine works but can take up to 15 seconds if the user is in a bad spot.
You also could use the google maps api and allow the user to enter in an address of where the photo was taken and convert that address to a lat and lng. https://developers.google.com/maps/documentation/geocoding/
Cheers,
Jake
check android camera app source,
get geo location: https://android.googlesource.com/platform/packages/apps/Camera.git/+/android-4.4.2_r2/src/com/android/camera/LocationManager.java
geo tag: https://android.googlesource.com/platform/packages/apps/Camera.git/+/android-4.4.2_r2/src/com/android/camera/Storage.java
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With