Android Interview question

Ref:http://androidjayavelu.blogspot.com/p/android-interview-question.html


Android Interview question

What is Android ?

It is an open_sourced operating system that is used primarily on mobile device, such as cell phones and tablet. It is a Linux kernel_based system that as been equipped with rich components that allows developers to create and run apps that can perform both basic and advanced functions .

What is the Android Architecture ?

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

what is fundamental building blocks / components of Android ?


  1. Activities
  2. Services
  3. Broadcast Receivers
  4. Content Providers.

what is Activtiy?


  Activity is the basic building block of every visible android application . Its provides the means to render a UI . Every screen in an application is an activity by itself . Though they work together to present an application sequence , each activity is an independent entity .

what is service?


  Service is another building block of android application it does not provide a UI. It is a program that can run in the background for an indefinite period .

what is Broadcast Receiver?


  Broadcast Receiver is a another type of component that can receive and respond to any broadcast announcement s.


What is Content Provider?


  Content Provider's are the only way to share data across Android applications. They store and retrieve data thus making it accessible to all. Android platform provides default implementations of content providers for data types like audio, video, images, contact information etc.
Content Providers are a separate league of components that expose a specific sets of data to applications.


what is Intent?

  Intents are messages that are passed between components. Intent is a bundle of information, a passive data structure that holds an abstract description of the operation to be performed-.


Types of intent?


 1. Explicit Intent,
 2. Implicit Intent,


What is Explicit intent?


  Explicit intent, you actually specify the activity that is required to respond to the intents.


what is Implicit intent?
  Implicit intent [the main power of the android design], you just declare an intent and leave it to the platform to find an activity that can respond to the intent.

What is Pending Intents?


   An application can create a Pending Intent, which is nothing but an intent and action to it, so that  it can passed to some other applications which can execute this pendingintent as if original application executes it.

PendingIntents can be created of three types-

getActivity(Context, int, Intent, int), 
getBroadcast(Context, int, Intent, int),
getService(Context, int, Intent, int);

How do you declare 4 components of android in mainfestfile?

 <activity>,
 <service>,
 <receiver>,
 <provider>.


What are intent filters?


 Intents filter are used to register activity, services, broadcast receiver as being capable of performing an action on a particular kind of     actions.


How many ways data stored in android?


 Shared preferences,
 Internal storage,
 External storage,
 Sqlite database,
 Network connetion.


User interface types?


 Views,
 Notifications.


Types of notifications in android?


 Tost notification,
 Status bar notification,
 Dialog notification.


How do you find any view element into your program?


 Findviewbyid,


What is handler class do in android?

 Handler allows's you to send and process message and runnable objects associated with a thread’s message queue.


Describe the APK format.


 The APK file is compressed the AndroidManifest.xml file, application code [.dex files], resource files, and other files. A project is compiled into a single .apk file.


What is an action?


 The Intent Sender desires something or doing some tasks


What is a Sticky Intent?


A Sticky Intent is a broadcast from sendStickyBroadcast() method such that the intent floats around even after the broadcast,
 allowing others to collect data from its.


Example for sticky broadcast ?

When you call registerReceiver() for that action -- even with a null BroadcastReceiver -- you get the Intent that was last broadcast for that action. Hence, you can use this to find the state of the battery without necessarily registering for all future state changes in the battery.


What Programming languages does Android support for application development?


Android applications supports using Java Programming Language. which is coded in Java and complied using Android SDK.


What is a resource?


A user defined JSON, XML, bitmap, or other file, injected into the application build process, which can later be loaded from code.


How will you record a phone call in Android? or How to handle on Audio Stream for a call in Android?


Permissions.PROCESS_OUTGOING_CALLS: Will Allows an application to monitor, modify, or abort outgoing calls. So through that we can monitor the Phone calls.


What's the difference between class, file and activity in android?

Class - The Class file is complied from .java file. Android will use this .class file to produce the executable apk.
File - It is a block of resources, srbitrary information. It can be any file type.
Activity - An activity is the equivalent of a Frame/Window in GUI toolkits. It is not a file or a file type it is just a class that can be extended in Android for loading UI elements on view.




How to Translates in android ?


The Google translator translates the data of one language into another language by using XMPP to transmit data. You can type the message in English and select the language which is understood by the citizens of the country in order to reach the message to the citizens.


What is an action?


A description of something that an Intent sender desires.


What are the advantages of Android?


The following are the advantages of Android:
* The customer will be benefited from wide range of mobile applications to choose, since the monopoly of wireless carriers like Orange and AT&T will be broken by Google Android.
* Features like weather details, live RSS feeds, opening screen, icon on the opening screen can be customized
* Innovative products like the location-aware services, location of a nearby convenience store etc., are some of the additive facilities in Android.


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.


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 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.



What is the importance of having an emulator within the Android environment?

The emulator lets developers “play” around an interface that acts as if it were an actual mobile device. They can write and test codes, and even debug. Emulators are a safe place for testing codes especially if it is in the early design phase.




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.



Describe Activities.

Activities are what you refer to as the window to a user interface. Just as you create windows in order to display output or to ask for an input in the form of dialog boxes, activities play the same role, though it may not always be in the form of a user interface.



Differentiate Activities from Services.

Activities can be closed, or terminated anytime the user wishes. On the other hand, services are designed to run behind the scenes, and can act independently. Most services run continuously, regardless of whether there are certain or no activities being executed.



What items are important in every Android project?

These are the essential items that are present each time an Android project is created:
- AndroidManifest.xml
- build.xml
- bin/
- src/
- res/
- assets/



What is the importance of XML-based layouts?

The use of XML-based layouts provides a consistent sand 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 are containers?

Containers, as the name itself implie s, holds objects and widget s 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 Orientation?

Orientation, which can be set s using setOrientation()s, dictates if the LinearLayouts is represented as a row or as a column. Values are set as either HORIZONTALs or VERTICALs.



What is the importance of Android in the mobile market?

Developers can writes and registers apps that will specifically run under the Android environment.  sThis means that every mobile device that is Android enabled will be able to support and run these apps. With the growing popularity of Android mobile devices, developers can take advantage of this trend by creatings and uploading their apps on the Android Market for distribution to anyone who wants to download it.



What do you think are some disadvantages of Android?

Given that Android is an open-source platform, and the fact that different Android operating systems have been released on different mobile devices, there’s no clear cut policys to how applications s can adapt with various OS versions and upgrades. One app that runs on this particular version of Android OS may or may not run on another version. Another disadvantage is that since mobile devices such as phones and tabs come in differents sizes and forms, it poses a challenge for developers to create apps that can adjust correctly to the right screen size and other varying features and specs.



What is adbs?

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 ports.




What are the four essential states of an activity?

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



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.



Which elements can occur only once and must be present?

Among the different elements, the and elements must be present and can occur only once. The rest are optional, and can occur as many times as needed.



How are escape characters used as attribute?

Escape characters are preceded by double backslashes. For example, a newline character is created using ‘\\n’

What is the importance of settingss permissions in app development?

Permissions allow certain restrictions to be imposed primarily to protect data and code. Without these, codes could be compromised, resulting to defects in functionality.



What is the function of an intent filters?

Because every component needs to indicate which intentss 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.



Enumerate the three key loops when monitoring an activity

- Entire lifetime – activity happens between onCreate and onDestroy
- Visible lifetime – activity happens between onStart and onStop
- Foreground lifetime – activity happens between onResume and onPauses



When is the onStop()s method invoked?

A call to onStop method happens when an activity is no longer visible to the user, either because another activity has taken over or if in front of that activity.

Is there a case wherein other qualifiers in multiple resources take precedence over locale?

Yes, there are actually instances wherein some qualifiers can take precedence over locale. There are two known exceptions, which are the MCC (mobile country code) and MNC (mobile network code) qualifiers.



What are the different states wherein a process is based?

There are 4 possible states:
- foreground activity
- visible activity
- background activity
- empty processs



How can the ANR be prevented?

One technique that preventss the Android system from concluding a code that has been responsive for a long period of time is to create a child thread. Within the child thread, most of the actual workings of the codes can be placed, so that the main thread runs with minimal periods of unresponsive timess.



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.



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 befores the codes can be executeds.




What is the proper way of setting up an Android-powered device for app developments?


The following are steps to be followed prior to actual application development in an Android-powered device:
-Declare your application as “debuggable” in your Android Manifest.
-Turn on “USB Debugging” on your device.
-Set up your system to detect your device.



Enumerate the steps in creating a bounded services through AIDL.

1. create the .aidl file, which defines the programming interface
2. implement the interface, which involves extending the inner abstracts Stub class as well as implanting its methods.
3. expose the interface, which involves implementing the service to the clients.




What is the importance of Default Resources?

When default resources, which contain default string s and files, are not present s, an error will occur and the app will not run. Resources are placed in specially named subdirectories under the project res/ directory.




When dealing with multiple resources, which one takes precedence?

Assuming that all of these multiple resources are able to match the configurations of a device, the ‘locale’ qualifier almost always takes the highest precedence over the others.



When does ANR occurs?

The ANR dialogs 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 secondss.



What is AIDL ?

AIDL, or Android Interface Definition Language, handles the interface requirements between a client and a service so both can communicate at the same level through interprocess communication or IPC. This process involves breaking down objects into primitives that Android can understand. This part is required simply because a process cannot access the memory of the other processs.




What data types are supported by AIDL ?

AIDL has support for the following data types:
-string
-charSequences
-List
-Map
-all native Java data types like int,long, char and Boolean



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 reusables.




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 memorys. When a memory paging state shas been reach by a foreground activity, then it is killed so that the user interface can retain its responsiveness to the user.




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 s this by using add(Fragment,string) method to add a fragment from the activity.



How do you remove icons and widgets from the main screen of the Android device?

To remove an icon or shortcut, press and hold that icon. You then drag it downwards to the lower part of the screen wheres a remove button appears.




What composes a typical Android application project?

A project under Android developments, upons compilation, becomes an .apk file. This apk file format is actually made up of the AndroidManifest.xml file, application code, resource files, and other related files.



Do all mobile phones support the latest Android operating system?

Some Android_powered phone allows you to upgrade to the higher Android operating system version. However, not all upgrades would allow you to get the latest version. It depends largely on the capability and specs of the phone, whether it can support the newer features available under the latest Android version.



What is portable wi-fi hotspot?

Portable Wi-Fi Hotspot allows you to share your mobile internet connection to other wireless device. For examples, using your Android-powered phone as a Wi-Fi Hotspot, you can use your laptop to connect to the Internet using that access-point.



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

In general, a Nine_patch image allows resizing that can be used as background or other image size requirements 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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值