- Notification messages to the user from an Android enabled device can be displayed using Intents - There are two types of Intents - Explicit Intent, Implicit Intent Implicit Intent: - In case of Implicit Intent, an intent is just declared - It is for the platform to find an activity that can respond to it - Since the target component is not declared, it is used for activating components of other applications Explicit Intent - Explicit intent specifies the particular activity that should respond to the intent - They are used for application internal messages
Correct Answer: A call to onStop method happens when an activity is no longer visible to the user, either because another activity has taken over or if in front of that activity
2. Is it possible to use or add a fragment without using a user interface?
Correct Answer: Yes, it is possible to do that, such as when you want to create a background behavior for a particular activity You can do this by using add(Fragment,string) method to add a fragment from the activity
3. When is the best time to kill a foreground activity?
Correct Answer: The foreground activity, being the most important among the other states, is only killed or terminated as a last resort, especially if it is already consuming too much memory When a memory paging state has been reach by a foreground activity, then it is killed so that the user interface can retain its responsiveness to the user
4. What is the difference between a regular bitmap and a nine-patch image?
Correct Answer: In general, a 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
Correct Answer: Because every component needs to indicate which intents they can respond to, intent filters are used to filter out intents that these components are willing to receive One or more intent filters are possible, depending on the services and activities that is going to make use of it
6. What is AIDL?What data types are supported by AIDL?
Correct Answer: - AIDL is the abbreviation for Android Interface Definition Language - It handles the interface requirements between a client and a service to communicate at the same level through interprocess communication - The process involves breaking down objects into primitives that are Android understandable AIDL supports following data types: - String - List - Map - CharSequence - All native Java data types like int,long, char and Boolean
Correct Answer: Android Application Architecture has the following components: > Services - like Network Operation > Intent - To perform inter-communication between activities or services > Resource Externalization - such as strings and graphics > Notification signaling users - light, sound, icon, notification, dialog etc > Content Providers - They share data between applications
8. How to select more than one option from list in android xml file? Give an example.
Correct Answer: Android uses Dalvik Virtual Machine (DVM) which requires a special bytecode We need to convert Java class files into Dalvik Executable files using an Android tool called "dx" In normal circumstances, developers will not be using this tool directly and build tools will care for the generation of DVM compatible files
10. How does an application run in isolation from other applications?
Correct Answer: Each application gets its own Linux user ID and virtual machine which means that the application code runs in isolation from other applications