Android-training

Android Interview Questions and Answers in 2022

Author Image Icon

Niral Modi

Last Updated: 17 Nov 2023


Android programming is a software development process that creates mobile applications for smartphones and tablet computers. Developed by Google, Android is an open-source operating system. It has become the most popular mobile operating system in the world, with over 80% of the market share. It is also used on Chromebooks and other devices.

Android programming is divided into two categories:

1) Native Android Programming - which uses Java as its primary programming language 

2) Hybrid Android Programming - which uses both Java and C/C++ as its primary languages.

There are different types of programming in Android. Some of them are platform-specific and some are general programming languages. Below are some of the benefits of Android programming:

  • It is open source and has a large market share in the app development industry.
  • It has an active community of developers who can help you with any problem you might come across.
  • It has an active community of developers who can help you with any problem you might come across.

An Android programmer needs to be able to write Java, C++ and Kotlin code. They also need to be familiar with the basics of object-oriented programming, functional programming and data structures.  A lot of final year students and graduates looking for placements in Android Application development are curious to know about android interview questions what employers ask in interviews.

At times subject matter technical Interviews are not just restricted to the subject but employers also check the candidate's fundamental knowledge, ability to think logically as well as practical ( hands-on ability to the code given a time limit).The Interview rounds are also followed by HR questions checks the candidate's interest to join the organization, grow with the organization, team spirit, and ability to mold and take up different challenges.

Following are the rounds that take place in a given organization:

  • Aptitude ( check logical reasoning)
    • Not all companies have this level of an interview process
  • Fundamentals
    • Covers OOPS, SQL query as well as fundamental
    • All companies usually have this round as the first initial level of screening
  • Subject Matter ( technical and Practical Subjects related to Android Application Development)
  • Advanced Subject Matter Questions
    • This round basically decides the salary at which a company is ready to hire the candidate. Most of the candidates that have undergone professional training outside of colleges can clear the Fundamentals and Subject matter rounds. The Advance rounds help differentiate the knowledge and exposure based on the projects students have undertaken
  • HR rounds

TOPS Technologies trains a lot of students in Android Course and have placed them in different IT companies with salaries ranging from 1.5 L CTC to 3.5 L CTC. TOPS Technologies have compiled interview questions on android based on the feedbacks given by different companies and our students on the questions they faced. The questions contain the above categories with answers to make sure candidates can thoroughly prepare the same.

List Of Android Question And  Answer

1. What is Android?

Ans: Android is a Linux based Open source Mobile operating system used in Smartphones, Tablets, TV, Automobiles, and Watch etc.

2. What is view Android application?

Ans: View is a base class of widgets, Rectangular area of the screen. The view is responsible for drawing and event handling.

3. List of out each method of Activity lifecycle in android?

Ans : In Android application have the below stage of life cycle method -

OnCreate()

OnStart()

OnResume()

OnPause()

OnRestart()

OnStop()

OnDestroy()

4. List out the Fragment lifecycle in Android?

Ans: Following methods will generate different stages of fragment lifecycle.

OnAttach()

OnCreate()

OnCreateView()

OnCreateView()

OnViewCreated()

OnStart()

OnResume()

OnPause()

OnStop()

OnDestroyView()

OnDestroy()

OnDetach()

5. What is Difference between linear and relative layout in Android?

Ans: Linear Layout – it will show sub-layouts in a Linear form (Vertical and Horizontal).

Relative Layout: This layout will set its components by relating to each other and also by giving dependency.

6. How to set two layouts which equal width and height on View in Android?

Ans: With the use of Linear Layout we have weight attribute to set equal height and width.

7. How many Components in Android which are using to build an Application?

Ans: When we create android application below components will be used -

View

Activity

Service

Broadcast Receiver

Content Provider

8. What is Service in Android?

Ans: Service is a background task of any application which runs in the background.

A downloading task, MusicPlayer Task.

9. What is intent in Android Application?

Ans: Intent is an object which defines to execute any action intentionally.

Two types of intent in android.

(i) Explicit Intent: this intent define when we want to call another activity from current activity in the same application.

(ii) Implicit Intent.

10. Which class is using to complete a long task in the background?

Ans: We can use below class and method to complete long background task -

AsyncTask with the help of its three methods,

onPreExecutes

onPostExecutes

doInBackground

11. Where we can store offline data in Android Application?

Ans: Data will be stored in the local database using SQLite.

12. What is Gradle in Android?

Ans: Gradle is a script in which we define third-party library dependencies, classpaths and it will compile all files without project.

13. If you have to use services of any online shopping website so you have to configure in every activity or to create any class file?

Ans: We can define service handler class to establish HTTP Url connection, then in each activity where we want to show data from the database we just change the URL of our web service API.

14. What is view pager in Android Application?

Ans: The View Pager is providing swiping gesture in android, ex. Tab Layout.

15. Difference between Picasso and glide Library in Android?

Ans: Picasso library can only load an image, where glide can also load gif format.

16. What is GSON in Android?

Ans: GSON is converter library, which converts JSON array and objects when we work with a retrofit.

17. What is JsonParsing?

Ans: JSON stands for Javascript object notation, a format for data exchange from the server. In Android, when we work with the online database, we need to convert table data into JSON data, and to manipulate those data Android provides a different way for JSON Parsing.

HTTP Url connection, Retrofit, Volly etc.

18. Difference between activity and fragment in Android?

Ans Activity is a direct user interaction screen in which all components and events are generated.

Every application has at least one Activity.

A fragment is part of an activity, which inflated on the activity’s layout. We can use multiple fragments inside a single activity.

Fragments are faster in a transaction than activity.

19. Can we use more than one fragments in a single activity?

Ans: Yes.

20. How many data can we get from Facebook API?

Ans: Using graph library and Profile class, we can get all the information of a user.

ex Name, first name, last name, profile image, middle name

21. Which 3rd party library you have used in Android?

Ans: Retrofit, Picasso, Glide, volly.

22. Why use Retrofit in Android?

Ans: Retrofit will return appropriate response very faster than HTTP, Volly.

23. In Hangout application, if data is more than 5000 at that time which adapter view is the best for memory management?

Ans: Recycler View

24. Write code for fetching JSON array in Android?

Ans: JSONArray array = new JSONArray(result);

for(int i=0;i

{

JSONObject object = array.getJSONObject(i);

}

25. How to Implement Clear Top Activity in Android?

Ans:

Intent a = new Intent(this,A.class);

a.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

startActivity(a);

26. Write code to implement for SMS Send Using SMS Manager?

Ans:

Intent intent=new Intent(getApplicationContext(),MainActivity.class);

PendingIntent pi=PendingIntent.getActivity(getApplicationContext(),0,intent,0);

SmsManager sms=SmsManager.getDefault();

sms.sendTextMessage("9898098980", null, "Android Code",pi,null);

27. Which two methods will be Override from SQliteOpenHelper?

Ans:

OnCreate()

OnUpgrade()

28.What are the major components of an Android device?

The components of an Android device include the CPU, the GPU, the RAM, and more. The CPU is a microprocessor that handles most of the tasks on a smartphone or tablet. The GPU is a graphics processing unit that is responsible for rendering graphics and animating objects in a 3D environment. The RAM stores data temporarily as it is being used by apps or programs.

29.Describe the Dalvik Virtual Machine.

Android's virtual machine goes by the name Dalvik. A virtual machine that only supports interpreters, the Dalvik VM processes files in the memory-mappable Dalvik Executable (.dex) format. This format is designed for efficient storage. The bundled "dx" tool can be used to convert classes that were created using the Java language compiler into the native format of the virtual machine, which is register-based. The VM operates on top of operating systems that adhere to Posix specifications and relies on it to carry out threading and low level memory management features. The Dalvik core class library is designed to offer a comfortable programming environment for individuals accustomed to using Java Standard Edition, but it is specifically tailored for the requirements of a small mobile device.

30.How do Toast Notifications work?

A window-based message known as a toast notification appears. The user's previous activity is still visible and interactive even though it only covers the area needed for the message. The notice does not take interaction events and fades in and out automatically.

Please share this with all candidates going through an interview process to help them.

For details, you can visit our site:

Android Training Course

Or call us on 7622011173



Stay Connected