Skip to main content

Android Interview Questions(CH#2)

Android Interview Questions(CH#2)

Let’s bring it on the second chapter of our Android Interview Questions series where we discover the most asked questions in an Android Interview anywhere in the world.

1) What is the importance of XML-based layouts?
The use of XML-based layouts provides a consistent and somewhat standard means of setting GUI definition format. In common practice, layout details are placed in XML files while other items are placed in source files.
2) What are containers?
Containers, as the name itself implies, holds objects and widgets together, depending on which specific items are needed and in what particular arrangement that is wanted. Containers may hold labels, fields, buttons, or even child containers, as examples.
3) What is the importance of Android in the mobile market?
Developers can write and register apps that will specifically run under the Android environment. This means that every mobile device that is Android enabled will be able to support and run these apps. With the growing popularity of Android mobile devices, developers can take advantage of this trend by creating and uploading their apps on the Android Market for distribution to anyone who wants to download it.
4) What do you think are some disadvantages of Android?
Given that Android is an open-source platform, and the fact that different Android operating systems have been released on different mobile devices, there’s no clear cut policy to how applications can adapt with various OS versions and upgrades. One app that runs on this particular version of Android OS may or may not run on another version. Another disadvantage is that since mobile devices such as phones and tabs come in different sizes and forms, it poses a challenge for developers to create apps that can adjust correctly to the right screen size and other varying features and specs.
5) What are the four essential states of an activity?
– Active — if the activity is at the foreground
– Paused — if the activity is at the background and still visible
– Stopped — if the activity is not visible and therefore is hidden or obscured by another activity
– Destroyed — when the activity process is killed or completed terminated
6) What is ANR?
ANR is short for Application Not Responding. This is actually a dialog that appears to the user whenever an application have been unresponsive for a long period of time.
7) What is the importance of settings permissions in app development?
Permissions allow certain restrictions to be imposed primarily to protect data and code. Without these, codes could be compromised, resulting to defects in functionality.
8) What is the function of an intent filter?
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.
9) How can the ANR be prevented?
One technique that prevents the Android system from concluding a code that has been responsive for a long period of time is to create a child thread. Within the child thread, most of the actual workings of the codes can be placed, so that the main thread runs with minimal periods of unresponsive times.
10) What role does Dalvik play in Android development?
Dalvik serves as a virtual machine, and it is where every Android application runs. Through Dalvik, a device is able to execute multiple virtual machines efficiently through better memory management.
11) Enumerate the steps in creating a bounded service through AIDL.
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.
12) What is the importance of Default Resources?
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.
13) When is the best time to kill a foreground activity?
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.
14) Is it possible to use or add a fragment without using a user interface?
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.
15) What is portable wi-fi hotspot?
Portable Wi-Fi Hotspot allows you to share your mobile internet connection to other wireless device. For example, using your Android-powered phone as a Wi-Fi Hotspot, you can use your laptop to connect to the Internet using that access point.
16) What is an action?
In Android development, an action is what the intent sender wants to do or expected to get as a response. Most application functionality is based on the intended action.
17) What is a Sticky Intent?
sendStickyBroadcast() performs a sendBroadcast(Intent) known as sticky, i.e. the Intent you are sending stays around after the broadcast is complete, so that others can quickly retrieve that data through the return value of registerReceiver(BroadcastReceiver, IntentFilter). In all other ways, this behaves the same as sendBroadcast(Intent). One example of a sticky broadcast sent via the operating system is ACTION_BATTERY_CHANGED. When you call registerReceiver() for that action — even with a null BroadcastReceiver — you get the Intent that was last broadcast for that action. Hence, you can use this to find the state of the battery without necessarily registering for all future state changes in the battery.
18) What is the difference between a regular .png and a nine-patch image?
This is one of the most popular Android Interview questions, asked in several interview ranging from 1 to 2 years of experience to 5 years. The answer is, It is a resizable bitmap resource that can be used for backgrounds or other images on the device. The NinePatch class permits drawing a bitmap in nine sections. The nine patch images has extension as.9.png. It allows extension in 9 ways e.g. 4 corners that are unscaled, 4 edges that are scaled in 1 axis, and the middle one that can be scaled into both axes.
19) What is Setting Breakpoints ?
Breakpoints are a mechanism by which you can tell Android Studio to temporarily pause execution of your code.
20) What is dp, sp, pt, and px?
dp — Density :-independent pixel. 1 dp is equivalent to one pixel on a 160 dpi screen. This is the recommended unit of measurement when you’re specifying the dimension of views in your layout.
sp — Scale:- independent pixel. This is similar to dp and is recommended for specifying font sizes.
pt — Point:- A point is defined to be 1/72 of an inch, based on the physical screen size.
px — Pixel:- Corresponds to actual pixels on the screen. Using this unit is not recommended, as your UI might not render correctly on devices with a different screen resolution.

Please Like, Share and Recommend this blog and piece of content with your Android Buddies.

Note: Stay Tuned for CH#3 of this series for more questions like this.

Kudossss To Every Android Buddy…

Comments

Popular posts from this blog

Let’s keep it short….again

Let’s keep it short….again The world is full of people who are full of Fear of Failure which doesn’t allow them to move steadily and think positively. But many of them don’t know that Fear is a Big Liar. Because Fear shows you fake reality about your own self that — ”You can’t do this thing”. Instead people should fake their fear by repeatedly saying this — ”At least I can try!!!” Because there is no sense at all to not do the particular thing just because you have never done it earlier. Try Again…Fail Again…Fail Better!!!😎 Kudossss To Fearless You…

Grateful 24/7/365

Grateful 24/7/365 The super basic problem with most of us is that we are not  grateful  for the life we all are living in currently. And the super duper solution for all of our this problem is to be  grateful enough for the life that we all got. Now to do that we can follow this simple phenomenon called -  Attitude of Gratitude. Many of us don’t even know How to be Grateful? So the best answer for this is: Becoming grateful and thankful for the smallest of things in your life is the best way to achieve the  Attitude of Gratitude. What to do with so much of Attitude of Gratitude? Many people even ask this silly but interesting question - that what we will get in return or what is the outcome of showing so much  gratefulness . So the best and interesting answer for this is: Keep yourself busy and focussed on your  attitude of gratitude , which will eventually make way for disappointments ...

That Winning Moment!!!

That Winning Moment!!! You are just a thought away from the fact that the penultimate thing we all want in our career is that winning moment and the motivation to carry that winning momentum all through outside and inside our career span. Let’s take a sneak peek of what can be some of the greatest winning moments. * That Bird who assembles the Nest: Have you ever thought about that little bird who is continuously collecting those tiny little wooden sticks to assemble or make home for her young ones to keep there and feed there. How great that  moment  will be for that bird, when she place that final wood stick on her assembled nest to finish that small yet hardworking activity. The bird can die for that type of winning moment!!! * That college boy who got placed in an interview: Everyone of you have definitely been through that phase of your graduation or school-life where you got selected for sitting in ...