Steps :
1. Place your text file in the /assets directory under the Android project.
2. Use AssetManager class to access it.
Code Snippets :
AssetManager am = context.getAssets();
InputStream is = am.open("test.txt");
OR
1. you can also put the file in the /res/raw directory,
2.where the file will be indexed and is accessible by an id in the R file:
InputStream is = getResources().openRawResource(R.raw.test);
1. Place your text file in the /assets directory under the Android project.
2. Use AssetManager class to access it.
Code Snippets :
AssetManager am = context.getAssets();
InputStream is = am.open("test.txt");
OR
1. you can also put the file in the /res/raw directory,
2.where the file will be indexed and is accessible by an id in the R file:
InputStream is = getResources().openRawResource(R.raw.test);
No comments:
Post a Comment