Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.content.Context;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class Main {
    public static String readFile(Context context) {

        String tempo;
        String contenuDuFichier = "";

        InputStream input = null;
        try {

            input = context.getResources().getAssets().open("ManualText.txt");
            BufferedReader bfr = new BufferedReader(new InputStreamReader(input));
            while ((tempo = bfr.readLine()) != null) {
                contenuDuFichier += tempo;
            }
            bfr.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return contenuDuFichier;
    }
}