Tuesday, 24 July 2018

Android Interview Questions

Q. What is Android?
A. Android is an open-source, linux-based operating system that is used in mobiles, tablets, televisions etc.

In other words, Android is a software which comes with four major component.
1. Operating System(Linux O.S)
2. Library layer(Set of c/c++ programs written by Google)
3. API / Framwork layer(Written by Google)
4. Application layer(Eg. Message, Call, Alarm etc)

Require Software installation:-
1. JDK 1.8
2. Android Studio 2.0, 2.2.., 3.0, 3.1..
3. Android SDK 8.0/9.0(Minimum space 7GB)
4. GenyMotion s/w(Optional)

Q. Which kernel is used in Android?
A. Android is customized Linux 3.6 kernel

Q. What is ADT in Android?
A. ADT stands for Android Development Tool. It is used to develop the applications and test the applications.

Q. Who is the founder of Android?
A. Andy Rubin.

Q. What is Build.gradle?
A. Build.gradle is a predefined tool which comes along with android studio. This file build the application and generate .apk file.

Q. What is .apk file?
A. .apk is android application package. It is final install able file on the phones and tablets.

See full: Android Interview Questions

Q. What is ADB?
A. ADB is Android Debug Bridge tool. It is a tool which comes along with android studio. ADB establish connection between android studio and phone. It pushes .apk file to drive.

In other words, ADB stands for Android Debug Bridge. It is a command line tool that is used to communicate with the emulator instance.

Q. What is AAPT?
A. AAPT is an acronym for android asset packaging tool. It handles the packaging process.

Q. What is DDMS?
A. DDMS stands for Dalvik Debug Monitor Server. It gives the wide array of debugging features:

Port forwarding services
Screen capture
Thread and heap information
Network traffic tracking
Location data spoofing

Q. What is ANR?
A. ANR stands for Application Not Responding. It is a dialog box that appears if the application is no longer responding.

Q. What is broadcastreceiver in android?
A. It is a component of android which responds to system wide broadcast announcments.

It acts like a gateway between outside world and your application.

Q. Broadcast receiver runs in which thread, by default?
A. Default every component of android will run in Main thread (UI thread). So broadcast receiver also runs in main thread by default.

Q. Is it possible to start a service from a broadcast receiver?
A. Any component can communicate with other component. Only exception for this rule is don't bind to a service from a broad cast receiver. other wise one is free to start a service.

Q. What is content provider?
A. Content providers are used to share information between android applications.

Q. How to start a content provider using an intent?
A. For content provider we have to use content resolver to communicate.

Q. What is the use of content provider? Will it support shared preferences?
A. It is used to share an application's data with out side world. Right now there is no support for shared preferences.

Q. What is the difference between contentprovider and contentresolver?
A. Content provider is used to share private data with other applications.

Content resolver communicates from client end with content provider.

Q. What is the difference between cursor & contentvalues?
A. Cursor is buffer which holds rows(results) from db table on querying. Content values is used to pass data to SQLite functions.

Q. How to get contact phone number from contacts application's content provider?
A. Use ContactsContract.Contacts.URI and commonDataKinds. Phone.CONTENT_URI, then request it through content resolver.

Q. Where does the SQLite database of an android application get stored in memory?
A. By default it is stored in internal memory, but it is also possible to store it in sd card also.

Q. What is Intent?
A. Intent is a predefined class of android layer. Using intent we can start other activities.

In other words, it is a kind of message or information that is passed to the components. It is used to launch an activity, display a web page, send sms, send email etc.
Q. How do you pass data to other screens / activities?
A. By using,
1. Intent class
2. putExtra() method
3. startActivity() method

Q. What is Bundle?
A. Bundle is a predefined class of android layer. It is a container which carries data. Bundle will be created when we say putExtra() method.

Note: Internally bundle will use HashMap to store key value pairs.

Read more at: Android Interview Questions

No comments:

Post a Comment