Thursday, October 27, 2011

AssetManager in Android

How do you read the files kept under the asset folder in Android?
Answer is we can use Asset Manager.
1) Get all the assets using AssetManager (Under activity you have access to the get assests method)
AssetManger assets = getAssests();
2) Once you get the assets, we can look up or open the file using the file name
InputStream is = assets.open(filename);
Once you have the ionputstream, you can read the content in what ever way we need.

No comments:

Post a Comment