Top Android interview questions for beginners

Nicholas Lamar
5 min readAug 8, 2019

--

Let us have a look at some important Android interview questions for beginners.

Android is the world’s most popular mobile platform. Initially developed by Android Inc., which Google bought in 2005, Android was unveiled in 2007. Moreover, the first commercial Android device was launched in September 2008. The core Android source code is known as Android Source Open Project (AOSP), which is primarily licensed under the Apache License.

In this article, will discuss some important Android interview questions for 2019.

But before that, let us have a look at some of the recent Android development trends. Also, we will see the importance of Android developers.

Android development trends

  • Improved app quality and discovery on Google Play.
  • Ability to capture audio from different apps in Android Q.
  • Internet of Things (IoT): Top features include safety, energy, connectivity, and sensing.
  • Android Jetpack: It is a set of tools, components, and guidance to build the best Android apps capable of running faster.
  • Android instant apps.
  • The Kotlin era.
  • Mobile wallets and payment gateways.
  • Beacons technology.
  • Motion and location sensing.

Importance of Android developers

As Android is the most popular operating system, it does have a few bugs. Someone should be able to fix bugs to ensure smooth user experience.

To achieve this, good Android developers are necessary. This is a field that may flourish in the future. And to hire good developers, asking the appropriate Android interview questions is important.

Q1. What are the seven lifecycle methods of Android activity and what is their purpose?

The seven lifecycle methods of Android activity are:

  • onCreate()
  • onStart()
  • onRestart()
  • onResume()
  • onPause()
  • onStop()
  • onDestroy()

Their purpose is to help structure your code around how you want an activity to perform throughout its lifecycle on the device.

For example, onCreate() is where you would perform your static setup, from creating views to binding data lists. It is always immediately followed by onStart(), where the app will be made visible to the users.

Q2. Briefly list the components of the Android architecture.

This is another top-level question to help you gauge how well the developer understands the big picture of application design. The Android software stack is typically divided into five main components:

  1. Linux kernel: The base layer of an application that directly interfaces with the device hardware — this is the level that deals with hardware drivers like the camera, keypad, and display.
  2. Native libraries: Resting on top of the Linux kernel is a set of open-source libraries, including the SQLite database, libc, and the WebKit browser engine.
  3. Android runtime: The Dalvik Virtual Machine is on the same level as the native libraries and allows every Android app to run its processes.
  4. Application framework: The next layer up provides higher-level services in the form of Java classes to applications on the device. The key services to know are the Activity Manager, Content Provider, Resource Manager, Notifications Manager, and the View System.
  5. Applications: The top layer is the Android app itself. This is the level where you can install applications, and the one developers are most familiar with.

Q3. What is DDMS?

DDMS is short for Dalvik Debug Monitor Server. It ships natively with Android and contains many useful debugging features including location data spoofing, port-forwarding, network traffic trafficking, incoming call/SMS spoofing, thread and heap information, screen capture, and the ability to simulate network speed, state, and latency.

Q4. How would you check for the presence of a Compass sensor on the system using the hasSystemFeature() method?

While it may be tempting to call this method on SensorManager or Sensor, as they both come as part of the Android Sensor Framework, neither of those classes provide the hasSystemFeature() method. These classes find a use for direct access and acquisition of raw sensor data. When it comes to evaluating a system’s capabilities, you can use the PackageManager class to retrieve information on application packages available on a given device. I have written a possible solution for this query:

PackageManager myCompass = getPackageManager();
If(!myCompass.hasSystemFeature(PackageManager.FEATURE_SENSOR_COMPASS))
{
//This device lacks a compass, disable the compass feature.
}

Q5. What is ADB?

This is one of the important Android interview questions.

ADB simply stands for Android Debug Bridge. It presents developers with the power to perform remote shell commands. Its major work is to permit and direct communication towards and from the emulator port.

Q6. Describe activities.

Activities are what you refer to as the window to a user interface. Just as you create windows to display output or to ask for an input in the form of dialog boxes, activities play the same role. Though it may not always be in the form of a user interface.

Q7. What is the importance of XML-based layouts?

The use of an XML-based layout provides a consistent and somewhat standard means of setting the GUI definition format. In common practice, layout details are placed in XML files while other items are placed in source files.

Q8. 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 on 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 specs and features.

Q9. What’s the difference between a file, a class, and an activity in Android?

File: It is a chunk of arbitrary information or resource for storing information.

Class: It is a compiled form of Java file. Android uses the .class files to produce an executable apk.

Activity: An activity is comparable to a Frame/Window in GUI toolkits. It is not a file or a file type. It is just a class that you can extend in Android for loading UI elements on view.

Q10. What is the Dalvik Virtual Machine?

Dalvik is the name of Android’s virtual machine. The Dalvik VM is an interpreter-only virtual machine that executes files in the Dalvik Executable (.dex) format, a format for effective storage and memory-mappable executions.

The virtual machine is register-based and can run classes compiled by Java language compiler that have been altered into its native format using the included ‘dx’ tool. The VM runs on top of Posix-compliant operating systems depending on it for performing threading and low-level memory management functionalities. The Dalvik core class library provides a familiar development base for those used to programming with Java Standard Edition. But is geared explicitly for the needs of a small mobile device.

Read the full article here.

--

--

Nicholas Lamar

I am a highly skilled software engineer with over twenty years of experience. I am good at Python, Objective-C, and Swift. Also, a PhD. graduate in computers.