title: How can I get the location data of a video in Android?
body: <p>I am trying to get the metadata for the video files stored on my app's user's phone. I can get the file name, id, date taken and so on. However, latitude and longitude data always returns as 0.0. I have been referring to this:</p>
  
  <p>developer.android.com/reference/android/provider/MediaStore.Video.VideoColumns.html</p>
  
  <p>Yes, I am already enabling use location in my settings. I have a very similar function to this for images which works fine.</p>
  
  <pre><code>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 &amp;&amp; videoCursor.moveToFirst()){
          //get columns
          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;
  }
  </code></pre>
  
  <p>The approach described here: <a href="https://stackoverflow.com/questions/8310317/geotagging-a-captured-video">Geotagging a captured video</a> yields similar results (null value in the METADATA_KEY_LOCATION column). </p>
  
  <p>So, my question is: <em>does</em> the built-in Android video tool record location data when creating videos? It seems like the answer is no, but I don't understand why there are columns for the location data if this is the case. If that is not the case, how can I access the video location data?  I need the location of video files that have already been taken.</p>
  
  <p>Thanks in advance!</p>