I am trying to get metadata for video files stored on the user's phone application. I can get the file name, id, date and so on. However, latitude and longitude data is always returned as 0.0. I meant the following:
developer.android.com/reference/android/provider/MediaStore.Video.VideoColumns.html
Yes, I already allow the use of location in my settings. I have a very similar feature for images that work great.
public void getLocalVideoFiles(Context context) {
ContentResolver videoResolver = context.getContentResolver();
Uri videoUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
String test = getRealPathFromURI(context, videoUri);
Cursor videoCursor = videoResolver.query(videoUri, null, null, null, null);
if(videoCursor!=null && videoCursor.moveToFirst()){
int latColumn = videoCursor.getColumnIndex
(MediaStore.Video.Media.LATITUDE);
int lonColumn = videoCursor.getColumnIndex
(MediaStore.Video.Media.LONGITUDE);
do {
String thisLat = Double.toString(videoCursor.getDouble(latColumn));
String thisLon = Double.toString(videoCursor.getDouble(lonColumn));
Log.d("video Latitude",thisLat);
Log.d("video Longitude",thisLon);
}
while (videoCursor.moveToNext());
}
return localClips;
}
The approach described here: Geotagging the captured video gives similar results (null in the METADATA_KEY_LOCATION column).
, : Android ? , , , , . , ? , .
!