Mad Imp
Mad Imp
Chapter 1
Q.1. Features of Android Operating System [2M]
Features of Android Operating System:
1)Storage
2)Multitasking
3)Web Browser
4)Open Source
5)Accessibility
6)Media Support
7)Streaming Media Support
8)Voice Based Features
9)Multitouch
10)External Storage
11)Video Calling
12)Handset Layout
13)Google cloud Messaging
14)WiFi Direct
The OHA is the group that is in charge of the Android smartphones operating system.
It was created by Google. The Open Handset Alliance (OHA) is consortium of
multiple companies like Samsung, Sony, Intel and many more to provide services and
deploy handsets using android platform. The Open Handset Alliance (OHA) is an
association whose goal is to develop open standards for mobile devices, promote
innovation in mobile phones and provide a better experience for consumers at a lower
cost.
Q.7. Explain the need of Android Operating System. Also describe any four features
of android.
1. Low Development Cost: Developers can access tools like the Android SDK
and Eclipse IDE for free, making it affordable to create Android apps.
2. Open Source: Android is based on the open-source Linux kernel, allowing
developers to modify and improve the platform to build apps that work on
Android devices.
3. Supports Many Devices: Android works on a wide range of devices,
including various smartphones and tablets. Developers can create apps on
different operating systems like Windows, Mac, or Linux.
4. Wide Carrier Support: Many telecom companies around the world support
Android-powered phones, including Airtel, Vodafone, and AT&T.
5. Open Distribution: The Google Play Store has few restrictions on apps,
allowing developers to distribute their apps easily through it and other
platforms like Amazon’s app store.
1) Applications
• Applications is the top layer of android architecture.
• The pre-installed applications like home, contacts, camera, gallery etc. and
third party applications downloaded from the play store like chat
applications, games etc. will be installed on this layer only.
• It runs within the Android run time with the help of the classes and
services provided by the application framework.
2) Application Framework
• Application Framework provides several important classes which are used
to create an Android application.
• It provides a generic abstraction for hardware access and also helps in
managing the user interface with application resources.
• Generally, it provides the services with the help of which we can create a
particular class and make that class helpful for the Applications creation.
• It includes different types of services activity manager, notification
manager, view system, package manager etc. which are helpful for the
development of our application according to the prerequisite.
3) Application Runtime
• Android Runtime environment is one of the most important part of
Android. It contains components like core libraries and the Dalvik virtual
machine (DVM).
• Mainly, it provides the base for the application framework and powers our
application with the help of the core libraries. Like Java Virtual Machine
(JVM)
• Dalvik virtual machine (DVM) it is a register based machine that converts
byte code into dex code and ensures that app can run multiple instances
efficiently.
• It depends on the layer Linux kernel for threading and low-level memory
management. The core libraries enable us to implement android
applications using the standard JAVA or Kotlin programming languages.
4) Libraries
• The Platform Libraries includes various C/C++ core libraries and Java
based libraries such as Media, Graphics, Surface Manager, OpenGL etc. to
provide a support for android development.
o Media library provides support to play and record an audio and video
formats.
o Surface manager responsible for managing access to the display
subsystem.
o SGL and OpenGL both cross-language, cross-platform application
program interface (API) are used for 2D and 3D computer graphics.
o SQLite provides database support and FreeType provides font
support.
o Web-Kit This open source web browser engine provides all the
functionality to display web content and to simplify page loading.
o SSL (Secure Sockets Layer) is security technology to establish an
encrypted link between a web server and a web browser.
5) Linux Kernel
• Linux Kernel is heart of the android architecture. It manages all the
available drivers such as display drivers, camera drivers, Bluetooth drivers,
audio drivers, memory drivers, etc. which are required during the runtime.
• It is responsible for management of memory, power, devices etc. The
features of Linux kernel are:
o Security: The Linux kernel handles the security between the
application and the system.
o Memory Management: It efficiently handles the memory
management thereby providing the freedom to develop our apps.
o Process Management: It manages the process well, allocates
resources to processes whenever they need them.
o Network Stack: It effectively handles the network communication.
o Driver Model: It ensures that the application works properly on the
device and hardware manufacturers responsible for building their
drivers into the Linux build.
Chapter 2
Q.10. List any four folders from directory structure of Android project and elaborate
in one line. [2M]
1) App: The App folder contains three subfolders (manifests, java and res) that make
up our application.
2) Manifest: This is where we would put our manifest files. Most Android apps have
single manifest file
3) Java: This is the folder in our project where we will be storing all of the source
code files written in Java programming language.
4) Drawable: The drawable folder contains graphics that can be drawn to the screen.
5) Res: This folder helps to separate and sort the resources of our applications.
1. The javac compiler turns the Java source files into class files.
2. The dx tool combines all the class files into one .dex file, which is used by
Android.
3. The Android Assets Packaging Tool (aapt) packages everything together
and creates a file with the .apk extension.
4. An APK file includes all the app's code, resources, assets, certificates, and a
manifest file, which tells Android how to run the app.
Q.15. Write down the steps to install and configure Android studio. [4 M]
Steps to Install and Configure Android Studio
Step 1:
Go to Android Studio Download Page (https://developer.android.com/android-
studio/download ) to get the installer.
Step 2:
Step 3:
Once the download is finished:
Step 4:
The installation will begin. Wait for it to complete.
Step 5:
When the installation is finished, click "Finish."
• If you had a previous version of Android Studio, it will ask if you want to
import settings. Choose "Don't import settings" and click "OK."
Step 6:
Android Studio will start and find the required SDK components.
Step 7:
After finding the SDK components, you'll see the Welcome dialog box.
Step 8:
Now, download the SDK components by clicking "Finish." Let it complete the
download. Your Android Studio is now configured!
Step 9:
To start building a new app, click on "Start a new Android Studio project."
Q.16. Explain features of Android SDK. [4 M W-22]
The Android SDK is a set of libraries and tools needed to create Android apps.
When Google updates Android, they also release a new SDK with new features.
The SDK makes it easier to develop and test apps. It works on Windows, Linux,
and macOS.
Important features:
1. Android Tool:
o Manages Android Virtual Devices (AVDs) and SDK components.
2. Emulator Tool:
o Let’s you test apps without using a real phone.
3. Dalvik Debug Monitor Server (DDMS):
o Helps in finding and fixing problems (debugging) in Android apps.
4. Android Debug Bridge (ADB):
o A command-line tool that helps connect and control real devices or
emulators from your computer.
The Dalvik Virtual Machine (DVM) is a special virtual machine made for Android
phones. It is designed to use less memory, work fast, and save battery — which
are very important for mobile devices.
The Java source code is first changed into class files using the javac tool. Then, a
tool called dx combines all these class files into one .dex file (Dalvik Executable
file) that can run on the Dalvik VM. Another tool called aapt helps in packing the
app for installation.
[instead of the above 2 para write the answers of Q.9 & 11]
Importance of Dalvik VM
• Efficient Resource Use: By being lightweight and optimized, Dalvik allows
Android apps to use system resources efficiently.
• Compatibility: It maintains compatibility across different Android devices,
enabling a wide range of applications to run.
• Foundation for Android: DVM was the original virtual machine for Android
(before ART was introduced), and it played a crucial role in the early success
of Android apps.
Chapter 3
Q.18. Explain with example, code to create GUI using absolute layout (Assume
suitable data). [4 M S-22]
• Absolute layout means components are positioned in the fixed coordinates
• You use null layout and setBounds() to define location and size.
• This gives complete control over layout, but doesn’t adapt to different screen
sizes or resolutions.
• Example Code:
<AbsoluteLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<TextView
android:layout_x="110px"
android:layout_y="110px"
android:text="User Name"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<EditText
android:layout_x="250px"
android:layout_y="80px"
android:layout_width="200dp"
android:layout_height="wrap_content" />
<TextView
android:layout_x="110px"
android:layout_y="200px"
android:text="Password"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<EditText
android:layout_x="250px"
android:layout_y="150px"
android:layout_width="200dp"
android:layout_height="wrap_content" />
<Button
android:layout_x="300px"
android:layout_y="300px"
android:text="Log In"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</AbsoluteLayout>
1. Views:
• The basic building block in Android UI is a View. It is a rectangular area
on the screen responsible for drawing and handling user interactions.
• Examples include buttons, text boxes, labels. All UI controls are derived
from the View class.
2. View Groups:
• A View Group is a container that holds multiple Views or other View
Groups, helping organize the layout.
• Examples are LinearLayout, FrameLayout. They define how child Views
are arranged on the screen.
3. Fragments:
• Fragments are reusable parts of a user interface within an Activity.
• They help in designing flexible UI, especially for different screen sizes,
and contain their own layout and input handling.
4. Activities:
• An Activity represents a single screen or page in an app.
• It controls what the user sees and interacts with, similar to a window or
form in desktop applications.
• Linear Layout
• Absolute Layout
• Frame Layout
• Table Layout
• Relative Layout
App/
│── Manifest/
│ ├── AndroidManifest.xml
│── Java/
│ ├── Java files(MainActivity.java)
│── res/
│ ├── drawable folder
│ ├── layout folder
│ ├── mipmap folder
│ ├── values folder
│── Gradle Scripts folder/
An Android project has different folders that organize the app's files:
1. Manifests Folder
- Contains AndroidManifest.xml.
- It tells Android about your app, like its name, version, and components such as
activities and services.
- Acts as a bridge between Android OS and your app.
2. Java Folder
- Contains Java (or Kotlin) code files like MainActivity.java.
- These are the instructions for your app, such as what happens when a button is
clicked.
4. Gradle Scripts
- Files that help build and organize your app automatically, setting rules for
compiling and packaging your app.
Chapter 4
Q.24. State syntax to create Text View and Image button with any two attributes
of each. [4 M]
TextView
Syntax:
xml
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World"
android:textColor="#FF0000" />
Two attributes:
ImageButton
Syntax:
xml
<ImageButton
android:id="@+id/imageButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/my_image" />
Two attributes:
Q.29. Describe Android service life cycle along with diagram. [4M] (S-22)
A service in Android runs in the background without direct interaction with the user.
It can perform tasks like downloads, data processing, or checking for updates.
Types of Services:
1. onCreate()
4. onUnbind()
5. onRebind()
6. onDestroy()
Q.30. Describe multimedia framework of Android with diagram. [4M] (S-23, S-22)
• The system helps Android apps play audio and video smoothly.
• It includes:
o Multimedia Applications: Apps that use media (like music or videos).
o Framework: The layer that manages media data.
o OpenCore engine: Handles media processing.
o Hardware Abstraction: Connects software to hardware like speakers and
cameras.
• The framework uses core libraries (like libmedia, libmediajni) that communicate
with the Media Server via JNI (Java Native Interface).
• The Media Server manages actual media operations, creating services based on
the app’s requests.
• Communication between the app and Media Server is like a client/server model.
How Video/Audio Data Works
Layout (activity_main.xml):
xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/myButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Move Me"
android:layout_centerInParent="true"/>
</RelativeLayout>
2. Java Code (MainActivity.java):
java
import android.os.Bundle;
import android.view.View;
import android.animation.ObjectAnimator;
import androidx.appcompat.app.AppCompatActivity;
Button myButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myButton = findViewById(R.id.myButton);
// Animate the button to move 300 pixels right over 1 second when clicked
myButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ObjectAnimator animation = ObjectAnimator.ofFloat(myButton,
"translationX", 0f, 300f);
animation.setDuration(1000); // 1 second
animation.start();
}
});
}
}
Q.37. Describe the process of getting the map API key. (S-23 4 Marks)
1. Browse the site on your browser. https://console.developers.google.com/project
2. Login with your google account.
3. Create a new project by clicking on Create Project option.
4. Add your project name and organization name in the fields present on the screen.
5. Now click on APIs and Services.
6. Enable APIs and services.
7. Select Google maps Android API
8. To create an API key for Maps click on Create credentials option and then select the
API key option
1. Install-time permissions
3. Special permissions
In brief:
Q.41. Explain the procedure of Geo-coding and reverse Geo-coding. (W-22 4 Marks)
Geocoding Procedure
1. Input Address: User provides a place name or street address.
2. Send Request: The app sends this address to a geocoding service (like Google
Maps API).
3. Processing: The service converts the address into latitude and longitude
coordinates.
4. Receive Data: The app receives the coordinates and can use them for mapping or
other purposes.
Q.42. Describe the process of getting the map API key. (S-23 4 Marks)
The API key is a unique identifier that authenticates requests associated with your
project for usage and billing purposes. You must have at least one API key associated
with your project.
1. Browse the site on your browser. https://console.developers.google.com/project
2. Login with your google account.
3. Create a new project by clicking on Create Project option.
4. Add your project name and organization name in the fields present on the screen.
5. Now click on APIs and Services.
6. Enable APIs and services.
7. Select Google maps Android API
8. To create an API key for Maps click on Create credentials option and then select the
API key option
Click on the API key option to generate your API key. After clicking on this option
your API key will be generated
Q.43. i) Describe all steps in application deployment on google play store. (S-23 4
Marks) (S-22 4 Marks)
ii) Write steps for customized permissions. (W-23 6 Marks)
1. App Signing
o Every Android app (APK file) must be signed with a certificate.
o This certificate identifies the app’s author and is usually self-signed.
o App signing helps Android know who developed the app.
2. Unique User ID (UID)
o When an app is installed, Android gives it a unique user ID (UID).
o This UID helps Android manage file access and security for that app.
o The UID remains the same for that app on that device.
3. Defining Custom Permission
o You must define your custom permission in the AndroidManifest.xml
file using the <permission> tag.
o Example:
xml
CopyEdit
<permission
android:name="com.example.myapp.permission.DEADLY_ACTIVITY"
android:label="Deadly Activity"
android:description="Allows access to deadly activity"
android:protectionLevel="dangerous" />
xml
CopyEdit
<activity android:name=".DeadlyActivity"
android:permission="com.example.myapp.permission.DEADLY_ACTI
VITY" />
Q.44.