Android Software Engine Interview Questions
Q – 1 Explain android?
Ans- Android is a stack of software for mobile devices which has 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 language’s byte code which later transforms into .dex format files.
Q – 2 Explain android activities?
Ans- Activity provides the user interface. When you create an android application in eclipse through the wizard it asks you the name of the activity. Default name is MainActivity.
You can provide any name according to the need. Basically it is a class (MainActivity) that is inherited automatically from Activity class. Mostly, applications have oneor more activities; and the main purpose of an activity is to interact with the user. Activity goes through a numberof stages, known as an activity’s life cycle.
Q – 3 What are the differences between a domain and a workgroup?
Ans- 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.
Q – 4 How much dialog boxes are supported in android?
Ans- Android supports 4 dialog boxes:
★ AlertDialog
★ ProgressDialog
★ DatePickerDialog
★ TimePickerDialog
Q – 5 List important file and folder when you create new android application?
Ans- When we create android application the following folders are created in the package explorer in eclipse which are as follows:
★ src
★ gen
★ assets
★ bin
★ res
Q – 6 Explain the sending SMS in android?
Ans- SMS messaging is one of the basic and important applications on a mobile phone. Now days every mobile phone has SMS messaging capabilities, and nearly all users of any age know how to send and receive such messages. Mobile phones come with a built-in SMS application that enables you to send and receive SMS messages.
Q – 7 Explain how to use built-in messaging within the application?
Ans- Intent object to activate the built-in Messaging service. You have to pass MIME type “vnd.android-dir/mms-sms”, in setType method of Intent as shown in the following given below code.
Intent intent = new Intent (android.content.Intent.ACTION_VIEW);
intent.putExtra(“address”, “5556; 5558;”);// Send the message to multiple recipient.
itent.putExtra(“sms_body”, “Hello my friends!”);
intent.setType(“vnd.android-dir/mms-sms”);
startActivity(intent);
Q – 8 Explain sending SMS messages programmatically?
Ans- Take a button on activity_main.xml file as follows.
According to above code when user clicks the button sendmySMS method will be called. sendmySMS is user defined method.
In the AndroidManifest.xml file, add the following statements
<uses-permissionandroid:name=”android.permission.SEND_SMS”/>
Now we write the final step. Write the given below method in MainActivity,java file
publicvoidsendmySMS(View v)
{
SmsManagersms = SmsManager.getDefault();
sms.sendTextMessage(“5556”, null, “Hello from google”, null, null);
}
In this example I have used two emulator. On the first Android emulator (5554), click the Send SMSbutton to send an SMS message to the second emulator(5556).
Q – 9 Explain activity creator in Android?
Ans- ★ An activity Creator is the initial step for creation of a new Android project.
★ It consists of a shell script that is used to create new file system structure required for writing codes in Android IDE.
Q – 10 Explain Dalvik Virtual Machine?
Ans- ★ It is Android’s virtual machine.
★ It is an interpreter-only virtual machine which executes files in Dalvik Executable (.dex) format. This format is optimized for efficient storage and memory-mappable execution.
Q – 11 What data types are supported by AIDL?
Ans- AIDL supports following data types:
★ String
★ List
★ Map
★ CharSequence
★ All native Java data types like int,long, char and Boolean
Q – 12 Explain AIDL?
Ans- ★ AIDL is the abbreviation for Android Interface Definition Language.
★ It handles the interface requirements between a client and a service to communicate at the same level through inter-process communication.
★ The process involves breaking down objects into primitives that are Android understandable.
Q – 13 Explain key components of Android Architecture?
Ans- Android Architecture consists of 4 key components:
★ Linux Kernel
★ Libraries
★ Android Framework
★ Android Applications
Q – 14 Explain application of shared preference?
Ans- ★ Storing the information about number of visitors (counter).
★ Storing the date and time (when your Application is updated).
★ Storing the username and password.
Storing the user settings.
Q – 15 Can you please explain the difference between data storage options which are available in Android?
Ans- Different data storage options are available in Android are:
★ SharedPreferences
★ SQlite
★ ContentProvider
★ File Storage
★ Cloud Storage
Q – 16 Which kind of information about the application AndroidManifest.xml file contains?
Ans- ★ It contains the package name of the application.
★ The version code of the application is 1.This value is used to identify the version number of your application.
★ The version name of the application is 1.0
★ The android:minSdkVersion attribute of the element defines the minimum version of the OS on which the application will run.
★ ic_launcher.png is the default image that located in the drawable folders.
★ app_name defines the name of applicationand available in the strings.xml file.
★ It also contains the information about the activity. Its name is same as the application name.
Q – 17 Explain AndroidManifest.xmlfile in detail?
Ans- <?xml version=”1.0″ encoding=”utf-8″?>
<manifest xmlns:android=”http://schemas.android.com/apk/res/android” package=”com.example.globalguideline” android:versionCode=”1″ android:versionName=”1.0″>
<uses-sdk android:minSdkVersion=”8″ android:targetSdkVersion=”18″ />
<application android:allowBackup=”true” android:icon=”@drawable/ic_launcher” android:label=”@string/app_name” android:theme=”@style/AppTheme”>
<activity android:name=”com.example.globalguideline.MainActivity” android:label=”@string/app_name”>
<intent-filter>
<action android:name=”android.intent.action.MAIN” />
<category android:name=”android.intent.category.LAUNCHER” />
</intent-filter>
</activity>
</application>
</manifest>
Q – 18 Explain src file in Android?
Ans- src Contains the .java source files for your project. You write the code for your application in this file. This file is available under the package name for your project.
Q – 19 Explain bin file in Android?
Ans- It contains the .apk file (Android Package) that is generated by the ADT during the build process. An .apk file is the application binary file. It contains everything needed to run an Android application.
Q – 20 Explain assets folder in Android?
Ans- This folder contains all the information about HTML file, text files, databases, etc.
Q – 21 Explain Android 4.0 library folder in Android?
Ans- This folder contains android.jar file, which contains all the class libraries needed for an Android application.
Q – 22 Explain gen folder in Android?
Ans- This folder contains the R.java file. It is compiler-generated file that references all the resources found in your project. You should not modify this file.
Q – 23 Explain res folder in Android?
Ans- This folder contains all the resource file that is used byandroid application. It contains subfolders as: drawable, menu, layout, and values etc.
Q – 24 Explain AlertDialog in Android?
Ans- An alert dialog box supports 0 to 3 buttons and a list of select-able elements, including check boxes and radio buttons. Among the other dialog boxes, the most suggested dialog box is the alert dialog box.
Q – 25 Explain ProgressDialog in Android?
Ans- This dialog box displays a progress wheel or a progress bar. It is an extension of AlertDialog and supports adding buttons.
Q – 26 Explain DatePickerDialog in Android?
Ans- This dialog box is used for selecting a date by the user.
Q – 27 Explain TimePickerDialog in Android?
Ans- This dialog box is used for selecting time by the user.
Q – 28 How to translate in Android?
Ans- 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.
Q – 29 Please explain the difference between nine-patch image vs regular Bitmap image?
Ans- It is one of a re-sizable bitmap resource which is being used as backgrounds or other images on the device. The Nine-Patch class allows drawing a bitmap in nine sections. The four corners are un-scaled; the middle of the image is scaled in both axes, the four edges are scaled into one axis.
Q – 30 What is needed to make multiple choice list with custom view for each row?
Ans- Multiple choice list can be viewed by making the CheckBox android:id value be “@android:id /text1″. That is the ID used by Android for the CheckedTextView in simple_list_item_multiple_choice.
Q – 31 Explain APK format for Android?
Ans- The APK file is compressed AndroidManifest.xml file with extension .apk. It also includes the application code (.dex files), resource files, and other files which are compressed into a single .apk file.
Q – 32 How to handle an audio stream for call in Android?
Ans- 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.
Q – 33 Tell us is it possible to started an application on powerup?
Ans- Yes.
Q – 34 Does Android support the Bluetooth serial port profile?
Ans- Yes.
Q – 35 Explain resource in Android?
Ans- A user defined JSON, XML, bitmap, or other file, injected into the application build process, which can later be loaded from code.
Q – 36 Explain sticky intent in Android?
Ans- sendStickyBroadcast() performs a sendBroadcast(Intent) known as sticky, i.e. the Intent you are sending stays around after the broadcast is complete, so that others can quickly retrieve that data through the return value of registerReceiver(BroadcastReceiver, IntentFilter). In all other ways, this behaves the same as sendBroadcast(Intent).
Example of a sticky broadcast sent via the operating system is ACTION_BATTERY_CHANGED. 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.
Q – 37 Explain Broadcast receiver component of Android?
Ans- A Broadcast receiver comes into action only in specific situations. Suppose an Intent for which a particular broadcast receiver has been registered occurs, the broadcast receiver is triggered into action and the user gets a notification for the same. (For example: Battery low notification).
Q – 38 Explain Intent component of Android?
Ans- Think of Intent as a message to allow the application to request action from the other application components (like activity), for instance VIEW, CALL, PLAY etc.
Suppose, on your Facebook app, the running activity is the Newsfeed, and you want to view (in full frame) a pic your friend posted. The click action on the photo would be the View Photo Intent, and the Photo screen (which is a new activity) gets loaded on the click (as the message is communicated).
Q – 39 Explain activity component of Android?
Ans- Activity provides an interface for users to interact with the application and take an action; for instance: Login to a website. The different screens/windows of an application are the different activities. An application generally has multiple activities.
Activities are like the pages in a website. For instance, in a Facebook app, the login screen is one activity, and the news feeds from your friends after signing in would be another one.
Q – 40 Explain the Services component of Android?
Ans- Services are components that do not have a User Interface; they run in the background. An example of Service component in Facebook app would be the friend request notifications. They would continue to run, even if you switch to another activity or application.
Q – 41 Explain Content provider component of Android?
Ans- Content provider is a data store that enables data sharing across different applications. Content providers provide a uniform interface to access the data. An example is Call logs.
Q – 42 Described the components of Android?
Ans- The main components of Android are:
1) Activity
2) Intent
3) Service
4) Broadcast receiver
5) Content Provider
Q – 43 Explain TTL (Time to Live) and why is it required?
Ans- TTL is a value in data packet of Internet Protocol. It communicates to the network router whether or not the packet should be in the network for too long or discarded. Usually, data packets might not be transmitted to their intended destination within a stipulated period of time.
The TTL value is set by a system default value which is an 8-bit binary digit field in the header of the packet. The purpose of TTL is, it would specify certain time limit in seconds, for transmitting the packet header. When the time is exhausted, the packet would be discarded. Each router receives the subtracts count, when the packet is discarded, and when it becomes zero, the router detects the discarded packets and sends a message, Internet Control Message Protocol message back to the originating host.
Q – 44 Tell me what is needed to make a multiple choice list with a custom view for each row?
Ans- Multiple choice list can be viewed by making the CheckBox android:id value be “@android:id /text1”. That is the ID used by Android for the CheckedTextView in simple_list_item_multiple_choice.
Q – 45 List the features of Android?
Ans- Components can be reused and replaced by the application framework.
Optimized DVM for mobile devices
SQLite enables to store the data in a structured manner.
Supports GSM telephone and Bluetooth, WiFi, 3G and EDGE technologies
The development is a combination of a device emulator, debugging tools, memory profiling and plug-in for Eclipse IDE.
Q – 46 How to select more than one option from list in android xml file? Give an example?
Ans- Specify android id, layout height and width as depicted in the following example.
Q – 47 Define the exceptions of Android?
Ans- The following are the exceptions that are supported by Android
InflateException :
When an error conditions are occurred, this exception is thrown
Surface.OutOfResourceException:
When a surface is not created or resized, this exception is thrown
SurfaceHolder.BadSurfaceTypeException:
This exception is thrown from the lockCanvas() method, when invoked on a Surface whose is SURFACE_TYPE_PUSH_BUFFERS
WindowManager.BadTokenException:
This exception is thrown at the time of trying to add view an invalid WindowManager.LayoutParamstoken.
Q – 48 Described the advantages of Android?
Ans- 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 AT&T and Orange 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.
Q – 49 Which dialog boxes that are supported in android? Explain?
Ans- Android supports 4 dialog boxes:
AlertDialog :
An alert dialog box supports 0 to 3 buttons and a list of selectable elements, including check boxes and radio buttons. Among the other dialog boxes, the most suggested dialog box is the alert dialog box.
ProgressDialog:
This dialog box displays a progress wheel or a progress bar. It is an extension of AlertDialog and supports adding buttons.
DatePickerDialog:
This dialog box is used for selecting a date by the user.
TimePickerDialog:
This dialog box is used for selecting time by the user.
Q – 50 Why to use Android?
Ans- Android is useful because:
It is simple and powerful SDK
Licensing, Distribution or Development fee is not required
Easy to Import third party Java library
Supporting platforms are – Linux, Mac Os, Windows.
Q – 51 Explain real time scenario where android can be used?
Ans- Imagine a situation that you are in a country where no one understands the language you speak and you can not read or write. However, you have mobile phone with you.
With a mobile phone with 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.
Q – 52 Explain Android Application Architecture?
Ans- Android Application Architecture has the following components:
Services – like Network Operation
Intent – To perform inter-communication between activities or services
Resource Externalization – such as strings and graphics
Notification signaling users – light, sound, icon, notification, dialog etc.
Content Providers – They share data between applications
Q – 53 How you can translate in Android?
Ans- Android uses Google translator to translate data from one language into another language using XAMPP. XAMPP is used to transmit the data. The steps which have to be followed are: Type the message in your language, go to the language setting, a list will be displayed there, select the language from the list to convert your text.
Q – 54 Explain Sticky Intent?
Ans- Intent is basically an abstract description of an operation that has to be performed for communication. Sticky Intent is also a type of intent which allows the communication between a function and a service. For example: sendStickyBroadcast() performs send Broadcast(Intent) which stays even after the broadcast is complete. It helps in retrieving the data quickly. The message ACTION_BATTERY_CHANGED of an operating system is an example of it.
Q – 55 Explain APK format in Android? How to make an APK file?
Ans- APK termed as Application package file is a format that is used to distribute and install the application software for android, and middleware on the android operating system. To make an APK file, first android is compiled and then all of its parts are grouped in one file termed as package. The package consists of the entire program’s code (.dex files), resources, manifest file etc. The file is saved with .apk extension.
Q – 56 Which dialog boxes are supported in android?
Ans- There are 4 dialog boxes which have been supported by Android. These are as follows:
AlertDialog:
it supports 0 to 3 buttons with a list of selectable elements that includes check boxes and radio buttons.
-ProgressDialog:
it displays the progress of any dialog or application. It is an extension of AlertDialog and supports adding buttons.
-DatePickerDialog:
it is used to give provision to the user to select the date
– TimePickerDialog:
it is used to give provision to the user to select the time
Q – 57 Explain Android Application Architecture?
Ans- Android application architecture allows the simplification and reuse of any application. It provides a better way to publish the capabilities of the application so that any other application can make good use of those capabilities.
This architecture includes the following components:
Intent:
perform some operation on some activity and service
Resource Externalization – such as strings and graphics
Notification signaling users – light, sound, icon etc.
Content Providers – sharing of data between various applications
Q – 58 Explain localization and how to achieve?
Ans- Localization is a way of representing the products in different languages. Android is an operating system which runs in many regions, so to reach different users localization is a must. Localization in Android can be achieved by incorporating different languages in the application which you are using. To do this knowledge of Java, XML elements, Activity lifecycle and general principles of internationalization and localization are required.
Q – 59 Described the different Storage Methods in android?
Ans- Android provides many options for storage of persistent data. It provides the solution according to your need. The storages which have been provided in Android are as follows:-
Shared Preferences:
Store private primitive data in key-value pairs
Internal Storage:
Store private data on the device memory.
External Storage:
Store public data on the shared external storage.
SQLite Databases:
Store structured data in a private database.
Network Connection:
Store data on the web with your own network server.
Q – 60 How does AOSP relate to the Android Compatibility Program?
Ans- AOSP stands for Android Open-source project that maintains Android software and keep track of the new versions. It can be used for any purpose including the devices that are not compatible with other devices. It is related to the Android Compatibility Program as it defines the implementation of Android that is compatible with the third party apps.
Q – 61 What is file features used in android?
Ans- Android is rich in file features and it provides lots of variations in them as well. The file features are as follows:
Intent filters:
includes bundle of information which describes a desired action.
Icons and Labels:
includes information for small icon and a text label that can be displayed to users. These are set for an intent filter and are used to represent a component which fulfills the function advertised by the filter.
Permissions:
it is a restriction or limitation access to a part of code or data on the device. It is given as:-android.permission.CALL_EMERGENCY_NUMBERS
Libraries:
it includes the basic packages for building and developing applications.
Q – 62 Tell me how to avoid ANR status?
Ans- Android allows the system to protect the applications that are not responsive for a period of time by displaying a status called as ANR (Application not responding). Methods should use the main thread for work, as it takes long time for the main thread to complete the task.
The work should be divided and another thread named as child thread be used for executing more tasks, as it takes less time. Main thread should provide a handler for child threads to post back upon completion.