0% found this document useful (0 votes)
21 views6 pages

Android RD

Uploaded by

Rahul Jadhaw
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)
21 views6 pages

Android RD

Uploaded by

Rahul Jadhaw
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/ 6

EXPERIMENT NO 1

Aim / Title: Introduction to Android

Objectives: Student should get the knowledge of android operating system background.

Outcomes: Student will be aware of the android operating system.

Pre-requisite : Java, Object Oriented Programming, APIs, Databases

Hardware requirements: A 64-bit environment, At least 250GB of free disk space, Memory
of 4 GB RAM or more

Software requirements: Android SDK tools 22.0.5, Java Runtime Environment 1.6, Java
SE JDK v6.0, Android Studio

Theory:

Android Architecture

Android operating system is a stack of software components which is roughly divided into
five sections and four main layers as shown below in the architecture diagram

Linux kernel
At the bottom of the layers is Linux - Linux 2.6 with approximately 115 patches. This
provides basic system functionality like process management, memory management, device
management like camera, keypad, display etc. Also, the kernel handles all the things that
Linux is really good at such as networking and a vast array of device drivers, which take the
pain out of interfacing to peripheral hardware.

Libraries

On top of Linux kernel there is a set of libraries including open-source Web browser engine
WebKit, well known library libc, SQLite database which is a useful repository for storage
and sharing of application data, libraries to play and record audio and video, SSL libraries
responsible for Internet security etc.

Android Runtime

This is the third section of the architecture and available on the second layer from the
bottom. This section provides a key component called Dalvik Virtual Machine which is
a kind of Java Virtual Machine specially designed and optimized for Android.

The Dalvik VM makes use of Linux core features like memory management and
multi-threading, which is intrinsic in the Java language. The Dalvik VM enables
every
Android application to run in its own process, with its own instance of the Dalvik virtual
machine.

The Android runtime also provides a set of core libraries which enable Android application
developers to write Android applications using standard Java programming language.

Application Framework

The Application Framework layer provides many higher-level services to applications in


the form of Java classes. Application developers are allowed to make use of these services
in their applications.

Applications

You will find all the Android application at the top layer. You will write your application
to be installed on this layer only. Examples of such applications are Contacts Books,
Browser, Games etc.
Android UI

An Android application user interface is everything that the user can see and interact with.
You have learned about the various layouts that you can use to position your views in
an activity. This chapter will give you detail on various views.

A View is an object that draws something on the screen that the user can interact with and
a ViewGroupis an object that holds other View (and ViewGroup) objects in order to
define the layout of the user interface.

Android UI Controls

There are number of UI controls provided by Android that allow you to build the graphical
user interface for your app

S.
UI Control & Description
N.
TextView
1
This control is used to display text to the user.
EditText
2
EditText is a predefined subclass of TextView that includes rich editing capabilities.
AutoCompleteTextView
3 The AutoCompleteTextView is a view that is similar to EditText, except that it shows a
list of completion suggestions automatically while the user is typing.
Button
4
A push-button that can be pressed, or clicked, by the user to perform an action.
ImageButton
5
AbsoluteLayout enables you to specify the exact location of its children.
CheckBox
6 An on/off switch that can be toggled by the user. You should use checkboxes
when presenting users with a group of selectable options that are not mutually
exclusive.
ToggleButton
7
An on/off button with a light indicator.
RadioButton
8
The RadioButton has two states: either checked or unchecked.
RadioGroup
9
A RadioGroup is used to group together one or more RadioButtons.

ProgressBar
10 The ProgressBar view provides visual feedback about some ongoing tasks, such as when
you are performing a task in the background.
Spinner
11
A drop-down list that allows users to select one value from a set.
TimePicker
12 The TimePicker view enables users to select a time of the day, in either 24-hour mode or
AM/PM mode.
DatePicker
13
The DatePicker view enables users to select a date of the day.

Android Event Handling

Events are a useful way to collect data about a user's interaction with interactive components
of your app, like button presses or screen touch etc. The Android framework maintains an
event queue into which events are placed as they occur and then each event is removed from
the queue on a first-in, first-out (FIFO) basis. You can capture these events in your program
and take appropriate action as per requirements.

There are following three concepts related to Android Event Management:

• Event Listeners: The View class is mainly involved in building up a Android GUI,
same View class provides a number of Event Listeners. The Event Listener is the object
that receives notification when an event happen.

• Event Listeners Registration: Event Registration is the process by which an


Event Handler gets registered with an Event Listener so that the handler is called when the
Event Listener fires the event.

• Event Handlers: When an event happens and we have registered and event listener
to the event, the event listener calls the Event Handlers, which is the method that actually
handles the event.
Event Listeners & Event Handlers

Event Handler Event Listener & Description

onClick() OnClickListener()
This is called when the user either clicks or touches or focuses upon any
widget like button, text, image etc. You will use onClick() event handler
to handle such event.
onLongClick() OnLongClickListener()
This is called when the user either clicks or touches or focuses upon any
widget like button, text, image etc. for one or more seconds. You will
use onLongClick() event handler to handle such event.

onFocusChange() OnFocusChangeListener()
This is called when the widget looses its focus ie. user goes away from
the view item. You will use onFocusChange() event handler to handle
such event.
onKey() OnFocusChangeListener()
This is called when the user is focused on the item and presses or releases
a hardware key on the device. You will use onKey() event handler to
handle such event.
onTouch() OnTouchListener()
This is called when the user presses the key, releases the key, or any
movement gesture on the screen. You will use onTouch() event handler to
handle such event.
onMenuItemClick() OnMenuItemClickListener()
This is called when the user selects a menu item. You will use
onMenuItemClick() event handler to handle such event.
Conclusion:

Sample Viva Questions and

Answers: Q1. What is Kernal ?

Q2. What are the features of Android?

Q3. What does SDK do in IDE?

Roll Name of Date of Date of Grade Sign of Sign of


No. Student Performance Evaluation Student Faculty
0818IT Rahul Jadhaw
211048

You might also like