online how google geotag check android gps geotagging

how - geo tagging en android



how to add geolocation to photos (1)

No puedes verificar esto programáticamente. Tendrá que leer las etiquetas de las imágenes tomadas y verificar las coordenadas GPS manualmente, si las etiquetas están vacías, entonces el geoetiquetado está desactivado.

Puede usar la clase ExifInterface para leer los metadatos EXIF ​​de imágenes JPEG. Aquí está el enlace oficial de documentos que explica esto:

http://developer.android.com/reference/android/media/ExifInterface.html

Aquí hay un código de muestra que puede usar para leer las etiquetas:

Bundle bundle = getIntent().getExtras(); if (null != bundle) { String filepath = bundle.getString(FILE_PATH_KEY); try { ExifInterface exif = new ExifInterface(filepath); StringBuilder builder = new StringBuilder(); builder.append("Date & Time: " + getExifTag(exif, ExifInterface.TAG_DATETIME) + "/n/n"); builder.append("Flash: " + getExifTag(exif, ExifInterface.TAG_FLASH) + "/n"); builder.append("Focal Length: " + getExifTag(exif, ExifInterface.TAG_FOCAL_LENGTH) + "/n/n"); builder.append("GPS Datestamp: " + getExifTag(exif, ExifInterface.TAG_FLASH) + "/n"); builder.append("GPS Latitude: " + getExifTag(exif, ExifInterface.TAG_GPS_LATITUDE) + "/n"); builder.append("GPS Latitude Ref: " + getExifTag(exif, ExifInterface.TAG_GPS_LATITUDE_REF) + "/n"); builder.append("GPS Longitude: " + getExifTag(exif, ExifInterface.TAG_GPS_LONGITUDE) + "/n"); builder.append("GPS Longitude Ref: " + getExifTag(exif, ExifInterface.TAG_GPS_LONGITUDE_REF) + "/n"); builder.append("GPS Processing Method: " + getExifTag(exif, ExifInterface.TAG_GPS_PROCESSING_METHOD) + "/n"); builder.append("GPS Timestamp: " + getExifTag(exif, ExifInterface.TAG_GPS_TIMESTAMP) + "/n/n"); builder.append("Image Length: " + getExifTag(exif, ExifInterface.TAG_IMAGE_LENGTH) + "/n"); builder.append("Image Width: " + getExifTag(exif, ExifInterface.TAG_IMAGE_WIDTH) + "/n/n"); builder.append("Camera Make: " + getExifTag(exif, ExifInterface.TAG_MAKE) + "/n"); builder.append("Camera Model: " + getExifTag(exif, ExifInterface.TAG_MODEL) + "/n"); builder.append("Camera Orientation: " + getExifTag(exif, ExifInterface.TAG_ORIENTATION) + "/n"); builder.append("Camera White Balance: " + getExifTag(exif, ExifInterface.TAG_WHITE_BALANCE) + "/n"); builder = null; } catch (IOException e) { e.printStackTrace(); } }

¿Cómo saber si el geoetiquetado está habilitado o deshabilitado en la configuración de la cámara Android a través del código? Estamos adjuntando las etiquetas geográficas a las fotos a través del código. Usamos el Administrador de ubicación, el Escuchador de ubicación para obtener la latitud y la longitud y guardamos estas coordenadas en la foto mediante la interfaz Exif.

ExifInterface exif = new ExifInterface(/sdcard/photo/photoname.jpg); exif.setAttribute(ExifInterface.TAG_GPS_LATITUDE,String.valueOf(latitudeValueInDecimal)); exif.setAttribute(ExifInterface.TAG_GPS_LONGITUDE,String.valueOf(longitudeValueInDecimal)); exif.setAttribute(ExifInterface.TAG_GPS_LATITUDE_REF,"N"); exif.setAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF,"W"); exif.saveAttributes();

Tenemos que agregar coordenadas gps (latitud y longitud) a la foto solo cuando la geoetiqueta está habilitada en la configuración de la cámara? Entonces, ¿cómo verificar el estado de la etiqueta geográfica (ubicación de la tienda) en la configuración de la cámara? Estoy usando el teléfono HTC wildfire S?