Android Interview Questions and Answers Set 3

21.What do containers hold?

– Containers hold objects and widgets in a specified arrangement.

– They can also hold labels, fields, buttons, or child containers.

22.Tell us something about activityCreator?

An activityCreator is the first 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.

23.What is the difference between a class , a file and an activity in android?

Class – Its a compiled form of .Java file . Android finally used this .class files to produce an executable apk

File – It is a block of arbitrary information, or resource for storing information. It can be of any type.

Activity – An activity is the equivalent of a 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.

24.What item 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/

25.Describe the SmsManager class in android.

SmsManager class is responsible for sending SMS from one emulator to another or device.

You cannot  instantiate this class directly; instead of , You can call the getDefault method static() to obtain an SmsManager object. Then send the SMS message using the

sendTextMessage() method:

SmsManagersms = SmsManager.getDefault();

sms.sendTextMessage(“5556”, null, “Hello from careerRide”, null, null);

sendTextMessage() method takes five argument.

– destinationAddress — Phone number of the recipient.

– scAddress — Service center address; you can use null also.

– sentIntent — Pending intent to invoke when the message is sent.

– text — Content of the SMS message that you like to send.

– deliveryIntent — Pending intent to invoke when the message has been delivered.

ANDROID APPLICATION TRAINING
Weekend / Weekday Batch

26.How to disable landscape mode in Android?

Open AndroidManifest.xml file and set following.

android:screenOrientation=”sensorPortait”

27.Enumerate the three key loops when monitoring an activity

– Entire lifetime  :  The activity happens between onCreate and onDestroy

– Visible lifetime  :  The activity happens between onStart and onStop

– Foreground lifetime : The activity happens between onResume and onPause

28.Which language is supported by Android for application development?

The main language supported is Java programming language. Java is the most popular language for app development, which makes it ideal even for new Android developers to quickly learn to create and deploy applications in the Android environment.

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

The Android SDK and Virtual Device Manager-It is used to create and manage Android Virtual Devices (AVD) and SDK packages. The AVD hosts an emulator running a particular build of Android, letting you specify the supported SDK version, screen resolution, amount of SD card storage available, and available hardware capabilities (such as touch screens and GPS).

The Android Emulator– Android virtual machine designed to run within a virtual device on your development computer. Use the emulator to test and debug your Android applications.

Dalvik Debug Monitoring Service (DDMS) – Use the DDMS perspective to monitor and control the Dalvik virtual machines on which you’re debugging your applications.

Android Asset Packaging Tool (AAPT) – Constructs the distributable Android package files (.apk).

Android Debug Bridge,(adb) – Android Debug Bridge, is a command-line debugging application shipped with the SDK. It provides tools to copy tools on the device, browse the device and forward ports for debugging.

30.What do intent filters do?

– There can be more than one intents, depending on the services and activities that are going to use them and  each component wants to tell which intents they want to response to.

– Intent filters out the intents that these components are willing to respond to.