Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

import android.os.Environment;

public class Main {
    public static void writeStringAsFile(final String fileContents, String fileName) {
        try {
            String path = Environment.getExternalStorageDirectory().getAbsolutePath();
            FileWriter out = new FileWriter(new File(path, fileName));
            out.write(fileContents);
            out.close();
        } catch (IOException e) {
            //!TODO
        }
    }
}