Professional Documents
Culture Documents
- The emulator allows the developers to work around an interface which acts as if it
were an actual mobile device.
- They can write, test and debug the code.
- They are safe for testing the code in early design phase
- Notification messages to the user from an Android enabled device can be displayed
using Intents. The users can respond to intents. - There are two types of Intents -
Explicit Intent, Implicit Intent.
- Explicit intent specifies the particular activity that should respond to the intent. -
They are used for application internal messages.
http://placement.freshersworld.com/power-preparation/Android-Interview-Questions Page 1 of 7
Android Interview Questions-Interview Questions and Answers-46995 20/08/15 4:26 pm
- There can be more than one intents, depending on the services and activities that are
going to use them.
- Each component needs to tell which intents they want to respond to.
- Intent filters filter out the intents that these components are willing to respond to.
- Layout details are placed in XML files - XML-based layouts provide a consistent and
standard means of setting GUI definition format.
- Containers hold objects and widgets in a specified arrangement. - They can also hold
labels, fields, buttons, or child containers. .
- Certain restrictions to protect data and code can be set using permissions. - In
absence of these permissions, codes could get compromised causing defects in
functionality.
http://placement.freshersworld.com/power-preparation/Android-Interview-Questions Page 2 of 7
Android Interview Questions-Interview Questions and Answers-46995 20/08/15 4:26 pm
- The Nine-patch in the image name refers to the way the image can be resized: 4
corners that are unscaled, 4 edges that are scaled in 1 axis, and the middle one that
can be scaled into both axes. - A Nine-patch image allows resizing that can be used as
background or other image size requirements for the target device.
http://placement.freshersworld.com/power-preparation/Android-Interview-Questions Page 3 of 7
Android Interview Questions-Interview Questions and Answers-46995 20/08/15 4:26 pm
onResume() method is an activity lifecycle method. This is called when the activity
come to foreground. You can override this method in your activity to execute code
when activity is started, restarted or comes to foreground.
For launching an activity, we need to create an explicit intent that defines the activity
that we wish to start. In the below code snippet, the first parameter to Intent
constructor is the current activity context and the second parameter is your new
activity class.startActivity() method can be called on Activity context.
<activity android:name=".MyActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
http://placement.freshersworld.com/power-preparation/Android-Interview-Questions Page 4 of 7
Android Interview Questions-Interview Questions and Answers-46995 20/08/15 4:26 pm
22. What is the difference between a regular .png and a nine-patch image?
The nine patch images are extension with .9.png. Nine-patch image allows resizing
that can be used as background or other image size requirements for the target device.
The Nine-patch refers to the way you can resize the image: 4 corners that are
unscaled, 4 edges that are scaled in 1 axis, and the middle one that can be scaled into
both axes.
Share intent is an easy and convenient way of sharing content of your application with
other apps.
http://placement.freshersworld.com/power-preparation/Android-Interview-Questions Page 5 of 7
Android Interview Questions-Interview Questions and Answers-46995 20/08/15 4:26 pm
Context defines the current state of application or object. Context provides access to
things such as creating new activity instance, access databases, start a service, etc.
You can get the context by invoking getApplicationContext(), getContext(),
getBaseContext() or this when in the activity class.
//start activity. Here this means activity context Intent intent = new Intent(this,
SecondActivity.class);
http://placement.freshersworld.com/power-preparation/Android-Interview-Questions Page 6 of 7
Android Interview Questions-Interview Questions and Answers-46995 20/08/15 4:26 pm
Views Notifications
Tost notification
Status bar notification
Dialog notification
29. How do you find any view element into your program?
Findviewbyid
Handler allows yo to send and process message and runnable objects associated with
a thread’s message queue.
http://placement.freshersworld.com/power-preparation/Android-Interview-Questions Page 7 of 7