package data.readassest;

import java.io.IOException;
import java.io.InputStream;
import android.os.Bundle;
import android.app.Activity;
import android.content.res.AssetManager;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	//	final AssetManager mgr = getAssets();    
	
		try{
		  InputStream inputStream = this.getAssets().open("hello_world.txt");
          int nBytes = inputStream.available();
		  byte data[] = new byte[nBytes];
          String str = "";
        
          //read all data from file "hello_world.txt"
	      while( inputStream.read(data) != -1);
		
	      str = new String ( data );
		  System.out.println ( str );
		  inputStream.close();
	    } catch(IOException e) {
		   e.printStackTrace();
	    }
	}
}
