Download Questions and Answers

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Questions and Answers
A. Closing an app.
B. Suspending an app
C. Opening a new app
D. Restoring the most recent app
e.
co
m
Q.1) Which of the following is the most ^aEURoeresource hungry ^aEURoepart of
dealing with activities on android?
ANSWER : Opening a new app
SOLUTION :
opening a new app is the most resource hungry part of dealing with activities on
android.
Q.2) How is a simulator different from an emulator?
nl
in
A. Emulator are only used to play old SNES games , simulators are used for software
development.
B. The emulator is shipped with the android SDK and third party simulators are not.
C. The emulator can virtualize sensors and other hardware features, while the simulator
cannot
D. The emulator imitates the machine executing the binary code, rather than simulating
the behavior of the code at a higher level.
w
.a
p
tio
ANSWER : The emulator imitates the machine executing the binary code, rather than
simulating the behavior of the code at a higher level.
SOLUTION :
1. Simulation is the use of modeling to create a controllable, representative stand in for
a complex system. Simulations are, by definition, always incomplete.
2. Emulation is the replacement of a real world device with an model at a well defined
interface for the purposes of allowing controlled responses from the emulated real world
device. The emulation is "complete" if all the interfaces are present, and the resulting
observed behavior matches that of the real world device.
Q.3) What is an activity?
w
w
A. A single screen the user sees on the device at one time.
B. A message sent among the major building blocks
C. A component that runs in the background without any interface.
D. Context referring to the application environment.
ANSWER : A single screen the user sees on the device at one time.
SOLUTION :
An Activity is an application component that provides a screen with which users can
interact in order to do something, such as dial the phone, take a photo, send an email,
or view a map.
Q.4) Application context are independent of the activity life cycle.
A. True
B. False
C. NA
D. NA
ANSWER : True
SOLUTION :
An application context gets created whenever the first component of this application
starts up,regardless of whether that component is an activity,a service,or something
else.The application context lives as long as your application is alive.As such it is
independent of activity life cycle.So as long as any of the activities,services,providers,or
receivers are alive,your application context is around to hold them.Once the activity
manager terminates alloy her building blocks of your app,it also gets rid of the
Page 1
Questions and Answers
application context because its no longer needed.
Q.5) Services have any user interface components.
e.
co
m
A. True
B. False
C. NA
D. NA
ANSWER : False
SOLUTION :
A Service is an application component that can perform long-running operations in the
background and does not provide a user interface.
Q.6) The xml file that contains all the text that your application uses.
nl
in
A. Stack.xml
B. Text.xml
C. Strings.xml
D. String.java
w
.a
p
tio
ANSWER : Strings.xml
SOLUTION :
A string resource provides text strings for your application with optional text styling and
formatting. There are three types of resources that can provide your application with
strings:
1.String-XML resource that provides a single string.
2.String Array-XML resource that provides an array of strings.
3.Quantity Strings (Plurals)-XML resource that carries different strings for pluralization.
All strings are capable of applying some styling markup and formatting arguments. For
information about styling and formatting strings, see the section about Formatting and
Styling.
Q.7) An activity can be thought of as corresponding to what?
w
w
A. A java project.
B. A java class
C. A method call
D. An object field
ANSWER : A java class
SOLUTION :
An activity can be thought of as corresponding to java class. An Activity is an application
component that provides a screen with which users can interact in order to do
something, such as dial the phone, take a photo, send an email, or view a map. Each
activity is given a window in which to draw its user interface. The window typically fills
the screen, but may be smaller than the screen and float on top of other windows.
Q.8) To create an emulator , you need an AVD .What does it stands for?
A. Android virtual display.
B. Android virtual device
C. Active virtual device
D. Application virtual display.
ANSWER : Android virtual device
SOLUTION :
An Android Virtual Device (AVD) is an emulator configuration that lets you model an
actual device by defining hardware and software options to be emulated by the Android
Emulator. The easiest way to create an AVD is to use the graphical AVD Manager,
which you launch from Eclipse by clicking Window > AVD Manager. You can also start
the AVD Manager from the command line by calling the android tool with the avd
Page 2
Questions and Answers
options, from the <sdk>/tools/ directory.
Q.9) What runs in the background and doesn^aEURTMt have any UI components?
e.
co
m
A. Intents
B. Content providers
C. Services
D. Applications
ANSWER : Services
SOLUTION :
A Service is an application component that can perform long-running operations in the
background and does not provide a user interface.
Q.10) When an activity doesn^aEURTMt exist in memory it is in __________.
nl
in
A. Starting state.
B. Running state
C. Loading state
D. Inexistent state.
tio
ANSWER : Starting state.
SOLUTION :
When an activity doesn^aEURTMt exist in memory it is in Starting state.
w
.a
p
Q.11) When the activity is not in focus, but still visible on the screen it is in?
A. Running state
B. Paused state
C. Stopped state
D. Destroyed state
w
ANSWER : Paused state
SOLUTION :
As long as the activity is still partially visible but currently not the activity in focus, it
remains paused.
w
Q.12) What is contained within the manifest xml file?
A. The permission the app requires
B. The list of string used in the app.
C. The source code
D. All other choices.
ANSWER : The permission the app requires
SOLUTION :
AndroidManifest.xml is a powerful file in the Android platform that allows you to describe
the functionality and requirements of your application to Android.
Q.13) There can be only one running activity at a given time.
A. True
B. False
C. NA
D. NA
ANSWER : True
SOLUTION :
There can be only one running activity at a given time. All others are paused.
Q.14)
The
emulator
is
identical
to
running
Page 3
a
real
phone
except
when
Questions and Answers
emulating/simulating what?
e.
co
m
A. Telephony
B. Applications
C. Sensors
D. The emulator can emulate/simulate all aspects of smart phone.
ANSWER : Sensors
SOLUTION :
The emulator is identical to running a real phone except when emulating/simulating
Sensors.
Q.15) The emulated device for android .
in
A. Runs the same code base as the actual device, all the way down to the machine
layer.
B. Is more of a simulator , and acts as a virtual machine for the android device.
C. Runs the same code base as the actual device, however at a higher level.
nl
D. An imaginary machine built on the hopes and dreams of baby elephants.
w
.a
p
tio
ANSWER : Runs the same code base as the actual device, all the way down to the
machine layer.
SOLUTION :
The emulator lets you develop and test Android applications without using a physical
device.
The Android emulator is an application that provides a virtual mobile device on which
you can run your Android applications. It runs a full Android system stack, down to the
kernel level, that includes a set of preinstalled applications (such as the dialer) that you
can access from your applications. You can choose what version of the Android system
you want to run in the emulator by configuring AVDs, and you can also customize the
mobile device skin and key mappings. When launching the emulator and at runtime, you
can use a variety of commands and options to control its behavior.
w
Q.16) The R file is a/an __________ generated file.
w
A. Automatically
B. Manually
C. Emulated
D. None of the above.
ANSWER : Automatically
SOLUTION :
The R file is an Automatically generated file. android.R.java is not just where XML ids
are stored. It also contains access to resources - such as drawables, layouts, strings,
arrays, and basically anything you can declare in resources. Personally I find that it is
useful when using Eclipse. I can simply type findViewById(R.id. and Eclipse will show a
tooltip with a list of options to choose from.
Q.17) What are intents?
A. Intents are messages that are sent among major building blocks.
B. Intent trigger activities to being , services to start or stop, or broadcast.
C. Intents are asynchronous
D. All of these.
ANSWER : All of these.
SOLUTION :
An intent is an abstract description of an operation to be performed. It can be used with
startActivity to launch an Activity, broadcastIntent to send it to any interested
BroadcastReceiver components, and startService(Intent) or bindService(Intent,
Page 4
Questions and Answers
e.
co
m
ServiceConnection, int) to communicate with a background Service.
An Intent provides a facility for performing late runtime binding between the code in
different applications. Its most significant use is in the launching of activities, where it
can be thought of as the glue between activities. It is basically a passive data structure
holding an abstract description of an action to be performed.
Q.18) While developing android applications, developer can test their apps on_______
A. Emulator included in android SDK.
B. Physical android phone
C. Third-party emulators
D. All three options will work.
in
ANSWER : All three options will work.
SOLUTION :
while developing android application, developer can test their apps on emulator, or on
android phone or on any third party emulator. It will give same output screen.
nl
Q.19) What is contained within the layout xml file?
A. Orientations and layouts that specify what the display look like.
tio
B. The permissions required by the app.
C. The string used in the app.
D. The code which is compiled to run the app.
w
w
w
.a
p
ANSWER : Orientations and layouts that specify what the display look like.
SOLUTION :
An Android layout is a class that handles arranging the way its children appear on the
screen. Anything that is a View (or inherits from View) can be a child of a layout. All of
the layouts inherit from ViewGroup (which inherits from View) so you can nest layouts.
You could also create your own custom layout by making a class that inherits from
ViewGroup.
The standard Layouts are:
1.AbsoluteLayout
2.FrameLayout
3.LinearLayout
4.RelativeLayout
5.TableLayout
Q.20) In an implicit intent, the sender specifies the type of receiver.
A. True
B. False
C. NA
D. NA
ANSWER : True
SOLUTION :
Implicit intents do not name a specific component, but instead declare a general action
to perform, which allows a component from another app to handle it. For example, if you
want to show the user a location on a map, you can use an implicit intent to request that
another capable app show a specified location on a map.
Q.21) The android software development kit (SDK) is all you need to develop
applications for android.
A. True
B. False
C. NA
D. NA
Page 5
Questions and Answers
ANSWER : True
SOLUTION :
True. The Android SDK provides you the API libraries and developer tools necessary to
build, test, and debug apps for Android.
e.
co
m
Q.22) Which of the following is not a state in the lifecycle of a service?
A. Starting
B. Running
C. Destroyed
D. Paused
in
ANSWER : Paused
SOLUTION :
paused is not state in lifecycle of service. Other than that STARTING,RUNNING,
DESTROYED are steps in service lifecycle.
Q.23) An activity in a stopped state is doing nothing.
tio
nl
A. True
B. False
C. NA
D. NA
w
w
w
.a
p
ANSWER : False
SOLUTION :
The fact that an activity is in a running state doesn^aEURTMt mean it^aEURTMs doing
much. It could be just sitting there and waiting for user input. Similarly, an activity in a
stopped state is not necessarily doing nothing. The state names mostly refer to how
active the activity is with respect to user input, in other words, whether an activity is
visible, in focus, or not visible at all.
Page 6