I have a file in my assets folder... how do I read it?
Now I\'m trying:
public static String readFileAsString(String filePath)
throws j
You should try org.appache.commons.io.IOUtils.toString(InputStream is)
to get file content as string. There you can pass InputStream
object which you will get from
getAssets().open("xml2json.txt")
in your Activity
.
To get String
use this:
String xml = IOUtils.toString((getAssets().open("xml2json.txt")));