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.*;
import android.os.*;

public class Main {
    public static String patch = Environment.getExternalStorageDirectory() + "/data/XssCreated/css/";
    public static String name = "custom.css";

    public static void openNamedFile(String filename) {
        try {
            File f = new File(filename);
            //   Log.e("kuinfa", "filename= " + filename);
            FileInputStream fis = new FileInputStream(f);

            long size = f.length();
            name = f.getName();
            patch = f.getParentFile().toString();
            DataInputStream dis = new DataInputStream(fis);
            byte[] b = new byte[(int) size];
            int length = dis.read(b, 0, (int) size);

            dis.close();
            fis.close();

            String ttt = new String(b, 0, length, "UTF-8");

            try {
                ttt = new String(ttt.getBytes(), "UTF-8");
            } catch (UnsupportedEncodingException e) {
            }

        } catch (FileNotFoundException e) {
        } catch (IOException e) {
        }
    }
}