Java tutorial
//package com.java2s; /* * Copyright 2015 Stanislav Petriakov * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) */ import android.graphics.BitmapFactory; public class Main { public static String getMimeTypeOfFile(String pathName) { BitmapFactory.Options opt = new BitmapFactory.Options(); opt.inJustDecodeBounds = true; BitmapFactory.decodeFile(pathName, opt); return opt.outMimeType; } }