Answer: C No, Intent-filter tag doesn't have extra tag at all.
Description: intent-filter tag will not have extra tag. it has only action, category, and data tags. extra tag will not be used while performing tests for intent resolution.
Answer: D option 1 and option 2 are correct
Description: Menus are designed using xml, because menus will not change so frequently. You can build menus using code also when ever required. But it is not recommended to completely build menus using code.
Dialogs are built using code because dialog content will frequently change.
Answer: B SubMenu, OptionsMenu, ContextMenu
Description: Options Menu - triggered when user presses menu hard key. This is deprecated starting from android 3.0. In place of options menu migrate to action bars.
Sub Menu - Menu with in a menu (only one level of sub menu is allowed).
Context Menu - Triggered when user press and hold on some view which was registered to show context menu.
Answer: B AlertDialog, Progressdialog, date & time picker dialog
Description: 1. AlertDialog - This is the most common form of any dialog, which will contain title, text, and maximum 3 buttons.
There in this 4 types of it - normal alert dialog, items alert dialog, single choice, & multi choice alert dialog.
2. ProgressDialog. - This is to show progress bar in the dialog box.
3. DatePickerDialog - This is to show date to pick.
4. Time picker dialog - This is to show time to pick.
Answer: C Use getPreferences(), but its not guaranteed to be protected as it will be stored with the name of Activity.
Description: getPreferences(0) - will open or create a preference file with out giving a name specifically. By default preference file name will be the current Activity name. if some one knows this, any once can access getPreference() file using that activity name.
getSharedPreferences("name",0) - will open or create a preference file with the given name. If you want to create a preference file with a specific name then use this function. If you want multiple preference files for you activity, then also you can use this function.
Note: preferences file will be with .xml extension stored in data/data/preferences folder.
Answer: A it starts a new task
Description: Once user presses home button, and if he launches any other application, then it will create a new task.
Answer: C option 1 and 2 are right.
Description: intent : is a message passing mechanism between components of android, except for content provider.
you can use intents to pass data from one component to other component.
you can also use intents to start one component from other component. eg: you can start an activity by using intents.
intent-filter : tells about the capabilities of that component.
it tells what kind of implicit intents that component can handle.
intent-filters are counter parts for intents.
Answer: C local variables - declared in the function
class variables - declared in class, static
instance variables - declared in class which are non static
Description: local variables - declared in the function
class variables - declared in class, static
instance variables - declared in class which are non static
Answer: A android.permission.CALL_PHONE
Description: To make calls, we should have below permission tag in manifest file after application tag.
uses-permission android:name = "android.permission.CALL_PHONE"/.
Answer: A src -> contains source code files
gen -> auto generated files by appt tool
bin -> contains .class and apk files
res -> contains all resource files
drawable -> contains images used for project
layouts -> contains layout xml designs
values -> contains strings xml files
Description: src -> contains source code files
gen -> auto generated files by appt tool
bin -> contains .class and apk files
res -> contains all resource files
drawable -> contains images used for project
layouts -> contains layout xml designs
values -> contains strings xml files
Answer: D all the above tests
Description: When programmer starts a component by using an intent, to trigger appropriate component android will perform 3 tests.
1.action test : the action string of intent should match with at least one action string of intent filter.
2.data test : data and data type of intent should match with that of intent filter.
3.category test : all the categories of intent should be there in intent filter.
note: In case of implicit intent starting an activity, then default category will be automatically added to intent.
If there is any component in manifest file with an intent filter which passes all the 3 tests, then android will trigger that component. Else not.
If there are multiple components satisfying that intent, and if it is not a broadcast receiver, then it will ask user to make a decision.
Answer: A No, with out any action no one can trigger or start that component from outside world.
Description: Without any action in the intent filter, it is not possible to start that component from outside world.
intent filters, action will be considered only for implicit intents.
Note: You can explicit intents only with in the application.
Answer: C intent filters can have 0 or more number of actions. But if that component has only one intent-filter with 0 actions, then that component can be triggered using only explicit intents.
Description: intent-filters can have 0 - n number of actions, but if that component has only one intent-filter with 0 actions, then that component can be triggered using only explicit intents. a given intent-filter can have more than one action because, a given component can do more than one action. EG: notepad can perform two actions ACTION_VIEW & ACTION_EDIT on an existing note pad file.
Answer: C Yes, you can have n no of categories in it.
Description: Intent filter can have n number of categories.
Answer: D Option 3 is true, but not always. some times you don't need to get the intent specifically.
Description: Use getIntent() - then- getAction(). getIntent will give you the intent, from which you can fetch the action. but some times intent will be directly available in onNewIntent() function of the activity, in some scenarios. in that case you don't need to use getIntent() specifically.
Answer: A It needs one service with one worker thread, and one activity.
Description: To access user name, pw & to show login status in dialog we need - one Activity with dialog. To connect to Gmail server we need - one Service, with one thread.
Answer: C data segment
Description: stack - stores local variables. heap - instance variables and new instances. data segment - will store all static variables. code segment - will store code.
Answer: D Yes, extend TextView class and create your own.
Description: TextView is a predefined UI control given by android. If you don't like or wanted to enhance its properties, then you can create your own class by extending TextView class and implementing your own functionalities.
Answer: C ii & iii
Description: shared preference files by default will be stored in internal memory of app. shared preference files extension is .xml. It is in the file structure of data/data/preferences. But this will not be visible to outside applications and phone users. they can't see what is available in apps internal memory allocated to it.
Answer: C Activityname.xml
Description: By default if programmer don't give any name to shared preference, then activity name will be taken as shared preference file with .xml extension.