Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.io.FileOutputStream;

import android.graphics.Bitmap;

public class Main {

    public static boolean bitmapToFile(String fileName, Bitmap bmp) {
        try {
            FileOutputStream out = new FileOutputStream(fileName);
            bmp.compress(Bitmap.CompressFormat.JPEG, 90, out);
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }

    }
}