Page 1 of 1

For example, we have a file in our assets folder app/src/main/assets/sample_teas.json. To get an InputStream for reading

Posted: Mon Aug 01, 2022 9:41 am
by answerhappygod
For example, we have a file in our assets folder app/src/main/assets/sample_teas.json. To get an InputStream for reading it, from out Context context, we can try do this:

A. val input = context!!.resources.openRawResource(R.raw.sample_teas)
B. val input = context!!.assets.open("sample_teas.json")
C. val input = context!!.resources.assets.open("sample_teas.json")