Want to pass your Associate Android Developer (Kotlin and Java) ASSOCIATE-ANDROID-DEVELOPER exam in the very first attempt? Try Pass2lead! It is equally effective for both starters and IT professionals.
VCE
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")
In our TeaViewModelclass, that extends ViewModel, we have such method:
public LiveData
An observer in our Activity (type of mViewModelvariable in example is TeaViewModel) is set in this way:
mViewModel.getTea().observe(this, this::displayTea);
What will be a correct displayTea method definition?
A. private void displayTea()
B. private void displayTea(Tea tea)
C. private void displayTea(LiveData
D. private void displayTea(LiveData
Working with Custom View. To define custom attributes, we can add
A. res/layout/attrs.xml
B. res/values/attrs.xml
C. res/raw/attrs.xml
D. res/xml/attrs.xml