20:00

Free Test
/ 10

Quiz

1/10
What is a correct part of an Implicit Intent for sharing data implementation?
Select the answer
1 correct answer
A.
val sendIntent = Intent(this, UploadService::class.java).apply { putExtra(Intent.EXTRA_TEXT, textMessage) ...
B.
val sendIntent = Intent().apply { type = Intent.ACTION_SEND; ...
C.
val sendIntent = Intent(this, UploadService::class.java).apply { data = Uri.parse(fileUrl) ...
D.
val sendIntent = Intent().apply { action = Intent.ACTION_SEND ...

Quiz

2/10
By default, the notification's text content is truncated to fit one line. If you want your notification to be longer, for example, to create a larger text area, you can do it in this way:
Select the answer
1 correct answer
A.
var builder = NotificationCompat.Builder(this, CHANNEL_ID) .setContentText("Much longer text that cannot fit one line...") .setStyle(NotificationCompat.BigTextStyle() .bigText("Much longer text that cannot fit one line...")) ...
B.
var builder = NotificationCompat.Builder(this, CHANNEL_ID) .setContentText("Much longer text that cannot fit one line...") .setLongText("Much longer text that cannot fit one line...")) ...
C.
var builder = NotificationCompat.Builder(this, CHANNEL_ID) .setContentText("Much longer text that cannot fit one line...") .setTheme(android.R.style.Theme_LongText); ...

Quiz

3/10
Select correct demonstration of WorkRequest cancellation.
Select the answer
1 correct answer
A.
workManager.enqueue(OneTimeWorkRequest.Builder(FooWorker::class.java).build())
B.
val request: WorkRequest = OneTimeWorkRequest.Builder (FooWorker::class.java).build() workManager.enqueue(request) val status = workManager.getWorkInfoByIdLiveData(request.id) status.observe(...)
C.
val request: WorkRequest = OneTimeWorkRequest.Builder (FooWorker::class.java).build() workManager.enqueue(request) workManager.cancelWorkById(request.id)
D.
val request1: WorkRequest = OneTimeWorkRequest.Builder (FooWorker::class.java).build() val request2: WorkRequest = OneTimeWorkRequest.Builder (BarWorker::class.java).build() val request3: WorkRequest = OneTimeWorkRequest.Builder (BazWorker::class.java).build() workManager.beginWith(request1, request2).then(request3).enqueue()
E.
val request: WorkRequest = OneTimeWorkRequest.Builder (FooWorker::class.java).build() workManager.enqueue(request) workManager.cancelWork(request)

Quiz

4/10
In general, you should send an AccessibilityEvent whenever the content of your custom view changes. For example, if you are implementing a custom slider bar that allows a user to select a numeric value by pressing the left or right arrows, your custom view should emit an event of type TYPE_VIEW_TEXT_CHANGED whenever the slider value changes. Which one of the following sample codes demonstrates the use of the sendAccessibilityEvent() method to report this event.
Select the answer
1 correct answer
A.
override fun dispatchPopulateAccessibilityEvent(event: AccessibilityEvent): Boolean { return super.dispatchPopulateAccessibilityEvent(event).let { completed -> if (text?.isNotEmpty() == true) { event.text.add(text) true } else { completed } } }
B.
override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean { return when(keyCode) { KeyEvent.KEYCODE_DPAD_LEFT -> { currentValue-- sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED) true } ... } }
C.
override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean { return when(keyCode) { KeyEvent.KEYCODE_ENTER -> { currentValue-- sendAccessibilityEvent (AccessibilityEvent.TYPE_VIEW_CONTEXT_CLICKED) true } ... } }

Quiz

5/10
The easiest way of adding menu items (to specify the options menu for an activity) is inflating an XML file into the Menu via MenuInflater. With menu_main.xml we can do it in this way:
Select the answer
1 correct answer
A.
override fun onCreateOptionsMenu(menu: Menu): Boolean { menuInflater.inflate(R.menu.menu_main, menu) return true }
B.
override fun onOptionsItemSelected(item: MenuItem): Boolean { menuInflater.inflate(R.menu.menu_main, menu) return super.onOptionsItemSelected(item) }
C.
override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.menu.menu_main) }

Quiz

6/10
Android Tests. You can use the childSelector() method to nest multiple UiSelector instances. For example, the following code example shows how your test might specify a search to find the first ListView in the currently displayed UI, then search within that ListView to find a UI element with the text property Apps. What is the correct sample?
Select the answer
1 correct answer
A.
val appItem: UiObject = device.findObject( UiSelector().className(ListView.class) .instance(1) .childSelector( UiSelector().text("Apps") ) )
B.
val appItem: UiObject = device.findObject( UiSelector().className("android.widget.ListView") .instance(0) .childSelector( UiSelector().text("Apps") ) )
C.
val appItem: UiObject = device.findObject( UiSelector().className("android.widget.ListView") .instance( UiSelector().text("Apps") ) )

Quiz

7/10
The following code snippet shows an example of an Espresso test:
Select the answer
1 correct answer
A.
@Rule fun greeterSaysHello() { onView(withId(R.id.name_field)).do(typeText("Steve")) onView(withId(R.id.greet_button)).do(click()) onView(withText("Hello Steve!")).check(matches(isDisplayed())) }
B.
@Test fun greeterSaysHello() { onView(withId(R.id.name_field)).perform(typeText("Steve")) onView(withId(R.id.greet_button)).perform(click()) onView(withText("Hello Steve!")).check(matches(isDisplayed())) }
C.
@Test fun greeterSaysHello() { onView(withId(R.id.name_field)).do(typeText("Steve")) onView(withId(R.id.greet_button)).do(click()) onView(withText("Hello Steve!")).compare(matches(isDisplayed())) }

Quiz

8/10
As an example. In an Activity we have our TimerViewModel object (extended ViewModel), named mTimerViewModel. mTimerViewModel.timer method returns a LiveData<Long> value. What can be a correct way to set an observer to change UI in case if data was changed?
Select the answer
1 correct answer
A.
mTimerViewModel!!.timer.value.toString().observe (Observer { aLong -> callAnyChangeUIMethodHere(aLong!!) })
B.
mTimerViewModel!!.timer.observe (this, Observer { aLong -> callAnyChangeUIMethodHere(aLong!!) })
C.
mTimerViewModel.observe (Observer { aLong -> callAnyChangeUIMethodHere(aLong!!) })

Quiz

9/10
LiveData.postValue() and LiveData.setValue() methods have some differences. So if you have a following code executed in the main thread: liveData.postValue("a"); liveData.setValue("b"); What will be the correct statement?
Select the answer
1 correct answer
A.
The value "b" would be set at first and later the main thread would override it with the value "a".
B.
The value "a" would be set at first and later the main thread would override it with the value "b".
C.
The value "b" would be set at first and would not be overridden with the value "a".
D.
The value "a" would be set at first and would not be overridden with the value "b".

Quiz

10/10
In our TeaViewModel class, that extends ViewModel, we have such prorerty: val tea: LiveData<Tea> An observer in our Activity (type of mViewModel variable in example is TeaViewModel) is set in this way: mViewModel!!.tea.observe(this, Observer { tea: Tea? -> displayTea(tea) }) What will be a correct displayTea method definition?
Select the answer
1 correct answer
A.
private fun displayTea()
B.
private fun displayTea(tea: Tea?)
C.
private fun displayTea(tea: LiveData?<Tea>)
D.
private fun displayTea(tea: LiveData?<T>)
Looking for more questions?Buy now

Google-Associate-Android-Developer Practice test unlocks all online simulator questions

Thank you for choosing the free version of the Google-Associate-Android-Developer practice test! Further deepen your knowledge on Google Simulator; by unlocking the full version of our Google-Associate-Android-Developer Simulator you will be able to take tests with over 126 constantly updated questions and easily pass your exam. 98% of people pass the exam in the first attempt after preparing with our 126 questions.

BUY NOW

What to expect from our Google-Associate-Android-Developer practice tests and how to prepare for any exam?

The Google-Associate-Android-Developer Simulator Practice Tests are part of the Google Database and are the best way to prepare for any Google-Associate-Android-Developer exam. The Google-Associate-Android-Developer practice tests consist of 126 questions and are written by experts to help you and prepare you to pass the exam on the first attempt. The Google-Associate-Android-Developer database includes questions from previous and other exams, which means you will be able to practice simulating past and future questions. Preparation with Google-Associate-Android-Developer Simulator will also give you an idea of the time it will take to complete each section of the Google-Associate-Android-Developer practice test . It is important to note that the Google-Associate-Android-Developer Simulator does not replace the classic Google-Associate-Android-Developer study guides; however, the Simulator provides valuable insights into what to expect and how much work needs to be done to prepare for the Google-Associate-Android-Developer exam.

BUY NOW

Google-Associate-Android-Developer Practice test therefore represents an excellent tool to prepare for the actual exam together with our Google practice test . Our Google-Associate-Android-Developer Simulator will help you assess your level of preparation and understand your strengths and weaknesses. Below you can read all the quizzes you will find in our Google-Associate-Android-Developer Simulator and how our unique Google-Associate-Android-Developer Database made up of real questions:

Info quiz:

  • Quiz name:Google-Associate-Android-Developer
  • Total number of questions:126
  • Number of questions for the test:50
  • Pass score:80%

You can prepare for the Google-Associate-Android-Developer exams with our mobile app. It is very easy to use and even works offline in case of network failure, with all the functions you need to study and practice with our Google-Associate-Android-Developer Simulator.

Use our Mobile App, available for both Android and iOS devices, with our Google-Associate-Android-Developer Simulator . You can use it anywhere and always remember that our mobile app is free and available on all stores.

Our Mobile App contains all Google-Associate-Android-Developer practice tests which consist of 126 questions and also provide study material to pass the final Google-Associate-Android-Developer exam with guaranteed success. Our Google-Associate-Android-Developer database contain hundreds of questions and Google Tests related to Google-Associate-Android-Developer Exam. This way you can practice anywhere you want, even offline without the internet.

BUY NOW