MimeTypeMap provides mapping between MIME types and file extensions, but only for a hardcoded list of types. Applications should be able to define new mappings.
Many applications generate files in custom formats and allow users to share those files. For example, users might attach those files to emails or post them on websites. Android uses MIME types as its primary means of identifying file types and selecting applications to process them. For example, the Gmail app uses the MIME type of an attachment to select an app for previewing it. If its MIME type is unknown, no Preview button is shown and the user cannot interact with the attachment in any way.
Unfortunately, the MIME type of a file can easily be lost. For example, open the email on a desktop computer, save the attachment to disk, then attach it to a new email. Or post the file on a website. In this case, the file extension is the only indication of the file type. For "standard" file types that are built into MimeTypeMap, that is sufficient. But for application-defined file formats with different file extensions, there is no way to make use of that information.
To fix this problem, please allow a tag to be included in the application's manifest defining a custom file extension and the corresponding MIME type. When the application was installed, its mapping would automatically be registered, and MimeTypeMap would produce the correct type for those files.
For more discussion of this issue, please see