The Android SDK contains class MediaMetadataRetriever with which we can obtain the metadata within a file, you can read more about the constants that define each metadata here :
public void readMetaData(){
File sdcard = Environment.getExternalStorageDirectory();
File file = new File(sdcard,"/Android/data/miarchivo.mp4");
if (file.exists()) {
Log.i(TAG, "Existe el archivo .mp4");
//Clase agregada en API 10
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
try {
retriever.setDataSource(file.getAbsolutePath());
for (int i = 0; i < 1000; i++){
if(retriever.extractMetadata(i)!=null) {
Log.i(TAG, "Metadata :: " + retriever.extractMetadata(i));
}
}
}catch (Exception e){
Log.e(TAG, "Exception : " + e.getMessage());
}
}else {
Log.e(TAG, "NO Existe el archivo .mp4");
}
}
To write or edit metada, the android SDK does not have any method, probably for copyright reasons, but you can use options like:
link
link
link