Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.net.Uri;

import android.os.Environment;

import java.io.File;

public class Main {
    public static Uri getOutputUri() {
        File dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
        if (dir.exists() == false) {
            dir.mkdirs();
        }
        File file = new File(dir, "photo.png");
        return Uri.fromFile(file);
    }
}