ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 77 - Associate Android Developer discussion

Report
Export

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 doing this:

A.
InputStream input = context.getResources().openRawResource(R.raw.sample_teas);
Answers
A.
InputStream input = context.getResources().openRawResource(R.raw.sample_teas);
B.
InputStream input = context.getAssets().open("sample_teas.json");
Answers
B.
InputStream input = context.getAssets().open("sample_teas.json");
C.
InputStream input = context.getResources().getAssets().open("sample_teas.json");
Answers
C.
InputStream input = context.getResources().getAssets().open("sample_teas.json");
Suggested answer: B
asked 18/09/2024
Christophe Troessaert
37 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first