I am trying to figure out the best way to determine a file extension given a mime type in android.
This is typically coming in the form of a content uri so I get the mime type as follows:
ContentResolver contentResolver = context.getContentResolver();
String mimeType = contentResolver.getType(uri);
From there I have been using MimeTypeMap:
MimeTypeMap mimeTypeMap = MimeTypeMap.getSingleton();
String extension = mimeTypeMap.getExtensionFromMimeType(mimeType);
This works great in most cases however there are a few glaring holes, one of them being that there is no entry for "audio/mp4".
Is there a more complete mapping I can use that is built into Android? Or any other ideas?