Android Interview Questions and Answers
Question - 31 : - What is the proper way of setting up an Android-powered device for app development?
Answer - 31 : -
The following are steps to be followed prior to actual application development in an Android-powered device:
- -Declare your application as “debuggable” in your Android Manifest.
- -Turn on “USB Debugging” on your device.
- -Set up your system to detect your device.
Question - 32 : - Enumerate the steps in creating a bounded service through AIDL.
Answer - 32 : -
1. create the .aidl file, which defines the programming interface
2. implement the interface, which involves extending the inner abstract Stub class as well as implanting its methods.
3. expose the interface, which involves implementing the service to the clients.
Question - 33 : - What is the importance of Default Resources?
Answer - 33 : -
When default resources, which contain default strings and files, are not present, an error will occur and the app will not run. Resources are placed in specially named subdirectories under the project res/ directory.
Question - 34 : - When dealing with multiple resources, which one takes precedence?
Answer - 34 : -
Assuming that all of these multiple resources are able to match the configuration of a device, the ‘locale’ qualifier almost always takes the highest precedence over the others.
Question - 35 : - When does ANR occur?
Answer - 35 : -
The ANR dialog is displayed to the user based on two possible conditions. One is when there is no response to an input event within 5 seconds, and the other is when a broadcast receiver is not done executing within 10 seconds.
Question - 36 : - What is AIDL?
Answer - 36 : -
AIDL, or Android Interface Definition Language, handles the interface requirements between a client and a service so both can communicate at the same level through interprocess communication or IPC. This process involves breaking down objects into primitives that Android can understand. This part is required simply because a process cannot access the memory of the other process.
Question - 37 : - What data types are supported by AIDL?
Answer - 37 : -
AIDL has support for the following data types:
- -string
- -charSequence
- -List
- -Map
- -all native Java data types like int,long, char and Boolean
Question - 38 : - What is a Fragment?
Answer - 38 : -
A fragment is a part or portion of an activity. It is modular in a sense that you can move around or combine with other fragments in a single activity. Fragments are also reusable.
Question - 39 : - What is a visible activity?
Answer - 39 : -
A visible activity is one that sits behind a foreground dialog. It is actually visible to the user, but not necessarily being in the foreground itself.
Question - 40 : - When is the best time to kill a foreground activity?
Answer - 40 : -
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.