I needed to use AssetManager API to import the stuff in the assets/ directory. Below is the code for anyone that needs it.
import
java.io.IOException;
import
java.io.InputStream;
import
android.app.Activity;
import
android.content.res.AssetManager;
import
android.os.Bundle;
import
android.widget.TextView;
public
class CodeSlider extends Activity {
@Override
protectedvoid onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.codeslider);
TextView text = (TextView)findViewById(R.id.codetext);
AssetManager am = CodeSlider.this.getAssets();
int i=0;try {InputStream is = am.open("browsercode.txt");
byte[] buffer = newbyte[4096]; // Read 4K characters at a time
int len; // How many chars read each time
while ((len = is.read(buffer)) != -1){
String s = new String(buffer, 0, len);
text.append( s );
i++;
}
} catch(IOException e) {
System.out.println("Error");
return;
}
}
}