preloader
Android Interview Questions

Top 50 Android Interview Questions and Answers for Freshers/Exp

author image

Android is a very popular and wide part of an operating system and if you are appearing for a company interview then you need to prepare well to crack the Interview on Android. So here we present you Android Interview Questions and Answers to cope up with your upcoming interviews. These questions will help the professionals and beginners to prepare for the Interviews.

About Android: It is an operating system founded by Andy Rubin which is available in open-source is lightweight and is used in functioning smartphones etc. It is an operating system based on Linux which permits developers to run apps that can perform basic and advanced functionalities.

Android Interview Questions

1. What is Android?

2. Define an activity?

3. Explain service in Android?

4. What is the difference between Activities from Services?

5. Explain Google Android SDK?

6. Tell the use of Bundle in Android?

7. What is an Adapter in Android?

8. What is AAPT?

9. Explain portable Wi-Fi hotspots?

10. Explain Android Debug Bridge (ADB)?

11. Explain DDMS features?

12. Explain AIDL and the data types supported by it?

13. Explain the complete life cycle of Android activity?

14. What do you understand by Sensors in Android?

15. Explain the AndroidManifest.xml file and its need?

16. Explain intent?

17. Differentiate class, file, and activity in Android?

18. Explain Toast with syntax.

19. Explain context?

20. Differentiate Implicit and Explicit Intent.

21. What is ANR in Android?

22. Tell the troubleshooting techniques you use if the application is crashing frequently?

23. What do you understand by broadcast receivers and how is it implemented?

24. Name the founder of the Android operating system?

25. Describe Android Application Architecture?

26. Tell some advantages of Android?

27. Does android support programming languages other than java?

28. Name the core building blocks of android?

29. How to identify view elements in the android program?

30. Name some impotent folders in android

31. Tell us the use of LINUX ID in android?

32. Name the different storage provided by Android.

33. What is the command to call another activity in android?

34. Which database is used in android?

35. Explain NDK?

36. Explain APK format?

37. What is the nine-patch images tool in Android?

38. Which kernel is used in Android?

39. What flags are used to run an application on Android?

40. Name any 4 dialogs boxesan a run the arethe supported by Android?

41. What are some exceptions in Android?

42. Name the basic tools used to develop an Android app?

43. Name all versions of Android.

44. What are the disadvantages of Android?

45. What are Google Android SDK tools used in it.

46. What is the role of Dalvik in Android development?

47. Explain a database in Android? How it is different from client-server database management systems?

48. Explain content provider? How it is implemented?

49. What is the role of the .dex file?


Learn More Interview Questions Here:


Android Interview Questions and Answers

1. What is Android?

It is an open-sourced operating system used in operating mobile devices like smartphones and tablets. The Android application performs within its process and instance of Dalvik Virtual Machine (DVM) or Android Run Time (ART).

2. Define an activity?

In java, activity is a single screen that shows GUI (Graphical User Interface) which allows users to do something like dialing phone, email, etc.

3. Explain service in Android?

It is an application component that allows the applications to run in the background so it performs long-running operations without the user need or interaction. A service can run the application continuously in the background even when the user switches to another application or close the application.

4. What is the difference between Activities from Services?

Activities can be closed anytime whenever the user wishes. Whereas, services can run in the background and complete the task & work independently.

5. Explain Google Android SDK?

Google Android Software Development Kit (SDK) is a toolset which developers use to write applications on Android-enabled devices.

6. Tell the use of Bundle in Android?

Bundles are required to transmit the data between different Android activities. These work as a HashMap that takes trivial data. The below-given code tells you how to transfer the data by using bundle:

Bundle b=new Bundle();

b.putString(“Email”,“abc@xyz.com”);

i.putExtras(b); // where i is intent

7. What is an Adapter in Android?

It works as a bridge between AdapterView and the data for that view. It holds the data and then transmits it to the adapter view, now the view displays the data on different looks such as spinner, list view, grid view, etc.

8. What is AAPT?

AAPT means Android Asset Packaging Tool. This build tool allows the developers to view, create, and work with ZIP-compatible archives (zip, jar, and ask). It parses, indexes, and gathers the resources in a binary format that optimizes the Android platform.

9. Explain portable Wi-Fi hotspots?

Portable Wi-Fi Hotspot allows the user to share their mobile internet connection with other wireless devices like smartphones, laptops, listens, etc. to connect to the internet using that access point.

10. Explain Android Debug Bridge (ADB)?

It is a command-line tool that permits you to control communication with an emulator instance. By using ADB developers can execute remote shell commands to make applications work on an emulator.

11. Explain DDMS features?

Dalvik Debug Monitor Server (DDMS) is debugging tool which has different debugging features:

  • Port forwarding services.
  • Thread and heap information.
  • Logcat.
  • Screen capture on the device.
  • Network traffic tracking.
  • Incoming call and SMS spoofing.
  • Location data spoofing.

12. Explain AIDL and the data types supported by it?

Android Interface Definition Language (AIDL) is a tool that manages the client and service interface requirements for interprocess communication (IPC) through which it communicates at the same level. The process comprises dividing an object into primitives which an Android operating system understands. Some Data Types which are supported by AIDL is as follows:

  • String
  • List
  • Map
  • CharSequence
  • Java data types (int, long, char, and boolean)

13. Explain the complete life cycle of Android activity?

  • OnCreate(): It is used to create an activity. It creates views and data is collected from bundles.
  • OnStart(): It makes the activity visible to the user.
  • OnResume(): When the activity starts interacting with the user.
  • OnPause(): When the activity is working in the background but not killed yet.
  • OnStop(): When an activity is no longer visible to the user.
  • OnDestroy(): When the activity is completed or destroyed.
  • OnRestart(): When the activity is started again.

14. What do you understand by Sensors in Android?

Android devices have a number of built-in sensors in them, which measure different parameters like motion, orientation, and others through their high accuracy. These sensors can be hardware and software as per their nature. The most prominent categories of sensors in Android are:

  • Position Sensor: It is used for measuring the physical position of the Android device. This has orientation sensors and magnetometers.
  • Motion Sensors: These sensors consist of gravity, rotational activity, and acceleration sensors which measure the rotation of the device or the acceleration, etc.
  • Environmental Sensor: It includes sensors that measure temperature, humidity, pressure, and other environmental factors.

15. Explain the AndroidManifest.xml file and its need?

The AndroidManifest.xml file has information related to the application which an Android system must know before the execution of codes.

  • It is an essential file for every Android application.
  • It is located in the root directory.
  • This file performs several tasks such as:
  • Provides a new name to the java package.
  • Describe different components like activity, services, etc.
  • Setting the classes that will implement these components.

16. Explain intent?

It is a messaging object that requests an action to be done from other components of an application. It is used to begin an activity, send SMS, email, show a web page, etc. It displays messages notification to the user on an Android-enabled device. It also shows the alerts to users of a particular state.

Two types of Intents are:

  • Implicit Intent- invoke the system components.
  • Explicit Intent- invoke the activity class.

17. Differentiate class, file, and activity in Android?

Class is a collected form of a .java file that is used to create an executable .apk file for Android.

A file is a bundle of information, resources which store information. It can be of any file type.

Activity is a single screen that shows GUI (Graphical User Interface) which allows users to do something like dial the phone, view email, etc.

18. Explain Toast with syntax.

It is a popup message that displays on the screen. It shows the status of the operation started by the user and only covers the space required for the message while the user activity remains active. The Toast notification fades in and out if it does not interact.

Syntax:

Toast.makeText(ProjectActivity.this, “Your message here”, Toast.LENGTH_LONG).show();

19. Explain context?

The context of the present state of the application or object in Android. It comes with services like providing access to databases, resolving resources, etc.

Two types of context are:

Activity context: It is involved in the lifecycle of an activity. It can be used when you are allowing the context in the possibility of an activity or the context whose lifecycle is attached to the activity.

Application context: It is involved in the lifecycle of an application. It is used when you need a context where the lifecycle is separated from the present context or when you are allowing a context further than the scope of activity.

20. Differentiate Implicit and Explicit Intent.

Explicit Intent: It is where you notify the system that which activity needs to handle this intent. In this, the targeted component is mentioned directly in the intent.

For example,

Intent i = new Intent(this, Activitytwo.class); #ActivityTwo is the target component

i.putExtra(“Value1”,“This is ActivityTwo”);

i.putExtra(“Value2”,“This Value two for ActivityTwo”);

startactivity(i);

Implicit Intent: It allows you to announce the action you want to run. The Android system checks the components which are going to handle that particular action based on intent data. Here target component is not mentioned in the intent.

For example,

Intent i = new Intent(ACTION_VIEW,Uri.parse(“http://www.interview bit.com”));

startActivity(i);

Follow Simple Steps to apply in these MNC’s:

21. What is ANR in Android?

Application is Not Responding (ANR) is a pop-up box that comes when the application is not working or responding properly. This ANR dialogue is shown when the main thread of an application has become unresponsive for a long time:

  • Even after 5 seconds, there is no response to an input event.
  • When a broadcast receiver has not performed or finished its execution within 10 seconds.

22. Tell the troubleshooting techniques you use if the application is crashing frequently?

Compatibility Check: There might be chances that an application is not compatible with the Android operating system.

Memory Management:

  • Some apps work fine on one device but might not work on other devices of the same operating system. It is due to the lacking of processing power, memory management, and CPU speed.
  • Because of limited memory space on mobile devices, in that case, listens you need to free up memory space so the application runs properly.
  • If an application is repeatedly crashing, then you need to delete the application’s data, by clearing its cache memory and making some free space on your device to boost the app’s performance.

23. What do you understand by broadcast receivers and how is it implemented?

It is a mechanism that listens to system-level events like incoming calls, SMS, etc. by the host application. It is implemented as a subclass of BroadcastReceiver class and each message is broadcasted as an intent object.

public class MyReceiver extends BroadcastReceiver

{

public void onReceive(context,intent){}

}

24. Name the founder of the Android operating system?

Andy Rubin is the founder of the Android operating system

25. Describe Android Application Architecture?

  • Services: It is used to run background functionalities.
  • Intent: It is used to run interconnection between activities and the data passing tool.
  • Resource Externalization: strings and graphics.
  • Notification: It shows the activities like light, sound, icon, dialog box, and toast.
  • Content Providers: It is used to share data between applications.

26. Tell some advantages of Android?

  • Open-source: You do not require a license, development fee, distribution, etc. to use it.
  • Platform-independent: It supports various platforms like Windows, Mac, and Linux.
  • Supports various technologies: It uses advanced technology like camera, Bluetooth, wifi, speech, EDGE, etc.
  • Highly optimized Virtual Mechanism: It uses a highly optimized virtual Mechanism for supporting devices which are called DVM (Dalvik Virtual Machine).

27. Does android support programming languages other than java?

Yes, an android application can be made by using C/C++ Android NDK (Native Development Kit). It makes the android application perform faster. Android SDK can also be used.

28. Name the core building blocks of android?

Some core building blocks of Android are:

  • Activity
  • View
  • Intent
  • Service
  • Content Provider
  • Fragment etc.

29. How to identify view elements in the android program?

Use the keyword findViewById to identify view elements in the android program.

30. Name some impotent folders in android

Some impotent folders in android are:

  • AndroidManifest.xml
  • build.xml
  • bin/
  • src/
  • res/
  • assets/

31. Tell us the use of LINUX ID in android?

A unique Linux ID is given to each application in android which helps in tracking a process.

32. Name the different storage provided by Android.

The storages provided by android are:

  • Shared Preferences
  • Internal Storage
  • External Storage
  • SQLite Databases
  • Network Connection

33. What is the command to call another activity in android?

Intent i = new Intent(getApplicationContext(), ActivityTwo.class);

startActivity(i);

34. Which database is used in android?

SQLite is a database used in android because it is open-source, lightweight and other advanced features help in developing mobile devices.

35. Explain NDK?

NDK means Native Development Kit. By using NDK, you can develop a part of an app using a native language such as C/C++ to boost performance.

36. Explain APK format?

APK means Android Packaging Key. It is a compressed key with classes, UI’s, supportive assets, and manifest. All files are combined and compressed to a single file is called APK.

37. What is the nine-patch images tool in Android?

By using this tool we can change bitmap images into nine different sections with contains four corners, four edges, and an axis.

38. Which kernel is used in Android?

Android uses a customized Linux 3.6 kernel.

39. What flags are used to run an application on Android?

40. Name any 4 dialogs boxesan a run the arethe supported by Android?

  • Alert Dialog
  • Progress Dialog
  • Date Picker Dialog
  • Time picker Dialog

41. What are some exceptions in Android?

  • Surface.OutOfResourceException
  • Inflate Exception
  • WindowManager.BadTokenException
  • SurfaceHolder.BadSurfaceTypeException

42. Name the basic tools used to develop an Android app?

  • SDK Tools
  • JDK
  • Eclipse+ADT plugin

43. Name all versions of Android.

Android 11.0 is the latest version released in September 2020. Most of the Android version has been named after either sweet or desserts.

| — | — | — | — | | Version | Android Name | API Level | Year of Release | | Android 1.0 | No Codename | 1 | 2008 | | 1.1 | No Codename | 2 | 2009 | | 1.5 | Cupcake | 3 | 2009 | | 1.6 | Donut | 4 | 2009 | | 2.0 - 2.1 | Éclair | 5 - 7 | 2009 | | 2.2 – 2.2.3 | Froyo | 8 | 2010 | | 2.3 – 2.3.7 | Gingerbread | 9 - 10 | 2010 | | 3.0 – 3.2.6 | Honeycomb | 11 - 13 | 2011 | | 4.0 – 4.0.4 | Ice Cream Sandwich | 14 - 15 | 2011 | | 4.1 – 4.3.1 | Jelly Bean | 16 – 18 | 2012 | | 4.4 – 4.4.4 | Kitkat | 19 – 20 | 2013 | | 5.0 – 5.1.1 | Lollipop | 21 – 22 | 2014 | | 6.0 – 6.0.1 | Marshmallow | 23 | 2015 | | 7.0 – 7.1.2 | Nougat | 24 – 25 | 2016 | | 8.0 – 8.1 | Oreo | 26 – 27 | 2017 | | 9.0 | Pie | 28 | 2018 | | 10.0 | Android 10 | 29 | 2019 | | 11.0 | Android 11 | 30 | 2020 |

44. What are the disadvantages of Android?

  • Thousands of Fake applications try to steal your data
  • An application that works properly on one Android OS might crash on another Android.
  • If the application runs in the background, they use a mobile battery and drain it quickly.
  • The processes and applications which run in the background use excess data that result in low internet speed which can be annoying sometimes.

45. What are Google Android SDK tools used in it.

  • Android Emulator: It simulates Android devices on your computer which allows you to test the application on different devices and Android API levels without having that device.
  • DDMS (Dalvik Debug Monitoring Services): It is a debugging tool used to provide services like message formation, capturing screenshots, etc.
  • ADB (Android Debug Bridge): This command-line tool allows controlling communication with the android emulator instance.
  • AAPT (Android Asset Packaging Tool): This build tool allows the developers to view, create, and work with ZIP-compatible archives (zip, jar, and apk).

46. What is the role of Dalvik in Android development?

Dalvik work as a virtual machine that helps in running every Android application. Dalvik provides the ability to execute multiple instances of virtual machines efficiently in a device through better memory management.

47. Explain a database in Android? How it is different from client-server database management systems?

SQLite is an open-source database used in Android. The SQLite database is serverless, transactional, and also self-contained. The SQLite engine is linked with the application than client-server database management systems. The library is dynamic and uses simple function calls that reduce latency in database access.

48. Explain content provider? How it is implemented?

It is one of the main building blocks of Android applications, which copes access to a central repository. It works as an interface that connects data and code from one process to another process.

They are responsible for encapsulating the data and providing mechanisms for defining data security. It is implemented as a subclass of ContentProviderclass and must implement a set of APIs that will enable other applications to perform transactions.

public class MyContentprovider extends ContentProvider

{

public void onCreate(){}

}

49. What is the role of the .dex file?

The programs are piled up into a .dex file by DVM, which are further zipped into a .apk file on the device. These files are made by translating collected applications written in java language. .dex is a format that is optimized for effective storage and memory-mappable executions.

Want to prepare for these languages:

Recent Articles