I\'m a beginner in Android programming.
I\'m writing an application to list all video file in a folder and display information of all videos in the folder. But when
Use MediaMetadataRetriever to retrieve media specific data:
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
//use one of overloaded setDataSource() functions to set your data source
retriever.setDataSource(context, Uri.fromFile(videoFile));
String time = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION);
long timeInMillisec = Long.parseLong(time );
retriever.release()