You are on page 1of 16

Section – A - MCQ

1. Android is an Operating System


2. Android is developed for Mobile Devices
3. First Android OS phone released was T-Mobile G1
4. Android Inc developed Android
5. Muffin is not a nick name of a version of Android
6. Activity is a configuration that defines the characteristics of and Android phone/tablet.
7. List View is a view which groups several items and display them in vertical scrollable
list.
8. Text View to display text on android application screen
9. SQLite is built in database of android.
10. Android.database library provides access to the database.
11. SQLite is a relational database
12. Alter command modifies an existing database object such as table.
13. Email messeages distributed by electronic means from one system user to one or more
recipients via a network
14. Android come with a built-in sms application that enables to send and receive sms
messages.
15. Service is an application in android that runs in the background

Section B

B 1- Explain the android application


B 2- Explain architecture of android system
B 3- What are the advantages of android
B 4- Explain the components of screen in android
B 5- Discuss different types of user interface view
B 6- What are the purposes of geocoding
B 7- What are the two types of intent
B 8- What are the different data storage options available on the android platform
B 9- Explain content provide in android
B 10- What the features of sqlite (Week9)
B 11- Explain how t send email in android application (Week 11 – Unit4)
B 12- Explain location based services (Week 13 – Unit5)
B 13- What are the purpose of geocoding in android (Week 14 – Unit5)

Section C

1. Explain types of intent in android


2. What are different types of android devices in market
C-1- Explain types of intent in android

In Android, an Intent is an object that provides a messaging system between components such
as activities, services, and broadcast receivers. It is used to request an action from another
component of the same or different application 123.

There are two types of intents in Android: Implicit Intents and Explicit Intents. Here is a
comparison of the two types:

Implicit Intents Explicit Intents

Do not specify the component Specify the component

Declare the exact component to be


Declare an action to be performed
used

Android operating system filters out Only the specified component can
components that can respond to the action respond to the action

Used when you don’t know which component Used when you know which
can perform the action component can perform the action

Example: Displaying a webpage Example: Starting an activity

Here are some examples of how Intents can be used in Android applications:

1. Starting an Activity: An Activity can be started by creating an Intent object and calling
the startActivity() method 2.

2. Broadcasting a Message: An Intent can be used to broadcast a message to other


components of the system 3.

3. Starting a Service: An Intent can be used to start a service in the background 4.

I hope this helps!


C-2 - What are different types of android devices in market
There are many types of Android devices available in the market. Here are some examples:

1. Smartphones: Android is the most popular operating system for smartphones, with
over three billion active users 1. Some of the most popular Android smartphones
include Samsung Galaxy S21, Google Pixel 6, OnePlus 9, and Xiaomi Mi 11 2.

2. Tablets: Android tablets are similar to iPads and are designed for browsing the web,
watching videos, and playing games. Some popular Android tablets include Samsung
Galaxy Tab S7, Lenovo Tab P11 Pro, and Huawei MatePad Pro 2.

3. Smartwatches: Android smartwatches are wearable devices that can be paired with a
smartphone to receive notifications, track fitness, and control music playback. Some
popular Android smartwatches include Samsung Galaxy Watch 4, Fossil Gen 6, and
TicWatch Pro 3 2.

4. TVs: Android TV is a smart TV platform that runs Android apps. Some popular Android TV
devices include Sony Bravia X90J, TCL 6-Series, and Nvidia Shield TV 3.

5. Cars: Android Auto is a mobile app that allows users to connect their Android
smartphones to their cars and use the phone’s features while driving. Some popular
cars with Android Auto support include Honda Civic, Hyundai Sonata, and Kia Sorento 4.
B 1- Explain the android application
An Android application is a software program that runs on devices that use the
Android operating system, such as

Smartphones

Tablets

smart TVs and

wearables.

An Android application consists of one or more components, such as

activities,

services,

content providers, and

broadcast receivers, that work together to provide the functionality and user
interface of the app.

An Android application also has resources, such as

images,

sounds,

layouts, and

strings, that enhance the appearance and usability of the app.

An Android application is written using Kotlin, Java, or C++ languages, and


uses the Android SDK tools to compile the code and resources into an APK or
an app bundle file that can be installed and run on Android devices.
B 2- Explain architecture of android system
The architecture of the Android system is a multi-layered software stack that consists of the
following components:

• Linux kernel: The foundation of the Android system, which provides low-level
functionalities such as hardware abstraction, memory management, process
management, and security.

• Hardware abstraction layer (HAL): A set of library modules that provide standard
interfaces for accessing device-specific hardware components, such as camera, audio,
sensors, etc.

• Android runtime (ART): The environment that runs Android applications, which consists
of a virtual machine that executes bytecode files (DEX) compiled from Java or Kotlin
source code, and a set of core libraries that provide Java-like features and
functionalities.

• Native C/C++ libraries: A collection of libraries that provide native support for various
tasks and features, such as graphics, media, web, SQLite, etc.

• Java API framework: A set of Java classes and interfaces that expose the functionality
of the native libraries and the HAL to the applications. It also provides various system
services and managers that handle the application lifecycle, user interface, resources,
permissions, etc.

• System apps: The pre-installed applications that run on the Android system, such as
launcher, phone, contacts, browser, etc.
B 3- What are the advantages of android
Android is a popular mobile operating system that has many advantages, such as:

• It is open source, which means that anyone can use and modify it for free. This also
encourages a large community of developers and a variety of apps and customizations.

• It offers a lot of device variety, as many manufacturers use Android to power their
smartphones, tablets, smart TVs, and other devices. This gives consumers more
choices and options in terms of hardware features and specifications.

• It allows a high level of customization, as users can change the launcher, install custom
ROMs, and personalize their device’s appearance and functionality according to their
preferences.

• It has a rich app ecosystem, as the Google Play Store provides a vast selection of apps
and games, both free and paid, for different purposes and categories. Users can also
sideload apps from outside the Play Store if they want to access more apps that are not
available there.

• It integrates well with Google services, such as Gmail, Google Calendar, Google Drive,
and Google Maps, which are widely used and convenient for many users. Users can also
access other Google features, such as Google Assistant, Google Photos, and Google
Lens, on their Android devices.
B 4- Explain the components of screen in android
The components of screen in android are the UI elements that make up the visual appearance
and interaction of an android application. The main components of screen in android are:

• Views: Views are the basic building blocks of an android UI. Views are the visual
components that are used to display information and receive user input. Examples of
views include text boxes, buttons, and images.

• ViewGroups: ViewGroups are containers that hold and arrange views in a particular
order on the screen. ViewGroups provide the layout and structure of the UI. Examples of
ViewGroups include LinearLayout, RelativeLayout, and FrameLayout.

• Fragments: Fragments are reusable UI components that can be attached to an activity.


Fragments allow you to create modular and dynamic UIs that can adapt to different
screen sizes and orientations. Examples of fragments include ListFragment,
DialogFragment, and PreferenceFragment.

• Widgets: Widgets are small visual application components that you can find on the
home screen of the devices. Widgets are a special variation of Broadcast Receivers that
allow you to create dynamic, interactive application components for users to embed on
their Home Screen. Examples of widgets include Clock, Calendar, and Weather.
B 5- Discuss different types of user interface view
There are different types of user interface views in Android that can be used to create interactive
and attractive UIs for your apps. Some of the common types of views are:

• TextView: A view that displays text on the screen. You can use this view to show labels,
messages, instructions, or any other textual information. You can also customize the
appearance and behavior of the text, such as font, color, size, alignment, etc.

• EditText: A view that allows the user to enter and edit text on the screen. You can use
this view to get input from the user, such as names, passwords, email addresses, etc.
You can also specify the type of input, such as text, number, email, etc., and add
validation and formatting rules.

• Button: A view that represents a clickable button on the screen. You can use this view to
trigger an action or event when the user taps on it. You can also change the shape, color,
icon, and text of the button to suit your app’s theme and functionality.

• ImageButton: A view that displays an image as a button on the screen. You can use this
view to create more visually appealing buttons that have images instead of text. You can
also set the background and foreground images of the button and handle the click
events.

• DatePicker: A view that allows the user to select a date from a calendar or a spinner.
You can use this view to get the user’s date of birth, travel date, appointment date, etc.
You can also customize the appearance and format of the date picker and set the
minimum and maximum date range.

• RadioButton: A view that represents a radio button on the screen. You can use this view
to create a set of mutually exclusive options for the user to choose from, such as gender,
payment method, delivery option, etc. You can also group the radio buttons using a
RadioGroup view and handle the selection events.

• CheckBox: A view that represents a checkbox on the screen. You can use this view to
create a set of multiple choice options for the user to select from, such as hobbies,
interests, preferences, etc. You can also check or uncheck the checkbox
programmatically and handle the state change events.

• Spinner: A view that displays a drop-down list of items on the screen. You can use this
view to create a compact and easy way for the user to select one item from a predefined
list of options, such as country, language, category, etc. You can also populate the
spinner with an array of strings or objects and handle the item selection events.

• ListView: A view that displays a scrollable list of items on the screen. You can use this
view to show a large number of data items in a vertical layout, such as contacts,
messages, files, etc. You can also customize the appearance and layout of each item
and handle the click and long-click events.

• GridView: A view that displays a scrollable grid of items on the screen. You can use this
view to show a collection of data items in a two-dimensional layout, such as photos,
icons, products, etc. You can also customize the number of columns, spacing, and
padding of the grid and handle the item click events.
B 6- What are the purposes of geocoding
Geocoding is the process of transforming a description of a location, such as an address or a
place name, into geographic coordinates on a map. The purposes of geocoding are:

• To recognize geographic patterns and trends from spatial data, such as crime rates,
population growth, or environmental changes.

• To manage customer data and target marketing strategies based on customer locations,
preferences, and behaviors.

• To analyze address data and plan for public services, infrastructure, and development
based on the distribution and density of addresses.

• To share geocoding functionality and enable distributed applications that use geocoded
data, such as navigation, routing, or geofencing.
B 7- What are the two types of intent
In Android, intents are messages that allow you to communicate with other components, such
as activities, services, or broadcast receivers. There are two types of intents: explicit and
implicit.

• Explicit intents specify the exact component that you want to start by providing its
class name. For example, you can use an explicit intent to start another activity within
your app or to start a service that you have defined.

• Implicit intents do not name a specific component, but instead declare a general
action that you want to perform. The system then matches your intent with the most
suitable component that can handle it. For example, you can use an implicit intent to
request a web page, take a photo, or share some data with other apps.
B 8- What are the different data storage options
available on the android platform
The Android platform provides several options for storing data on the device, depending on your
needs and preferences. Some of the common data storage options are:

• Shared preferences: This option allows you to store private primitive data in key-value
pairs. You can use this option to save simple settings or preferences for your app, such
as user name, theme, or language. You can access and modify the shared preferences
using the Jetpack Preferences library1.

• Internal storage: This option allows you to store app-specific files on the device
memory. You can use this option to save sensitive data that other apps should not
access, such as authentication tokens, passwords, or cached data. You can access and
manage the internal storage using the getFilesDir() or getCacheDir() methods2.

• External storage: This option allows you to store public files on the shared external
storage. You can use this option to save media, documents, or other files that your app
intends to share with other apps or the user. You can access and manipulate the
external storage using the MediaStore API3 or the Storage Access Framework4.

• SQLite database: This option allows you to store structured data in a private database
on the device. You can use this option to save complex or relational data, such as
contacts, messages, or transactions. You can create and query the SQLite database
using the Room persistence library5, which provides an abstraction layer over the raw
SQL queries.
B 9- Explain content provider in android
Content providers are components that manage access to a central repository of data on an
Android device. They can store data in various ways, such as in a SQLite database, in files, or on
a network. They can also share data with other applications securely and efficiently, using a
content URI to identify the data and a content resolver to communicate with the provider.

Some of the benefits of using content providers are:

• They offer granular control over the permissions for accessing data. You can choose to
restrict access to only a content provider that is within your application, grant blanket
permission to access data from other applications, or configure different permissions
for reading and writing data.

• They provide an abstraction layer that lets you make modifications to your data storage
implementation without affecting other applications that rely on access to your data.
For example, you can swap out a SQLite database for alternative storage, and only your
content provider is affected and not the applications that access it.

• They support different types of data, such as contacts, media, settings, or custom data.
You can use the built-in content providers that are provided by the Android framework,
or you can create your own content providers for your specific data needs.

To create a content provider, you need to extend the ContentProvider class and implement the
following methods:

• onCreate(): This method is called when the content provider is created. You can use this
method to initialize your data source, such as opening a database connection or
creating a file.

• query(): This method is called when an application requests to read data from the
content provider. You can use this method to execute a query on your data source and
return a Cursor object that contains the results.

• insert(): This method is called when an application requests to insert data into the
content provider. You can use this method to add a new row to your data source and
return a content URI that identifies the newly inserted row.

• update(): This method is called when an application requests to update data in the
content provider. You can use this method to modify one or more rows in your data
source and return the number of rows affected.

• delete(): This method is called when an application requests to delete data from the
content provider. You can use this method to remove one or more rows from your data
source and return the number of rows deleted.

• getType(): This method is called when an application requests to get the MIME type of
the data at a given content URI. You can use this method to return a string that describes
the type of data, such as “vnd.android.cursor.dir/vnd.example.contacts” for a directory
of contacts, or “vnd.android.cursor.item/vnd.example.contact” for a single contact.
B 10- What the features of sqlite (Week9)
SQLite is a software library that provides a relational database management system. It has
many features that make it popular among developers and users, such as:

• It is self-contained, which means it does not depend on any external libraries or files to
operate.

• It is serverless, which means it does not require a separate server process or system to
run.

• It is zero-configuration, which means it does not need any setup or administration to


use.

• It is transactional, which means it supports atomic, consistent, isolated, and durable


(ACID) operations on the data.

• It is cross-platform, which means it can run on various operating systems and devices,
such as Windows, Linux, Android, iOS, and more.

• It is small and fast, which means it has a low code footprint and high performance.

• It is full-featured, which means it supports most of the SQL standard and offers
advanced capabilities, such as partial indexes, JSON, common table expressions, and
window functions.

• It is flexible, which means it can store data in various formats, such as text, numbers,
blobs, or custom types.

• It is embeddable, which means it can be integrated into other applications and


languages, such as C, Java, Python, and more.
B 11- Explain how to send email in android
application (Week 11 – Unit4)
To send an email in an Android application, you can use an Intent with the action as
Intent.ACTION_SEND. This will allow you to launch an email app that can handle your email
data, such as the recipient, subject, and body. You can also specify the type of the intent as
“message/rfc822” to filter out the apps that can send emails. Here is an example of how to
create and start such an intent:

// Create a new intent with the action as Intent.ACTION_SEND

Intent emailIntent = new Intent(Intent.ACTION_SEND);

// Set the type of the intent as "message/rfc822"

emailIntent.setType("message/rfc822");

// Put the email data as extras

emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{"example@gmail.com"}); // The


recipient email address

emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Hello from Android"); // The email subject

emailIntent.putExtra(Intent.EXTRA_TEXT, "This is a test email from my Android app"); // The


email body

// Start the intent with a chooser to let the user select an email app

startActivity(Intent.createChooser(emailIntent, "Send email..."));


B 12- Explain location based services (Week 13 –
Unit5)
Location-based services (LBS) are software services that use geographic data and information
to provide services or information to users. LBS can be used in various contexts, such as health,
entertainment, work, personal life, etc. Some examples of LBS are:

• Navigation software that guides users to their destinations using GPS and maps.

• Social networking services that allow users to share their locations, check in to places,
and find nearby friends or events.

• Location-based advertising that delivers personalized and relevant ads to users based
on their locations and preferences.

• Tracking systems that monitor and locate assets, vehicles, or people using geofences,
RFID, or other technologies.

LBS are made possible by technological developments such as the World Wide Web, satellite
navigation systems, and the widespread use of mobile devices. LBS rely on three main
components: localization, service provision, and communication. Localization is the process of
determining the location of a user or a device using various methods, such as GPS, Wi-Fi,
cellular networks, or sensors. Service provision is the process of delivering the desired service
or information to the user based on their location and request. Communication is the process of
transmitting the location data and the service or information between the user and the provider
using various channels, such as the Internet, SMS, or Bluetooth.
B 13- What are the purpose of geocoding in android
(Week 14 – Unit5)
Geocoding is the process of converting a text-based address or location description into
geographic coordinates, such as latitude and longitude. It allows developers to integrate
location-based features into their Android apps, such as finding addresses, displaying maps,
and tracking user locations.

Geocoding in Android is currently implemented using the Geocoder class, which is part of the
android.location package. This class provides methods to perform geocoding and reverse
geocoding operations, using either a built-in service or a third-party service, depending on the
device and the availability of the network. The Geocoder class was introduced in Android 1.5
(Cupcake) and has been updated and improved in subsequent versions.

The standard for geocoding in Android is maintained by the Android Open Source Project
(AOSP), which is a collaborative project led by Google that develops and distributes the Android
platform. The AOSP provides the source code and documentation for the Geocoder class and
other location-related components. The AOSP also welcomes contributions from developers
and partners who want to improve the Android platform.

You might also like