Java tutorial
//package com.java2s; import android.webkit.MimeTypeMap; public class Main { public static String getMineType(String path) { String suffix = getSuffix(path); return MimeTypeMap.getSingleton().getMimeTypeFromExtension(suffix.toLowerCase()); } public static String getSuffix(String fileName) { if (fileName == null) return null; int point = fileName.lastIndexOf("."); if (point != -1) { return fileName.substring(point + 1); } return fileName; } }