Answer: B linux
Description: Android is based on Linux 3.6 version.
Related questions:
Which linux kernel version is used in android?
What type of kernel is used in android?
Answer: C Java
Description: Top two layers (application, and Framework layers) are written in Java. Where as drivers layer and library layer are written in c and c++.
Answer: B Dalvik Virtual Machine
Description: The full form of DVM is "Dalvik Virtual Machine". This is the name of the virtual machine used in Android to run android applications. It is named after an island "Dalvik".
Answer: A DVM is faster than JVM, and DVM is under free license.
Description: Android team preferred DVM over JVM because of below given reasons.
1. Though JVM is free it was under GPU license, which is not good for Android as most of the Android is under Apache license.
2. JVM was designed by keep desktops in mind. So it is too heavy for embedded devices.
3. DVM takes less memory, runs & loads faster compared to JVM.
4. Since mobile devices have lot of limitations like low CPU speed and less Memory, it is always better not to use heavy components like JVM.
Answer: B library layer
Description: Every android application runs in DVM. To run an application it requires memory, process, threads and other resources. But all these resources are under control of kernel. So DVM has to interact with driver layer for memory and thread management, it sits just above driver layer (that is.. it sits in library layer)
Answer: A 4.4
Description: Latest version as on November 2013 is 4.4 that is KitKat. KitKat runs faster and smoother even in the low end devices which has mere 512 MB RAM.
Answer: D it tells your applications version number and name. It will be used when you want to update your app in google play store
Description: Version no and name will be useful when you upload some application to play store and wanted to update it. When you are upgrading your application then you can increment the version number so that users of your application will get notification on their phones about the latest updates available.
Answer: A maximum one is allowed
Description: every application will have only one manifest file which tells its capabilities.
Answer: A Yes
Description: Yes, it is possible. You can create resources with code also, with out having your xml files.
For eg: below code will work with out setting xml file as the layout for your activity.
onCreate(...)
{
super.onCreate(..);
TextView tv = new TextView(this);
tv.setText("hello world");
setContentView(tv);
}
Answer: D all of the above
Description: configuration changes include: rotating the phone, having virtual keypad on, and changing language settings in settings.
Answer: A Implicit intent - Intent with out target component name; Explicit intent - Intent with target component name.
Description: Implicit intent - Intent with out target component name; Explicit intent - Intent with target component name.
EG: if we want to start a new screen or activity with in our application, then we clearly know what is that activity name because both activities are in same application. In such cases we will use explicit intent.
Assume that we want to launch Gallery activity from our application, then we don't know exact name of that gallery activity because gallery is a different application, in that case we will use implicit intent with some matching actions.
Eg for Explicit intent:
Intent in = new Intent(getApplicationContext(), SecondScreen.class); //target component name
startActivity(in);
Note: Explicit intents are specifically used to start other components of same application.
Eg for Implicit intent:
Intent in = new Intent(); //no target component name
in.setAction(Intent.ACTION_GET_CONTENT);
in.setType("image/*");
startActivity(in);
Note: Iplicit intents are specifically used to start components of other applications.
Answer: D all above three
Description: Intent can have a.action, b.data and its type, c.category, d. extras, e.Target Component name, f. some extra flags.
Answer: C No. Intent can have 0 or maximum one action.
Description: Intent can have maximum one action, but it is not mandatory. some times it can have 0 actions also (in case of explicit intent). So an intent can have 0-1 actions.
Answer: B Yes. You can have 0 or n number of categories in intent
Description: Unlike actions, an intent can choose to have 0 or n number of categories.
Answer: B setData() - is to pass data on which to take action. putExtra() - is to send extra information about this intent.
Description: setData() - is to pass data on which to take action. putExtra() - is to send extra information about this intent.
EG: if one is starting an activity to perform ACTION_CALL, then he has to set number in setData(). this function will contain on which data target component has to take action. if one want to pass extra details also, then only use putExtra().
Answer: D Nothing will happen, but it will not launch any receiver.
Description: Unlike startActivity() and startService(); sendBroadcast() will not throw any run time exception. If there are no target components available for this broadcast it will keep quiet. It is because in case of activity and service, action is yet to be performed but in case of broadcastReceiver action is already over and we are just informing it to every one.
Answer: A Will pass the action test if intent-filter has at least one action.
Description: Will pass the action test if intent-filter has at least one action.
Answer: B it will throw run time exception - activityNotFoundException, and crashes if it is not handled properly.
Description: for startActivity(intent), if there are no matching target components or activities, then it will throw run time exception - ActivityNotFoundException, and will crash the program if this exception is not handled.
Answer: B Intent in = new Intent(); in.setAction(Intent.ACTION_CALL); in.setData(Uri.parse("tel:12345")); startActivity(in);
Description: Intent in = new Intent();
in.setAction(Intent.ACTION_CALL);
in.setData(Uri.parse("tel:12345"));
startActivity(in);
Answer: C intent - is a message passing mechanism between components of android except for Content Provider; Sticky Intent - Sticks with android, for future broad cast listeners; Pending Intent - Will be used when some one wants to fire an intent in future and may be at that time that app is not alive.
Description: intent - is a message passing mechanism between components of android, except for Content Provider. You can use intent to start any component.
Sticky Intent - Sticks with android, for future broad cast listeners. For example if BATTERY_LOW event occurs then that intent will be stick with android so that if any future user requested for BATTER_LOW, it will be fired;
Pending Intent - If you want some one to perform any Intent operation at future point of time on behalf of you, then we will use Pending Intent. Eg: Booking a ticket at late night when your application is not running. In this scenario we will create a pending intent to start a service which can book tickets at late night and hand it over to Alarm Manager to fire it at that time.