Hi,

I'm trying to retrieve Latitude/Longitude informations of an image,
but I always get 0.0 for lat/lon.
But I know the image has this information inside, because I tried it
with exiftools. When I use exiftools I can see the lat/lon values.

My Source:
startActivity:
   Intent intent = new Intent(Intent.ACTION_PICK);
   intent.setType("image/*");
   startActivityForResult(intent, 1);

and onActivtiyResult
                Uri photoUri = data.getData();
                ContentResolver cr = getContentResolver();
                Cursor cursor = cr.query(photoUri, new String[] {
                                MediaStore.Images.ImageColumns.DATA,
                                MediaStore.Images.ImageColumns.LATITUDE,
                                MediaStore.Images.ImageColumns.LONGITUDE }, 
null, null, null);
                cursor.moveToFirst();

                int fnamecol = cursor.getColumnIndexOrThrow
(Images.ImageColumns.DATA);
                int latcol = cursor.getColumnIndexOrThrow
(Images.ImageColumns.LATITUDE);
                int loncol = cursor
                                
.getColumnIndexOrThrow(Images.ImageColumns.LONGITUDE);

                String fname = cursor.getString(fnamecol);
                Float lat = cursor.getFloat(latcol);
                Float lon = cursor.getFloat(loncol);

This should work, because I get the filename,  or is this a total
wrong approach?

Regards Georg




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to