Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Android Associate Developer (TUGAS 1-RP)

Total questions: 15

Worksheet time: 14mins

Name
Class
Date
1.


What Activity method you use to retrieve a reference to an Android view by using the id attribute of a resource XML?

a)

findViewByReference(int id)

b)

retrieveResourceById(int id)

c)

findViewById(int id)

d)

findViewById(String id)

2.

During an Activity life-cycle, what is the first callback method invoked by the system?

a)

onCreate()

b)

onStart()

c)

onStop()

d)

onRestore()

3.

What does the following line of code achieve?

Intent intent = new Intent(FirstActivity.this, SecondActivity.class );

a)

Starts an activity

b)

Creates an implicit Intent.

c)

Creates a hidden Intent.

d)

Create an explicit Intent.

4.


Which of the following is NOT a valid usage for Intents?

a)

Activate a SQLite DB Connection.

b)

Activate a Broadcast receiver.

c)

Activate a Service.

d)

Activate and Activity.

5.

What is the parent class of all Activity widgets?

a)

Layout

b)

ViewGroup

c)

View

d)

Widget

6.

What does this code do?

Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setData(android.net.Uri.parse("http://www.androidatc.com")); startActivity(intent);

a)

Starts an activity using an implicit intent.

b)

Sends results to another activity

c)

Starts a sub-activity.

d)

Starts a service

7.

Which method should you use to start a sub-activity?

a)

startSubActivity(Intent intent)

b)

startService(Intent intent)

c)

startActivity(Intent intent)

d)

startActivityForResult(Intent intent)

8.

What is not true about the AndroidManifest.xml file?

a)

It declares the views used within the application.

b)

It declares user permissions the application requires.

c)

It declares hardware and software features used within the application.

d)

It declares application components.

9.

If your application is throwing exception android.content.ActivityNotFoundException, which of the following could resolve the problem?

a)

Add the activity to AndroidManifest.xml

b)

Create the activity layout

c)

Create a new sub-class of the View class

d)

Create a new broadcast receiver

10.

Consider the following code:

Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setData(android.net.Uri.parse("http://www.androidatc.com")); startActivity(intent);

Which of the following is correct about the code above?

a)

It will not compile without adding the INTERNET permission the Manifest file

b)

It starts any activity in the application that has a WebView in its layout

c)

When it is executed, the system starts an intent resolution process to start the right Activity.

d)

It sends a result to a new Activity in a Bundle

11.

What is the name of the class used by Intent to store additional information?

a)

Parcelable

b)

Extra

c)

DataStore

d)

Bundle

12.

What does the Android project folder “res/” contain?

a)

Resource files

b)

Java source code

c)

Java Activity classes

d)

Libraries

13.

Which of the following methods is called in an Activity when another activity gets into the foreground?

a)

onDestroy()

b)

onPause()

c)

onStop()

d)

onExit()

14.

Which of the following is incorrect about intents?

a)

They can be used to start an Activity

b)

They can be used to start a service

c)

They can be used to start database insertion

d)


They can be used to start a dialog-themed activity

15.

Which of the following lines of code is used to pass a value to the next activity?

a)

Intent i = new Intent(this,newActivity);

i.addExtra(“test”);

startActivity(i);

b)

Intent i = new Intent(this,newActivity);

i.putValue(“value1”,“test”);

startActivity(i);

c)

Intent i = new Intent(this,newActivity);

i.putValue(“test”);

startActivity(i);

d)

Intent i = new Intent(this,newActivity);

i.putExtra(“value1”,“test”);

startActivity(i);