Assets in the asset folder
Is important to import a file from your asset folder for input with the assetManager. Nothing else works at me. I try a script objLoader to import a cube.obj with the try:
try { //try to open file
reader = new BufferedReader(new InputStreamReader(new FileInputStream(fileName)));
}
this sucks completely.
Now i do that:
Open an asset using ACCESS_STREAMING mode. This provides access to files that have been bundled with an application as assets -- that is, files placed in to the "assets" directory.
AssetManager assetManager = getAssets();
// To load text file
InputStream input;
try {
input = assetManager.open("cube.obj");
int size = input.available();
byte[] buffer = new byte[size];
input.read(buffer);
input.close();
// byte buffer into a string
String text = new String(buffer);
txtContent.setText(text);
}
Thats is it.