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 android.os.Environment;
import java.io.FileOutputStream;
import java.io.IOException;

public class Main {
    public static void writeFile(byte[] bytes) throws IOException {
        String apkDir = Environment.getExternalStorageDirectory() + "/download/" + "app.apk";
        java.io.File file = new java.io.File(apkDir);
        FileOutputStream fop = new FileOutputStream(file);
        fop.write(bytes);
        fop.flush();
        fop.close();
    }
}