Method for Java to obtain file type according to file header in Android
This article describes the method of Java in Android to obtain the file type according to the file header. Share with you for your reference, as follows:
Previously, we talked about the mediafile class inside the Android system to obtain the file type. This class is mainly judged according to the file extension, and its accuracy is not very good. For details, you can see that the Android system uses the mediafile class to judge the audio file type. In fact, the best way to get the file type is to judge according to the file header information. Relevant codes are posted below:
More readers interested in Android related content can view the special topics of this site: introduction and advanced tutorial of Android development, summary of Android multimedia operation skills (audio, video, recording, etc.), summary of Android basic components usage, summary of Android view technology, summary of Android layout skills and summary of Android control usage
I hope this article will help you in Android programming.