Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

DM461/ITC461 Mobile Applications Quiz-1 29 March 2023

1- For which of the following Android is mainly developed?


a) Servers
b) Desktops
c) Laptops
d) Mobile devices

2- Which of the following virtual machine is used by the Android operating system?
a) JVM
b) Dalvik virtual machine
c) Simple virtual machine
d) None of the above

3- On which of the following, developers can test the application, during developing the android
applications?
a) Third-party emulators
b) Emulator included in Android SDK
c) Physical android phone
d) All of the them

4- Which of the following kernel is used in Android?


a) MAC
b) Windows
c) Linux
d) Redhat

5- Which of the following is the first callback method that is invoked by the system during an activity
life-cycle?
a) onClick() method
b) onCreate() method
c) onStart() method
d) onRestart() method

6- We require an AVD to create an emulator. What does AVD stand for?


a) Android Virtual device
b) Android Virtual display
c) Active Virtual display
d) Active Virtual device
7- What is the use of content provider in Android?
a) For storing the data in the database
b) For sharing the data between applications
c) For sending the data from an application to another application
d) None of the above

8- Which of the following android component displays the part of an activity on screen?
a) View
b) Manifest
c) Intent
d) Fragment

9- Which of the following is the topmost layer of android architecture?


a) System Libraries and Android Runtime
b) Linux Kernel
c) Applications
d) Applications Framework

10- Which of the layer is below the down most layer of android architecture?
a) System Libraries and Android Runtime
b) Linux Kernel
c) Applications
d) Applications Framework

11- What is contained in manifest.xml?


a) Source code
b) List of strings used in the app
c) Permission that the application requires
d) None of the above

12- In which state the activity is, if it is not in focus, but still visible on the screen?
a) Stopped state
b) Destroyed state
c) Paused state
d) Running state

13- In Android studio, which of the following callback is called when an activity starts interacting with
the user?
a) onDestroy
b) onCreate
c) onResume
d) onStop

14- What is an activity in Android?


a) Activity performs the actions on the screen
b) Manage the Application content
c) Screen UI
d) None of the above

15- What is sandbox in android?


a) Each application runs securely in sandbox without interrupting another process
b) Android Box
c) Android development tool kit
d) None of the above

16- Intents are used to:


a) are messages that are sent among major building blocks
b) trigger activities to being, services to start or stop, or broadcast
c) are asynchronous
d) all of those

17- What is the parent class of all Activity widgets?


a) ViewGroup
b) Layout
c) View
d) Widget

18- How to pass the data between activities in Android?


a) Intent
b) Content Provider
c) Broadcast receiver
d) None of the Above

19- Which features are considered while creating android application?


a) Screen Size
b) Input configuration
c) Platform Version
d) All of the above

20- Which attribute is an identifier for a view so that it may later be retrieved using the
View.findViewById method?
a) id
b) X axis
c) Y axis
d) None

Implementation:
We have a user interface with a Button and an ImageView that displays an image representing a
lemon tree named “lemontree.png”. We are adding a listener to the button so that when the button is
clicked the image should change to a lemon as if we picked a lemon from the lemon tree, so the
ImageView will change the displayed picture to a picture named “lemon.png”.

Select the appropriate answers from the following to complete the class:
In the following code we are defining an ImageView.
1. <ImageView
2. android:id="@+id/image_view"
3. android:layout_width="wrap_content"
4. android:layout_height="wrap_content"
5. android:src=" ? " />

To load the image in the ImageView control (where the question mark is, line 5), we upload the photo
in the src as follows:
a) @drawable/lemon
b) @string/lemon
c) @values/lemon
d) Lemon.png

To change the image displayed in the ImageView control, we use the following statements:
1. ImageView imageView = findViewById(R.id.image_view);
2. imageView.setImageResource(image_source);

We add these statements in the listener in which method:


a) onCreate( )
b) onResume( )
c) onClick( )
d) onClickHandler( )

If our activity is defined as follows:


public class MyActivity extends Activity implements View.OnClickListener{
//Activity definition
}

Setting the listener to the button would be as following:


a) Submit_btn.setOnClickListener(new View.OnClickListener( ){
public void onClick(View v) {
//add action
}
});

b) Submit_btn.setOnClickListener(this);
c) Submit_btn.setOnClickListener(onClick(View v){
//add action
});

You might also like