Android interview question set 2/Android Interview Questions and Answers for Freshers & Experienced

What does APK stand for?

APK stands for Android Packaging Kit. The Android packaging key is compressed with classes, UI’s, supportive assets and manifest. All these files are compressed to a single file which is called APK.

What is the difference between a regular bitmap and a nine-patch image?

A nine-patch image, unlike bitmap, can be resized and used as background or other image sizes for the target device. The Nine-patch refers to the way you can resize the image: 4 corners that are unscaled, 4 edges that are scaled in 1 axis, and the middle one that can be scaled into both axes. This is what differentiates a nine-patch image from a regular bitmap.

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.

What is Sleep Mode in Android?

In the sleep mode, the CPU is transitioned into a deactivated mode and does not accept any commands from the Android device. Only the Radio interface layer and alarm remains active in sleep mode.

Name the four essential states of an activity.

The four essential states of activity are:

1. Active – if the activity is at the foreground
2. Paused – if the activity is at the background and still visible
3. Stopped – if the activity is not visible and therefore is hidden or obscured by another activity
4. Destroyed – when the activity process is killed or completed terminated

What is an Android Runtime?

Android Runtime consists of Dalvik Virtual machine and Core Java libraries.
DVM is optimized for low processing power and low memory environments.
Unlike JVM, the Dalvik Virtual Machine doesn’t run .class files, instead it runs .dex files.
Android 2.2 “Froyo“ brought trace-based just-in-time (JIT) compilation into Dalvik, optimizing the execution of applications and dynamically compiling frequently executed short segments of their bytecode into native machine code.

What are some of the disadvantages of Android?

Android being an open-source platform, and considering 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. An app that runs on one version of Android OS may or may not run on another version.

Another disadvantage is that it can be challenging for developers to create apps that can adjust correctly to the right screen size and other varying features and specs of various Android devices.

What database is used in Android? How does it differ from client-server database management systems?

SQLite is the open-source relational database. The SQLite engine is serverless, transactional, and self-contained.
Instead of the typical client-server relationship of most database management systems, the SQLite engine is integrally linked with the application. The library can also be called dynamically and makes use of simple function calls that reduce latency in database access.

Can you change the name of an application after its deployment?

It is not recommended to change the application after its deployment. This may break some functionality.

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.

What is a Fragment?

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.

When does ANR occur?

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.

When dealing with multiple resources, which one takes precedence?

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.

What is ActivityCreator?

ActivityCreator is a batch file and shell script which was used to create a new Android project. It is now replaced by the “Create New Project” in Android SDK.

What is ANR in Android?

ANR stands for Application Not Responding. It is a notification or pop-up displayed by the Android platform whenever the application is performing too many functions at a time and if it is suddenly not responding for a long time to the user action.

What is a Sticky Intent?

A Sticky Intent is a broadcast from sendStickyBroadcast() method which floats around even after the broadcast, allowing others to collect data from it.

What is the AndroidManifest.xml?

This file is essential in every application. It is declared in the root directory and contains information about the application that the Android system must know before the codes can be executed.

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.

Name the Dialog Boxes Supported by Android.

a) Alert dialog box

It can be used to interrupt and ask the user whether to continue or stop a process.

b) Progress dialog box

This is to inform the user of the progress of a particular task.

c) Date picker dialog box

The date picker is a widget that is used to help the user select a date.

d) Time picker dialog box

A Time picker is a widget that is used to help the user select the time.

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.

What is .apk extension in Android?

It is a default file format that is used by the Android Operating System. Application Package Kit (APK) is used for the installation of mobile apps. The .apk contains resource file, certificate, manifest file, and other code.

How can you Identify View Elements in an Android Program?

The keyword findViewById is used to identify view elements.

What is an Application Resource File?

Application resource files are files that include static content that your code can use. This includes layout definitions, bitmaps, animation instructions, user interface strings, and more.

What are the different storage methods in Android?

Android offers several options to see persistent application data. They are:

1. Shared Preferences – Store private primitive data in key-value pairs
2. Internal Storage – Store private data on the device memory
3. External Storage – Store public data on the shared external storage
4. SQLite Databases – Store structured data in a private database

What is the difference between File, Class, and Activity in android?

The difference between them are as follows:

File is a block of arbitrary information or resources for storing information. It can be any file type.

Class is a compiled from of .Java file which Android uses to produce an executable apk.
Activity is the equivalent of a Frame/Window in GUI toolkits. It is not a file or a file type but just a class that can be extended in Android to load UI elements on view.

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.

What is an Intent?

Android has an Intent class when the user has to navigate from one activity to another. Intent displays notifications from the device to the user and then the user can respond to the notification if required.

Given below are the two types:
Implicit Intents
Explicit Intents

What is adb?

Adb is short for Android Debug Bridge. It allows developers the power to execute remote shell commands. Its basic function is to allow and control communication towards and from the emulator port.

What is the difference between an implicit intent and explicit intent?

Implicit Intent is used whenever you are performing an action. For example, send email, SMS, dial number or you can use a Uri to specify the data type. For example:

Intent i = new Intent(ACTION_VIEW,Uri.parse("http://www.edureka.co"));
startActivity(i);

Explicit, on the other hand, helps you to switch from one activity to another activity(often known as the target activity). It is also used to pass data using putExtra method and retrieved by other activity by getIntent().getExtras() methods.

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);

Which programming language is used for Android App development?

Java is the official programming language for Android App development. It is also possible to develop in C/ c++ language using NDK (Android Native Development). However, the major parts of Android are written in Java programming language and the APIs are also designed primarily from Java.

What is Android Debug Bridge(ADB)?

Android Debug Bridge is a command-line tool used to allow and control communication with an emulator instance. It gives the power for developers to execute remote shell commands to run applications on an emulator.

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.

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.

What items are important in every Android project?

These are the essential items that are present each time an Android project is created:

1 .AndroidManifest.xml
2. build.xml
3. bin/
4. src/
5. res/
6. assets/

Provide the important core components of Android.

The core components of Android operating systems are:

1. Activity
2. Intents
3. Services
4. Content Provider
5. Fragment

Define and explain the Android Framework.

Android framework is a set of API’s using which the Android developers write code for the mobile apps. It contains the methods and classes to write the programming code.

Android framework includes a different set of tools to create image pane, text field, buttons, etc. It also includes “Activities” with which the user interacts and “Services”, which are the programs that run in the background. It is a package of different components like Intents, Broadcast Receivers, Content Providers, etc.

What are the advantages of the Android Operating System?

It is open-source and platform-independent. It supports various technologies like Bluetooth, Wi-Fi, etc

Name the languages supported for Android development.

Java is the widely used language for Android development. It also supports C/C++ and when used with Android SDK, it improves the performance speed too.

What is the use of an activityCreator?

An activityCreator is the first step towards the creation of a new Android project. It is made up of a shell script that will be used to create new file system structure necessary for writing codes within the Android IDE.

What is the difference between Mobile Application Testing and Mobile Testing?

Mobile app testing is the testing of applications on a device which mainly focuses on functions and features of the application.

And Mobile Testing is the testing of the actual mobile device and focuses on mobile features like Call, SMS, Contacts, Media Player, inbuilt browsers, etc.

What is an Adapter in Android?

An adapter in Android acts as a bridge between an AdapterView and the underlying data for that view. The adapter holds the data and sends the data to the adapter view, the view can take the data from the adapter view and shows the data on different views like a spinner, list view, grid view, etc

What is the use of Bundle in Android?

Bundles are used to pass the required data between various Android activities. These are like HashMap that can take trivial data types. Below code shows how to transfer a piece of data by using bundle:

Bundle b=new Bundle();
b.putString("Email","abc@xyz.com");
i.putExtras(b); // where i is intent

What is a service in Android?

Service is an application component that facilitates an application to run in the background in order to perform long-running operations without user interaction. A service can run continuously in the background even if the application is closed or even after the user switches to another application.

What are the advantages of Android?

Open-source: It means no license, distribution and development fee.

Platform-independent: It supports Windows, Mac, and Linux platforms.

Supports various technologies: It supports camera, Bluetooth, wifi, speech, EDGE etc. technologies.

Highly optimized Virtual Machine: Android uses a highly optimized virtual machine for mobile devices, called DVM (Dalvik Virtual Machine).

What is an activity?

Activity in java is a single screen that represents GUI(Graphical User Interface) with which users can interact in order to do something like dial the phone, view email, etc.

For example, the Facebook start page where you enter your email/phone number and password to log in acts as an activity.

What is AAPT?

AAPT is short for Android Asset Packaging Tool. This tool provides developers with the ability to deal with zip-compatible archives, which includes creating, extracting as well as viewing its contents.

Describe the Android Framework.

The Android Framework is an important aspect of the Android Architecture. Here you can find all the classes and methods that developers would need in order to write applications on the Android environment.

What is the Android Architecture?

Android Architecture is made up of 4 key components:

1. Linux Kernel
2. Libraries
3. Android Framework
4. Android Applications

What Is the Google Android SDK?

The Google Android SDK is a toolset that developers need in order to write apps on Android enabled devices. It contains a graphical interface that emulates an Android driven handheld environment, allowing them to test and debug their codes.

What is Android?

Android is an open-sourced operating system that is used on mobile devices, such as mobiles and tablets. The Android application executes within its own process and its own instance of Dalvik Virtual Machine(DVM) or Android RunTime(ART).

Search
R4R Team
R4R provides Android Freshers questions and answers (Android Interview Questions and Answers) .The questions on R4R.in website is done by expert team! Mock Tests and Practice Papers for prepare yourself.. Mock Tests, Practice Papers,Android interview question set 2,Android Freshers & Experienced Interview Questions and Answers,Android Objetive choice questions and answers,Android Multiple choice questions and answers,Android objective, Android questions , Android answers,Android MCQs questions and answers Java, C ,C++, ASP, ASP.net C# ,Struts ,Questions & Answer, Struts2, Ajax, Hibernate, Swing ,JSP , Servlet, J2EE ,Core Java ,Stping, VC++, HTML, DHTML, JAVASCRIPT, VB ,CSS, interview ,questions, and answers, for,experienced, and fresher R4r provides Python,General knowledge(GK),Computer,PHP,SQL,Java,JSP,Android,CSS,Hibernate,Servlets,Spring etc Interview tips for Freshers and Experienced for Android fresher interview questions ,Android Experienced interview questions,Android fresher interview questions and answers ,Android Experienced interview questions and answers,tricky Android queries for interview pdf,complex Android for practice with answers,Android for practice with answers You can search job and get offer latters by studing r4r.in .learn in easy ways .