android - Column 'latitude' does not exist when trying to retrieve video lat/long -


i'm trying retrieve lat/long of video selected using action_get_content intent. have following code:

int data_column_index = cursor.getcolumnindexorthrow(mediastore.images.media.data); int lat_column_index = cursor.getcolumnindexorthrow(mediastore.video.media.latitude); int long_column_index = cursor.getcolumnindexorthrow(mediastore.video.media.longitude); 

i'm getting exception on latitutde/longitude column:

java.lang.runtimeexception: failure delivering result resultinfo{who=null, request=0, result=-1, data=intent { dat=content://media/external/video/media/1749 flg=0x1 }} activity {}: java.lang.illegalargumentexception: **column 'latitude' not exist** 

i love feedback has experience retrieving lat/long of video/image

android uses new constant called metadata_key_location in mediametadataretriever class let apps access location information images , videos. link docs here

example (not tested pieced together):

 mediametadataretriever mediametadataretriever = new mediametadataretriever();    mediametadataretriever.setdatasource(_currentvideofile.getabsolutepath());    string location = mediametadataretriever                   .extractmetadata(mediametadataretriever.metadata_key_location); 

according documentation should give lat/long string "-90.0000+180.0000" explained here

hope helps.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -