Note Taking
Note Taking
Roll no. 03
Among all the components Linux Kernel provides main functionality of operating system
functions to smartphones and Dalvik Virtual Machine (DVM) provide platform for running an
android application.
The main components of android architecture are following:-
Applications, Application Framework, Android Runtime, Platform Libraries and Linux Kernel.
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.
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 di erent types of services activity manager, noti cation manager, view system,
package manager etc. which are helpful for the development of our application according
to the prerequisite.
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) is a register-based virtual
machine and specially designed and optimised for android to ensure that a device can run
multiple instances e ciently. 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.
Platform 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.
Media library provides support to play and record an audio and video formats.
Web-Kit This open source web browser engine provides all the functionality to display web
content and to simplify page loading.
SSL (Secure Sockets Layer) is security technology to establish an encrypted link between a
web server and a web browser.
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.
The Linux Kernel will provide an abstraction layer between the device hardware and the
other components of android architecture. It is responsible for management of memory,
power, devices etc.
The features of Linux kernel are:
Security: The Linux kernel handles the security between the application and the system.
Memory Management: It e ciently handles the memory management thereby providing the
freedom to develop our apps.
Driver Model: It ensures that the application works properly on the device and hardware
manufacturers responsible for building their drivers into the Linux build.
There are following four main components that can be used within an Android application.
Activities: It Control the UI and handle the user interaction to the Android App screen, it
represents a single screen with a user interface.Activity performs actions on the screen, For
example, Medium application might have one activity that shows a list of articles while
another activity to read the Noti cations and another activity for viewing user pro le.
Services: The Service is another building block of Android applications. They handle
background running tasks associated with an application. It is a program that can run in the
background for an in nite period and it does not provide a UI. A good example of service is
the music player app, let us consider Google play Music which keep on playing music while
the main android app activity is destroyed or closed.
Implicit Intent speci es an action that can be invoked by any app on the device which
enables us to perform an action. It does not have exact knowledge about the landing
component. It can open another app or its own app’s component and many other options
exist. Examples: Downloaded song, PDF, image, document, dial call, map location, etc.
Explicit Intent speci es the component in an app. It is one that we use to launch a speci c
app component, such as a particular activity or service in our application. Using this intent
we can pass the data from one activity to another activity.
Examples: startActivity (know about which activity will start), start service to download the
le.
Q6. List Types of Layouts. Explain Table Layout & Grid Layout in detail.
-> A layout de nes the structure for a user interface in your app, such as in an activity. All
elements in the layout are built using a hierarchy of view and viewGroup objects. A view
usually draws something the user can see and interact with. Whereas a viewGroup is an
invisible container that de nes the layout structure for view and other viewGroup objects.
Linear Layout: Linear Layout is a view group that aligns all children in a single direction,
vertically or horizontally.
Relative Layout: Relative Layout is a view group that displays child views in relative
positions.
Table Layout: Table Layout is a view that groups views into rows and columns.
Absolute Layout: Absolute Layout enables you to specify the exact location of its children.
Frame Layout: Frame Layout is a placeholder on screen that you can use to display a single
view.
Grid View/Layout is a view group that displays items in a two-dimensional, scrollable grid
i.e., (rows and columns)
Q7. Explain view, view group and layouts: Linear Layout, Constraint Layout and Frame
Layout in detail.
-> View:- A View is a simple building block of a user interface. It is a small rectangular box
that can be TextView, EditText, or even a button. It occupies the area on the screen in a
rectangular area and is responsible for drawing and event handling.
Layout:- Layout basically refers to the arrangement of elements on a page these elements
are likely to be images, texts or styles. They de ne the structure of android user interface in
the app, like in an activity. All elements in the layout are built with the help of Views and
ViewGroups.
Linear Layout:- This layout is used to place the elements in a linear manner. A Linear
manner means one element per line. This layout creates various kinds of forms on Android.
In this, arrangement of the elements is in a top to bottom manner.
Linear layout can have two orientations:- Vertical Orientation and Horizontal Orientation.
Vertical Orientation:- It is shown above where the widgets such as TextViews, and all in a
vertical manner.
Horizontal Orientation:- It is shown above where the widgets such as TextViews, and all in a
horizontal manner.
Constraint Layout:- Constraint Layout is a ViewGroup (i.e. a view that holds other views)
which allows to create large and complex layouts with a at view hierarchy, and also allows
to position and size widgets in a very exible way. ConstraintLayout is very similar to
RelativeLayout because, views are laid out according to relationships between sibling views
and the parent layout.
Frame Layout:- Frame Layout is one of the simplest layout to organise view controls. They
are designed to block an area on the screen. Frame Layout is used to hold child view,
because it can be di cult to display single views at a speci c area on the screen without
overlapping each other.
ffi
fl
fi
fl
fi
•