0% found this document useful (0 votes)
54 views4 pages

MAD MID-II 2 Marks

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views4 pages

MAD MID-II 2 Marks

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Certainly!

Here are answers for the questions listed from UNIT-3 to UNIT-5, covering various aspects
of Android development:

### UNIT-3

#### 1. What is the orientation supported by Linear Layout?

LinearLayout supports two orientations:

- `vertical`: Arranges the child views vertically in a column.

- `horizontal`: Arranges the child views horizontally in a row.

#### 2. What is the purpose of an Image Switcher?

An Image Switcher is used in Android to switch between images with animations when the current
image changes. It's useful for galleries, image sliders, or any interface where the images need to be
changed dynamically.

#### 3. List the various anchoring controls.

In Android layouts, anchoring is not typically referred to with this term, but related controls for
positioning include:

- `RelativeLayout` or `ConstraintLayout`: Allows anchoring views relative to parent or other views.

- Attributes like `android:layout_alignParentTop`, `android:layout_alignParentBottom`,


`android:layout_toLeftOf`, etc.

#### 4. List out types of Resources.

Android supports various types of resources:

- Layouts (XML files defining UI layouts)

- Drawables (graphics and shapes)

- Values (strings, colors, dimensions, styles, etc.)

- Menus

- Animations

- Raw (arbitrary files, like text files)

#### 5. List some relative layout Attributes?

Some common attributes for `RelativeLayout` include:

- `android:layout_above`
- `android:layout_below`

- `android:layout_toRightOf`

- `android:layout_toLeftOf`

- `android:layout_alignParentTop`

- `android:layout_alignParentBottom`

- `android:layout_centerInParent`

- `android:layout_centerHorizontal`

- `android:layout_centerVertical`

### UNIT-4

#### 1. State the significance of Progress bar.

A Progress Bar is used to show the user the progress of an operation, providing a visual indication of
its completion status, which improves the user experience by informing users that processing is
occurring.

#### 2. Define a fragment.

A Fragment represents a behavior or a portion of the user interface in an Android Activity. It can be
reused and combined in multiple activities. Fragments have their own lifecycle, receive their own
input events, and can be added or removed while the activity is running.

#### 3. What is spinner?

A Spinner in Android is a drop-down list that allows users to select one value from a list. When a user
taps the spinner, it displays a dropdown menu with all available options.

#### 4. Write syntax for Time Picker dialog class.

The basic syntax to create a TimePickerDialog is:

```java

TimePickerDialog timePickerDialog = new TimePickerDialog(context, new


TimePickerDialog.OnTimeSetListener() {

@Override

public void onTimeSet(TimePicker view, int hourOfDay, int minute) {

// code to handle the time choice

}
}, initialHour, initialMinute, is24HourView);

```

#### 5. What are different types of dialogs?

Common types of dialogs in Android include:

- AlertDialog

- DatePickerDialog

- TimePickerDialog

- ProgressDialog

- Custom Dialogs (created with custom layouts)

### UNIT-5

#### 1. Why is SQLite Open Helper class important?

SQLiteOpenHelper class is crucial for managing database creation and version management. It
simplifies the process of creating, opening, and upgrading the database.

#### 2. What is a telephony manager?

The TelephonyManager class provides access to information about the telephony services on the
device. It can be used to gather information such as the state of the network, the device’s phone
number, and the status of ongoing calls.

#### 3. What are the different types of Menus?

Android supports several types of menus:

- Options Menu: Main menu for an activity, accessed via the device menu button.

- Context Menu: Floats on screen upon user interaction, providing actions related to selected
element.

- Popup Menu: Shows a list of items in a modal popup window anchored to a view.

#### 4. Define context Menu?

A Context Menu is a floating menu that appears when the user performs a long-click on an element.
It provides options that are relevant to the element or context frame.

#### 5. Mention the use of action bar.


The ActionBar in Android is used to provide navigation and interactive elements at the top of the
screen. It may contain navigation modes, application titles, icons, and action items that invoke
various functions such as search, create, share, and settings.

You might also like