1. Describe the android activities?

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.

2. Define the sending SMS in android?

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.

3. Tell me how to use built-in messaging within the application?

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);

4. Describe sending SMS messages programmatically?

Take a button on activity_main.xml file as follows.

<Button android:id="@+id/btnSendSMS" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:onClick="sendmySMS" android:text="sendSMS" />

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

5. Define activity creator in Android?

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

6. Define Dalvik Virtual Machine?

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

7. Tell me what data types are supported by AIDL?

AIDL supports following data types:
★ String
★ List
★ Map
★ CharSequence
★ All native Java data types like int,long, char and Boolean

8. Define AIDL?

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

9. List the key components of Android Architecture?

Android Architecture consists of 4 key components:
★ Linux Kernel
★ Libraries
★ Android Framework
★ Android Applications

10. List the application of shared preference?

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

11. List the different data storage options which are available in Android?

Different data storage options are available in Android are:
★ SharedPreferences
★ SQlite
★ ContentProvider
★ File Storage
★ Cloud Storage

12. What kind of information about the application AndroidManifest.xml file contains?

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

13. Describe AndroidManifest.xmlfile in detail?

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

14. Define src file in Android?

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.

15. Define bin file in Android?

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.

16. Define assets folder in Android?

This folder contains all the information about HTML file, text files, databases, etc.

17. Define Android 4.0 library folder in Android?

This folder contains android.jar file, which contains all the class libraries needed for an Android application.

18. Define gen folder in Android?

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.

19. Define res folder in Android?

This folder contains all the resource file that is used byandroid application. It contains subfolders as: drawable, menu, layout, and values etc.

20. What are the important file and folder when you create new android application?

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

21. Define AlertDialog in Android?

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.

22. Define ProgressDialog in Android?

This dialog box displays a progress wheel or a progress bar. It is an extension of AlertDialog and supports adding buttons.

23. Define DatePickerDialog in Android?

This dialog box is used for selecting a date by the user.

24. Define TimePickerDialog in Android?

This dialog box is used for selecting time by the user.

25. How much dialog boxes are supported in android?

Android supports 4 dialog boxes:
★ AlertDialog
★ ProgressDialog
★ DatePickerDialog
★ TimePickerDialog

26. Explain the difference between nine-patch image vs regular Bitmap image?

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.

27. Tell me what is needed to make multiple choice list with custom view for each row?

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.

28. Do you know 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.

29. Define APK format for Android?

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.

32. How you can 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.

33. Define resource in Android?

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

34. Define sticky intent in Android?

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.

35. Define Broadcast receiver component of Android?

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