Associate Android Developer
Associate Android Developer Exam

What is a correct part of an Implicit Intent for sharing data implementation?

  1. val sendIntent = Intent(this, UploadService::class.java).apply {
    putExtra(Intent.EXTRA_TEXT, textMessage)
    ...
  2. val sendIntent = Intent().apply {
    type = Intent.ACTION_SEND;
    ...
  3. val sendIntent = Intent(this, UploadService::class.java).apply {
    data = Uri.parse(fileUrl)
    ...
  4. val sendIntent = Intent().apply {
    action = Intent.ACTION_SEND
    ...

Answer(s): D

Explanation:

Create the text message with a string
val sendIntent = Intent().apply {
action = Intent.ACTION_SEND
putExtra(Intent.EXTRA_TEXT, textMessage)
type = "text/plain"
}


Reference:

https://developer.android.com/guide/components/fundamentals



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:

  1. 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..."))
    ...
  2. 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..."))

    ...
  3. var builder = NotificationCompat.Builder(this, CHANNEL_ID)
    .setContentText("Much longer text that cannot fit one line...")
    .setTheme(android.R.style.Theme_LongText);
    ...

Answer(s): A


Reference:

https://developer.android.com/training/notify-user/build-notification



Select correct demonstration of WorkRequest cancellation.

  1. workManager.enqueue(OneTimeWorkRequest.Builder(FooWorker::class.java).build())
  2. val request: WorkRequest = OneTimeWorkRequest.Builder(FooWorker::class.java).build()
    workManager.enqueue(request)
    val status = workManager.getWorkInfoByIdLiveData(request.id)
    status.observe(...)
  3. val request: WorkRequest = OneTimeWorkRequest.Builder(FooWorker::class.java).build()
    workManager.enqueue(request)
    workManager.cancelWorkById(request.id)
  4. 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()
  5. val request: WorkRequest = OneTimeWorkRequest.Builder(FooWorker::class.java).build()
    workManager.enqueue(request)
    workManager.cancelWork(request)

Answer(s): C

Explanation:

Videos:
-Working with WorkManager, from the 2018 Android Dev Summit
-WorkManager: Beyond the basics, from the 2019 Android Dev Summit


Reference:

https://developer.android.com/reference/androidx/work/WorkManager?hl=en



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.

  1. override fun dispatchPopulateAccessibilityEvent(event: AccessibilityEvent): Boolean {
    return super.dispatchPopulateAccessibilityEvent(event).let { completed ->
    if (text?.isNotEmpty() == true) {
    event.text.add(text)
    true
    } else {
    completed
    }
    }
    }
  2. override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean {
    return when(keyCode) {
    KeyEvent.KEYCODE_DPAD_LEFT -> {
    currentValue--
    sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED)
    true
    }
    ...
    }
    }
  3. override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean {
    return when(keyCode) {
    KeyEvent.KEYCODE_ENTER -> {
    currentValue--
    sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CONTEXT_CLICKED)
    true
    }
    ...
    }
    }

Answer(s): B


Reference:

https://developer.android.com/guide/topics/ui/accessibility/custom-views




Lin Tzu
QUESTION: 154 - answer (D) - Transit gateway is wrong, should be C & E. Below are the components of the site to site VPN: Customer Gateway: A customer gateway is a physical device or software application on your side of the Site-to-Site VPN connection. Virtual Private Gateway: A virtual private gateway is the VPN concentrator on the AWS side of the Site-to-Site VPN connection. You create a virtual private gateway and attach it to the VPC from which you want to create the Site-to-Site VPN connection.
- Anonymous
Upvote


saritha
I have passed the exam thankyou
- UNITED STATES
Upvote


Tzu Lin
What are the benefits of consolidated billing for AWS Cloud services? (Choose two.) Answer(s): C,E C) One bill for multiple accounts E) Custom cost and usage budget creation E seems incorrect, should be A = Volume discounts (Combined usage – You can combine the usage across all accounts in the organization to share the volume pricing discounts)
- UNITED STATES
Upvote


Niraj
Questions are valid. I just passed.
- India
Upvote


Sarah
Fantastic effort on the practice exam!
- UNITED STATES
Upvote


Marcus
Impressive work on this exam dumps. Love the free version.
- CANADA
Upvote


Emily
Great job on these practice exam questions! You guys are the best.
- CANADA
Upvote


seagal
I just passed (310-025) SCJP test yesterday. Your guide is right on the money and almost covers every question word for word. Great work !
- Edmonton
Upvote


Illya
I passed my exam today with a score of 964. This was a difficult test but the preparation guide was very good. I would not have passed without the materials. Thank you very much for giving me the opportunity to better my life.
- Alberta
Upvote


Jackson
Exam syo-101 Exam I passed my exam today with no problem whatsoever. I just wanted to say a sincere thank you for the outstanding study guide. You guys are a phenomenal help when it comes to study assistance. Thanks and definitely expect to see me again.
- MJ
Upvote

Read more ...