Code example for BitmapFactory.Options

Methods: decodeFileDescriptor

     * @param imagePath 
     * @param sampleSize 
     * @return bitmap or null if read fails 
    public static Bitmap getBitmap(final String imagePath, int sampleSize) {
        final Options options = new Options();
        options.inDither = false;
        options.inSampleSize = sampleSize;
        RandomAccessFile file = null;
        try { 
            file = new RandomAccessFile(imagePath, "r");
            return BitmapFactory.decodeFileDescriptor(file.getFD(), null,
        } catch (IOException e) {
            Log.d(TAG, e.getMessage(), e);
            return null; 
        } finally { 
            if (file != null)
                try { 
Connect your IDE to all the code out there  Get Codota for Java