Java tutorial
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import android.graphics.BitmapFactory; public class Main { public static int[] getImageWidhtHeightFromFilePath(String filePath) { try { BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; File imageFile = new File(filePath); InputStream is = new FileInputStream(imageFile); BitmapFactory.decodeStream(is, null, options); return new int[] { options.outWidth, options.outHeight }; } catch (FileNotFoundException e) { e.printStackTrace(); return null; } } }