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

Mad ct2

Uploaded by

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

Mad ct2

Uploaded by

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

1) Write the syntax for Intent-Filter tag.

<activity android:name=".ExampleActivity" android:icon="@drawable/app_icon">

<intent-filter>

<action android:name="android.intent.action.SEND" />

<category android:name="android.intent.category.DEFAULT" />

<data android:mimeType="text/plain" />

</intent-filter>

</activity>

2) Explain Date and Time picker with its methods.

DatePicker is a widget used to select a date. It allows to select date by day, month and year in your
custom UI

If we need to show this view as a dialog then we have to use a DatePickerDialog class

 getDayOfMonth():-This method is used to get the selected day of the month from a date
picker. This method returns an integer value.
 getMonth():-This method is used to get the selected month from a date picker. This
method returns an integer value.
 getYear():-This method is used to get the selected year from a date picker. This
method returns an integer value.
 getFirstDayOfWeek():-This method is used to get the first day of the week. This method
returns an integer value.

3.List different User Interface Elements. Explain Toggle Button.

Text View, Edit Text, Button, Image Button, RadioButton, RadioGroup, CheckBox, ProgressBar,

A ToggleButton is a user interface element in Android that represents a two-state button, typically
used for enabling or disabling a feature or setting. It displays checked and unchecked states, and
users can toggle between these states by tapping the button.

4. Explain Google Map with types.

In Android Studio, integrating Google Maps into your application can provide powerful features for
location-based services and enhance the user experience. Google Maps allows you to display maps,
add markers, draw routes, and perform various other operations related to maps and locations.

Normal, Satellite, Terrain, Hybrid


5. List any 4 methods to get location data in android.

LocationManager, FusedLocationProviderClient, Geocoder, LocationRequest

6.Draw and explain the activity life cycle.

A user navigates through the app, Activity instances in your app transition through different stages in
their life-cycle.

The Activity class provides a number of callbacks that allow the activity to know that a state has
changed: that the system is creating, stopping, or resuming an activity, or destroying the process
in which the activity resides.

In general, activity lifecycle has seven callback methods:

 onCreate()- In this state, the activity is created.


 onStart()- This callback method is called when the activity becomes visible to the user.
 onResume()- called when activity will start interacting with the user.
 onPause()- called when activity is not visible to the user.
 onStop()- The activity is completely hidden and not visible to the user.
 onRestart()- From the Stopped state, the activity either comes back to interact with the user
or the activity is finished running and goes away. If the activity comes back, the system
invokes onRestart().
 onDestroy()- Activity is destroyed and removed from the memory.
7 Discuss the need of permissions in Android. Describe the permissions to set system functionalities
like Bluetooth and camera.

 The purpose of a permission is to protect the privacy of an Android user.


 Android apps must request permission to access sensitive user data (such as contacts and
SMS), as well as certain system features (such as camera and internet).
 Depending on the feature, the system might grant the permission automatically or might
prompt the user to approve the request.
 A central design point of the Android security architecture is that no app, by default, has
permission to perform any operations that would adversely impact other apps, the
operating system, or the user.
 This includes reading or writing the user's private data (such as contacts or emails), reading
or writing another app's files, performing network access, keeping the device awake, and so
on.

8 List sensors in Android and explain any one in detail.

Motion sensors, Position sensors

Environmental sensors:

These sensors measure various environmental parameters, such as ambient air temperature and
pressure,illumination, and humidity. This category includes barometers, photometers, and
thermometers.

Camera is mainly used to capture picture and video. We can control the camera by using methods of
camera API.

Android provides the facility to work on camera by 2 ways:

 By Camera Intent
 By Camera API

There are mainly four classes:

1. Intent
 -By the help of 2 constants of MediaStore class, we can capture picture and video without
using the instance of Camera class.
 ACTION_IMAGE_CAPTURE
 ACTION_VIDEO_CAPTURE
2. Camera
- It is main class of camera API, that can be used to take picture and video.
3. SurfaceView
- It represents a surface view or preview of live camera.
4. MediaRecorder
- It is used to record video using camera. It can also be used to record audio files

9 Develop a program for providing bluetooth connectivity.

10.Name two classes used to play audio and video in Android.


MediaPlayer Class, VideoView Class

11.Explain the categories of Sensors.

Most of the android devices have built-in sensors that measure motion, orientation, and various
environmental condition.

Motion sensors: These sensors measure acceleration forces and rotational forces along three axes.
This category includes accelerometers, gravity sensors, gyroscopes, and rotational vector sensors.

Environmental sensors: These sensors measure various environmental parameters, such as ambient
air temperature and pressure, illumination, and humidity. This category includes barometers,
photometers, and thermometers.

Position sensors: These sensors measure the physical position of a device. This category includes
orientation sensors and magnetometers.

12. Develop a program to send an email

Develop an application to send and receive SMS (Write only Java and permission tag in manifest file).

You might also like