YouTube Icon

Interview Questions.

Android Interview Questions and Answers for Freshers - Jul 15, 2022

fluid

Android Interview Questions and Answers for Freshers

Q1. What is Android?

Ans: Android is a stack of software program for cellular gadgets which includes an Operating System, middleware and a few key packages. The application executes within its personal method and its own example of Dalvik Virtual Machine. Many Virtual Machines run efficiently by means of a DVM tool. DVM executes Java languages byte code which later transforms into .Dex format files.

Q2. Define the utility aid file in android?

Ans: JSON,XML bitmap.And many others are software sources.You can injected those files to construct technique and may load them from the code.

Q3. What language does Android aid for utility improvement?

Ans: Android packages has written the usage of the java(Android SDK) and C/C++(Android NDK).

Q4. What is sleep mode in android?

Ans: Sleep mode mean CPU can be napping and it would not accept any commands from android device except Radio interface layer and alarm.

Q5. What are the blessings of android?

Ans: Open-source: It method no licence, distribution and development rate.

Platform-impartial: It supports windows, mac and linux platforms.

Supports various technologies: It supports digital camera, bluetooth, wifi, speech, EDGE etc. Technology.

Highly optimized Virtual Machine: Android uses fairly optimized virtual gadget for cellular devices, known as DVM (Dalvik Virtual Machine).

Q6. What's the distinction between a file, a class and an pastime in android?

Ans: File:  It is a block of arbitrary facts, or aid for storing data. It can be of any kind.

Class:  Its a compiled form of .Java report . Android subsequently used this .Elegance files to supply an executable apk

Activity: An pastime is the equivalent of a Frame/Window in GUI toolkits. It isn't always a record or a document type it is just a magnificence that can be extended in Android for loading UI elements on view.

Q7. What are utility Widgets in android?

Ans: App Widgets are miniature utility perspectives that could embedded in different applications (which includes the Home display) and acquire periodic updates. These views has called Widgets within the user interface, and you may publish one with an App Widget provider.

Q8. What is interest?

Ans: The building block of the user interface is the interest. They're in a long-going for walks communique with the consumer and may remain lively, even when idle, so long as the conversation maintains. In terms of computer improvement, an Activity is equal to a Form.

Q9. What is an Explicit Intent?

Ans: In an explicit intent, we sincerely specify the interest this is required to reply to the purpose. In other phrases, we explicitly designate the goal aspect. This is generally used for software inner messages.

Q10. What are the sort of flags to run an application in android?

Ans: FLAG_ACTIVITY_NEW_TASK

FLAG_ACTIVITY_CLEAR_TOP.

Q11. Describe Android Application Architecture.

Ans: Android Application Architecture has the following components:

Services – like Network Operation

Intent - To perform inter-communique between sports or services

Resource Externalization - including strings and images

Notification signaling customers - light, sound, icon, notification, dialog etc.

Content Providers - They proportion facts between packages

How will you document a smartphone name in Android? How to get a handle on Audio Stream for a call in Android?

Permissions.PROCESS_OUTGOING_CALLS: Allows an application to display, alter, or abort outgoing calls.

Q12. Describe the APK format.

Ans: The (Android Packaging Key) APK report is compressed format of the AndroidManifest.Xml report, application code (.Dex documents), resource documents, and different files. A challenge is compiled right into a unmarried .Apk report.

Q13. What is DDMS?

Ans: DDMS stands for Dalvik Debug Monitor Server. It gives the big range of debugging functions:

Port forwarding offerings

Screen capture

Thread and heap data

Network site visitors tracking

Location facts spoofing

Q14. What is an Implicit Intent?

Ans: In an implicit motive, the principle electricity of the android layout, we simply claim an cause and leave it to the platform to discover an pastime that can reply to the reason. Here, we do now not claim the goal issue and for this reason is generally used for activating additives of other applications seamlessly

Q15. What are the distinct levels of the Activity existence cycle?

Ans: As an hobby transitions from country to kingdom, it is notified of the exchange by means of calls to the following protected techniques:

1. Void onCreate(Bundle savedInstanceState)

2. Void onStart()

three. Void onRestart()

four. Void onResume()

5. Void onPause()

6. Void onStop()

7. Void onDestroy()

Taken collectively, those seven techniques outline the entire lifecycle of an interest.

Q16. When does onResume() technique called?

Ans: OnResume() approach is an interest lifecycle technique. This is referred to as while the hobby come to foreground. You can override this method for your pastime to execute code while interest is started, restarted or involves foreground.

Q17. What is cause?

Ans: A magnificence (Intent) describes what a caller desires to do. The caller sends this cause to Android’s reason resolver, which unearths the most suitable pastime for the reason. E.G. Opening a PDF report is an intent, and the Adobe Reader is the perfect hobby for this motive.

Q18. What is Android Runtime?

Ans: Android includes a fixed of middle libraries that provides maximum of the functionality to be had inside the core libraries of the Java programming language. Every Android application runs in its very own procedure, with its personal instance of the Dalvik virtual device. Dalvik has been written so that a device can run multiple VMs efficaciously. The Dalvik VM executes documents in the Dalvik Executable (.Dex) layout that is optimized for minimal reminiscence footprint. The VM is check in-primarily based, and runs classes compiled by means of a Java language compiler which have been converted into the .Dex format via the covered "dx" tool.

Q19. What is the distinction among Service and Thread?

Ans: Service is like an Activity but has no interface. Probably in case you want to fetch the weather for example you may not create a blank interest for it, for this you'll use a Service. It is also called Background Service because it plays duties in historical past. A Thread is a concurrent unit of execution. You need to know that you can't replace UI from a Thread. You want to use a Handler for this.

Q20. What is an AndroidManifest record?

Ans: Applications claim their additives in a occur file it truly is bundled into the Android bundle, the .Apk report that also holds the application's code, files, and assets. The occur is a established XML record and is usually named AndroidManifest.Xml for all applications. It is likewise used for naming any libraries the application wishes to be related against (except the default Android library) and figuring out any permission the software expects to be granted.

Q21. What are the measures to keep away from software ANR?

Ans: ANR in application is disturbing to person. It may be induced because of various motives. Below are some of the suggestions to avoid ANR

Perform all you long walking community or database operation in separate thread

If you have too much of background obligations, then take it off the UI thread. You may additionally use IntentService

Server not responding for longer period may be guilt for ANR. To keep away from continually define HTTP day trip in your all your webs service calls.

Be watchful of infinite loops for the duration of your complicated calculations

Q22. What is the Open Handset Alliance?

Ans: The OHA is a consortium of eighty four generation and mobile companies that have joined hands to accelerate innovation in cellular era and on the same time offer the end users a higher, price-effective and richer mobile experience. Members of this include Google, HTC, Sony, Dell, Intel, Motorola, Qualcomm, Texas Instruments, Samsung, LG, T-Mobile, Nvidia. The OHA became commenced on 5 November 2007 with the aid of Google and 34 different organizations. Android is the primary software program of the alliance.

Q23. What is ViewGroup?

Ans: A ViewGroup is a unique view which could contain other perspectives (called children.) The view organization is the base class for layouts and perspectives containers. This class also defines the class ViewGroup.LayoutParams which serves as the base elegance for layouts parameters.

Q24. What is a Toast Notification?

Ans: A toast notification is a message that pops up at the floor of the window. It best fills the amount of area required for the message and the user's modern-day activity remains visible and interactive. The notification automatically fades inside and outside, and does not receive interplay events.

Q25. What are the opposite Notifications?

Ans: A Status Bar Notification:  It is used for continual reminders that come from the history and request the consumer's response.

A Dialog Notification: It is Used for Activity-associated notifications.

Q26. What is a Service?

Ans: A Service is an application component representing either an application's desire to carry out a longer-running operation at the same time as now not interacting with the person or to deliver functionality for other packages to use. Services run with out a devoted GUI, however, like Activities and Broadcast Receivers, they nonetheless execute in the most important thread of the utility's technique. A Service will be, facility for an utility to reveal some of its functionality to other packages.

Q27. What is Dalvik Virtual Machine?

Ans: The name of Android's virtual machine. The Dalvik VM is an interpreter-best virtual machine that executes files in the Dalvik Executable (.Dex) layout, a layout this is optimized for efficient garage and reminiscence-mappable execution. The digital gadget is register-based, and it is able to run training compiled via a Java language compiler which have been converted into its local layout using the covered "dx" device. The VM runs on top of Posix-compliant working systems, which it relies on for underlying capability (which includes threading and coffee stage memory control). The Dalvik middle elegance library is supposed to provide a acquainted improvement base for those used to programming with Java Standard Edition, however it's far geared specially to the wishes of a small cellular device.

Q28. What is the significance of the .Dex documents?

Ans: Android packages are compiled into .Dex (Dalvik Executable) documents, which are in turn zipped into a single .Apk file on the device. .Dex documents may be created by using routinely, translating compiled programs written inside the Java programming language.

Q29. What does ADT stand for?

Ans: ADT stands for Android Development Tools The Android SDK includes several tools and utilities to help you create, take a look at, and debug your tasks.

Q30. What are the different tools in Android? Explain them?

Ans: The Android SDK and Virtual Device Manager : It is used to create and control Android Virtual Devices (AVD) and SDK applications. The AVD hosts an emulator going for walks a specific build of Android, letting you specify the supported SDK model, display screen resolution, amount of SD card storage available, and available hardware capabilities (along with contact screens and GPS).

The Android Emulator: An implementation of the Android digital system designed to run inside a virtual device to your development computer. Use the emulator to check and debug your Android packages.

Dalvik Debug Monitoring Service (DDMS): Use the DDMS perspective to screen and manage the Dalvik virtual machines on that you're debugging your packages.

Android Asset Packaging Tool (AAPT): Constructs the distributable Android bundle documents (.Apk).

Android Debug Bridge,(adb) : Android Debug Bridge, is a command-line debugging utility shipped with the SDK. It offers gear to browse the tool, reproduction tools on the tool, and ahead ports for debugging.

Q31. What is a Content Provider?

Ans: Content Providers are the best manner to share statistics throughout Android programs. They store and retrieve information accordingly making it available to all. Content Providers deliver a uniform interface to get admission to the information. Android platform presents default implementations of content material providers for facts kinds like audio, video, pics, contact records and so on.

Q32. What are the exclusive storage methods in android

Ans: Android offers several different options for information persistence.

Shared Preferences – Store private primitive information in key-fee pairs. This on occasion gets confined because it gives most effective key fee pairs. You cannot keep your very own java types.

Internal Storage – Store non-public information on the tool reminiscence

External Storage – Store public data at the shared external storage

SQLite Databases – Store dependent information in a non-public database. You can define many wide variety of tables and can shop statistics like other RDBMS.

Q33. What is the difference between a everyday .Png and a 9-patch photograph?

Ans: The 9 patch pix are extension with .9.Png. Nine-patch picture lets in resizing that can be used as background or different picture length requirements for the goal tool. The Nine-patch refers back to the manner you may resize the image: four corners that are unscaled, four edges that are scaled in 1 axis, and the middle one that can be scaled into each axes.

Q34. How to share textual content the usage of android share Intent ?

Ans: Share reason is an clean and handy manner of sharing content material of your utility with different apps.

Intent sendIntent = new Intent();

sendIntent.SetAction(Intent.ACTION_SEND);

sendIntent.PutExtra(Intent.EXTRA_TEXT, "This is my text to ship.");

sendIntent.SetType("text/undeniable");

startActivity(sendIntent);

Q36. What is the usage of WebView in android?

Ans: A WebView is an android UI aspect that shows webpages. It can both display a far flung website or can also load static HTML statistics. This encompasses the capability of a browser that can be incorporated to utility. WebView uses the WebKit rendering engine to show web pages and consists of methods to navigate ahead and backward via a records, zoom inside and outside, and so forth.




CFG