Your Ad Here

Tuesday

0 Android Interview Questions and Answers


What is Android?
Android is a stack of software for mobile devices which includes an Operating System, middleware and some key applications. The application executes within its own process and its own instance of Dalvik Virtual Machine. Many Virtual Machines run efficiently by a DVM device. DVM executes Java languages byte code which later transforms into .dex format files.

What is the architecture of Android?
  • Top > Applications (Contact, Brose and phone)
  • Below > Application framework (Activity Manager, Content providers, view system and package manager)
  • Below Application Frame work > System libraries like, webkit, SSL and OpenGL.
  • Last > Linux Kernel (includes display and camera)
What is an Intent?
A class (Intent) which describes what a caller desires to do. The caller will send this intent to Android's intent resolver, which finds the most suitable activity for the intent. E.g. opening a PDF document is an intent, and the Adobe Reader apps will be the perfect activity for that intent (class).

 Describe the APK format?
The APK file is compressed form of an elongated version which is > AndroidManifest.xml, .dex files, resource files and other such files.

What is a service?
 A service doesn’t have a visual user interface, but rather runs in the background for an indefinite period of
time.
For example, a service might play background music as the user attends to other matters, or it might fetch data
over the network or calculate something and provide the result to activities that need it.Each service extends the
Service base class. 

What is an Activity?
A single screen in an application, with supporting Java code.

What is a content provider?
A content provider makes an appropriate list of the application’s data for other applications. The content provider expands its base class to implement a standard set of applied methods that store the data of all type of controls. But the applications do not call these methods directly they actually use a contentresolver tool and call for methods.

Does Android support the Bluetooth serial port profile?
Yes.

Can an application be started on powerup?
Yes. 

What is the latest Android platform for phones?
Android 4.0, named Ice-cream Sandwich. The versions that came out before this were
  • 1.5 Cupcake
  • 1.6 Donut
  • 2.0/2.1 Eclair
  • 2.2 Froyo
  • 2.3.x Gingerbread
  • 3.x.x Honeycomb
  • 4.0.x IceCream Sandwich
  • 4.1.x JellyBean
What is an action?

An action can be described as something that an intent sender desires.

What is an activity?

An activity is a single screen in an application which supports Java code.

How the nine-patch Image different from a regular bitmap? Alternatively, what is the difference between nine-patch Image vs regular Bitmap Image?

It is one of a resizable bitmap resource which is being used as backgrounds or other images on the device. The NinePatch class allows drawing a bitmap in nine sections. The four corners are unscaled; the middle of the image is scaled in both axes, the four edges are scaled into one axis.

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 an Audio Stream for a call in Android?

Permission.PROCESS_OUTGOING_CALLS: Will Allow an application to monitor, modify, or abort outgoing calls. So using that permission we can monitor the Phone calls.

What is a Sticky Intent?

 sendStickyBroadcast() performs a sendBroadcast (Intent) known as sticky, i.e. the Intent you aresending stays around after the broadcast is complete, so that others can quickly retrieve that datathrough the return value of registerReceiver (BroadcastReceiver, IntentFilter). In all other ways, thisbehaves the same as sendBroadcast(Intent).
One example of a sticky broadcast sent via the operating system is ACTION_BATTERY_CHANGED. When you call registerReceiver() for that action -- evenwith 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 batterywithout necessarily registering for allfuture state changes in the battery.Is there anyway to determine if an Intent passed into a BroadcastReceiver's onReceive isthe result of a sticky Boradcast Intent, or if it was just sent?

Example for sticky broadcast

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

Does Android support the Bluetooth serial port profile?
Yes, it does.

How to Translate 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.

Which virtual machine does Android runs on?
It is Dalvik Virtual machine. It is a process virtual machine.

What are the differences between a domain and a workgroup?

In a domain, one or more computer can be a server to manage the network. On the other hand in a workgroup all computers are peers having no control on each other. In a domain, user doesn’t need an account to logon on a specific computer if an account is available on the domain. In a work group user needs to have an account for every computer.
In a domain, Computers can be on different local networks. In a work group all computers needs to be a part of the same local network.

What is the role of compatibility that is used in Android?

The compatibility is defined in terms of android compatible devices that run any application. This application is written by third party developers using the Android platform that comes in the form of SDK and NDK. There are many filters that are used to separate devices that are there to participate in the compatibility mode for the Android applications. The devices that are compatible require the android to approve it for their trademark. The devices that are not passes the compatibility are just given in the Android source code and can use the android trademark. The compatibility is a way through which the user can participate in the Android application platform. The source code is free to use and it can be used by anyone


What is the main reason of using process lifecycle in Android?

The android system will keep all the process that are hosting the services together at one place till the time the service is not started or connected to the client. The priority of the process is divided when running low on memory or when the process has to be killed. The process lifecycle is as follows:
• The service is running currently then the methods onCreate(), onStartCommand(), and onDestroy()methods, will run in the foreground to execute the process without being killed.
• The service is already started then the process can be considered as less important then the processes that are currently visible and used. This is done as there are only few processes that are visible to the users on the screen.
• The clients are bounded to the services they are providing requires more priority in the execution list.
• The service that is started uses startForeground(int, Notification)API to allow all the services to run in the foreground state. The system considers only the services where the user is still active as the services not to be killed.

What are the different data types used by Android?

The data can be passed between many services and activities using the following data types:
• Primitive Data Types: are used to share the activities and services of an application by using the command as Intent.putExtras(). This primitive data passes the command to show the persistent data using the storage mechanism. These are inbuilt data types that are used with the program. They provide simple implementation of the type and easy to use commands.
• Non-Persistent Objects: are used to share complex and non-persistent objects. These are user-defined data types that are used for short duration and are also recommended to be used. These types of objects allow the data to be unique but it creates a complex system and increase the delay.

Write a program to show the addition and removing of the package.

The package is a collection of similar or different classes that can be added or removed. The package that is added with the following parameter in the command as PACKAGE_ADDED action this allow to broadcast the message of addition to the entire system and in the same way the remove command action i.e. PACKAGE_REMOVED is used. The program that performs both the action is as follows:

<receiver android:name ="com.android.samples.app.PackageReceiver">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED"/>
<action android:name="android.intent.action.PACKAGE_REMOVED"/>
<data android:scheme="package" />
</intent-filter>
</receiver>

What are the security measures that are taken to make Android secure?

Android uses many security measures to keep them away from the hackers. They have designed by making changes to the devices or installing a software service on the mobile. Android application uses sandbox that is very popular and allow limited access to the information that is very private and sensitive for the user. It allows the permissions to be set for the use of the information. The security measures that are provided by android is the use of the encryption of the messages that allow user to remain without worry about there phone security. They also consists of user terms and agreements that also taken care of. Most of the time android doesn't allow other applications to run on their system but it can be done by using different resources that are available on-line. As, android is open source it is not fully secure but lots of security issues are being solved for make it more popular and bug free.

Why is Google in charge of Android?

Launching a software platform is complex. Openness is vital to the long-term success of a platform, since openness is required to attract investment from developers and ensure a level playing field. However, the platform itself must also be a compelling product to end users.
That’s why Google has committed the professional engineering resources necessary to ensure that Android is a fully competitive software platform. Google treats the Android project as a full-scale product development operation, and strikes the business deals necessary to make sure that great devices running Android actually make it to market.
By making sure that Android is a success with end users, we help ensure the vitality of Android as a platform, and as an open-source project. After all, who wants the source code to an unsuccessful product?
Google’s goal is to ensure a successful ecosystem around Android, but no one is required to participate, of course. We opened the Android source code so anyone can modify and distribute the software to meet their own needs.



0 comments:

Post a Comment

 

Free Test Answers And Blogger Tips For Making Money Online Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates