100% found this document useful (1 vote)
3K views43 pages

S6-Mobile Application Development - Android Full Note

This document provides an introduction to the Android mobile operating system. It discusses the history and founding of Android, the structure of the Android ecosystem including key stakeholders, features of Android like its open source nature and customizability. It also outlines the major versions of Android released from 1.0 to the current version 11, describing new features and changes in each release. Finally, it discusses the architecture of Android including its layers, use of Java and C/C++, and the Dalvik virtual machine.

Uploaded by

itsmeradhu02
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
3K views43 pages

S6-Mobile Application Development - Android Full Note

This document provides an introduction to the Android mobile operating system. It discusses the history and founding of Android, the structure of the Android ecosystem including key stakeholders, features of Android like its open source nature and customizability. It also outlines the major versions of Android released from 1.0 to the current version 11, describing new features and changes in each release. Finally, it discusses the architecture of Android including its layers, use of Java and C/C++, and the Dalvik virtual machine.

Uploaded by

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

S6-Mobile Application Development – Android

Module 1

#Introduction to Android:-Operating Systems have developed a lot in last 15 years.


-It started from black and white phones to smart phones or mini computers.
-Nowadays one of the most widely used mobile OS is ANDROID.
-Android Inc was founded in Palo Alto of California, U.S. by Andy Rubin, Rich Miner,
Nick Sears and Chris White during 2003.
-After that it was acquired by Google in 2005.
-Android is a stack of software for mobile devices that are
an Operating System, Middleware and Key Applications.
-Android is a Linux-based operating system which is designed
for touchscreen mobile devices like smartphones and
tablet computers.
-It is an open source technology that allows the software
to be freely modified.
-Android was unveiled during 2007 along with the founding of the Open Handset Alliance.
->What is "Open Handset Alliance”:-Open Handset Alliance (OHA) was formed in
November 2007.
-The OHA is the group that is in charge of the Android smartphones operating system.
-it was created by Google.
-The members of OHA include handset manufactures, chip makers, commercialization
companies, software companies, and mobile operators.
-fig

*Android Ecosystem (5 types)


1. Consumers:- are the stakeholders that own Android devices.
2. Google:- It develops Android.
3. OEMs (Original Equipment Manufacturers): They manufacture the hardware, and as
well the custom application components.
4. Application Development Companies: They are the major contributors to the
ecosystem and employ Android developers
5. Freelance Android developers: Developers have the skill-set to contribute to the
ecosystem for Android development, they are who create their own applications,
and publish them on Google playstore.
*why android:-The Android browser is one of the best browsers on the mobile market.
-It generally loads pages faster than Safari or any other browser
-fast Connectivity
eg; Turn on/off Bluetooth, Turn on/off WiFi ,Turn on/off mobile network.
-Multi-Notification.
-The Android cell phone allows client to configuration their mobile to look and behave
exactly like they want.
-Customizable operating system.
-variety of apps can be developed.
-Reduces the overall complexity.
-Android has an android market. The Android apps are free and work as well.
-The Android has inbuilt google support.
e.g., Google map, gmail etc.
-powerful open source.

#Android Versions:-The development of the Android operating system was started in


2003 by Android, Inc. Later on,
-It was purchased by Google in 2005.
-The beta version of Android OS was released on November 5, 2007,
-while the software development kit (SDK) was released on November 12, 2007.
-fig
1. Android Version 1.0 :- Android officially publish its Android version 1.0 in September
2008
-It is the initial version of Android operating system.
-This version contains Google Calendar, Google Maps, Google Search, Media player,
Notifications appear in the status bar, wallpaper, YouTube video player, Alarm Clock,
Calculator, Dialer, Pictures (Gallery), Wi-Fi and Bluetooth support

2. Android version 1.5: Cupcake :- the Android updated to 1.5 with the codename of
the dessert item (Cupcake).
-It supports third-party virtual keyboard, Video recording and playback in MPEG-4
and mp3 format, Copy and paste feature, auto-rotation option, ability to upload a
video to YouTube, check phone usage history.
3. Android version 1.6: Donut :- Android 1.6 was released with the name Donut.
-It contains numerous new features such as voice and text entry search, bookmark
history, contacts, faster camera access, user can select multiple photos for deletion,
support text-to-speech engine.
4. Android version 2.0 to 2.1: Eclair :- Android 2.0 was released, whose codename was
Eclair.
-It contains the several new features as change wallpaper ,new camera
features,digital zoom, colour effects ,Bluetooth 2.1,delete the oldest message
automatically when the defined limit is reached, bug fixes.
5. Android version 2.2 Froyo :- It contains several features as speed, memory,
performance optimization.
-voice dialing, contact sharing over Bluetooth,security updates,
6. Android version 2.3 Gingerbread :- the Android 2.3 (Gingerbread) was released.
-It includes the following changes: support for extra-large screen size and
resolutions, enhanced copy/paste functionality, select a word by press-holding, new
Download Manager.
7. Android version 3.0 Honeycomb :- Android 3.0 (Honeycomb) was launched for the
first Android based tablet.
-redesign the keyboard making fast typing, quick access to camera, connectivity for
USB accessories, support for joysticks and gamepads, Google Books, fixed data
connectivity issues when coming out of Airplane mode.
-it improve multitasking.
8. Android version 4.0 Ice Cream Sandwich :- Android 4.0.1 (Ice Cream Sandwich) was
launched.
-t introduces the numerous new features: screenshot capture, improved copy and
paste functionality, build-in photo editor, fixed minor bugs, spell-checking, better
camera performance.
-it include 1080p recording.
9. Android version 4.1 Jelly Bean :- It updates to following features: smoother user
interface, lock screen improvement, new clock application, volume for incoming call,
4K resolution support,
10. Android version 4.4 KitKat :- Google announced Android 4.4 (KitKat).
- Initially, its code name was "Key Lime Pie".
-The minimum required amount of RAM should available to Android is 340 MB.
-The other devices with less than 512 MB of RAM must report themselves as "low
RAM" devices.
- It includes several new features ; wireless printing capability, built-in screen
recording feature,
11. Android version 5.0 Lollipop :- Lollipop provides several features like support for 64-
bit CPUs, battery life improvement, multiple user accounts,, join Wi-Fi networks,
support for multiple SIM cards, device protection,
12. Android version 6.0 Marshmallow :-Android lunches "Marshmallow" for all android
devices.
-It contains the various new features as , introduce the Doze mode to save battery
life, fingerprint reader support,, USB-C support, emoji support.
13. Android version 7.0 Nougat :- Its initial codename was "Android N".
- file-based encryption, zoom in the screen, new Data Saver mode, 75 percent faster
app installation, circular app icons support, send GIFs directly from the default
keyboard, battery usage alerts.
14. Android version 8.0 Oreo:- notification dots, 2 times faster boot time, Google Play
Protect, Android Oreo Go Edition, dark themes.
15. Android version 9.0: Pie :- The clock has moved to the left of the notification bar, the
"screenshot" button has been added, battery percentage always shown on display.
16. Android version 10 :- is the tenth extensive version of the Android operating system.
-Android 10 has developed under the codename "Android Q".
-It contains features like new permissions to access location in the background,
support for biometric authentication.
17. Android 11 :- operating system is the eleventh big release of Android.
-It is the 18th version of Android mobile OS, which was released on 8 September
2020.
-The alphabetic naming system of Android, based on deserts, was stopped since
Android 10. So therefore, this operating system has branded with "Android 11".
*Android Activity:-

*Android Features and Architecture:- Android is an open source and Linux-


based Operating System for mobile devices such as smartphones and tablet computers.
-Android was developed by the Open Handset Alliance, led by Google, and other companies.
->features
● Open Source:- Android is an open source for mobile devices such as smartphones
and tablet computers.
-This way that the source code for Android is open to the public.
-This way that anyone can work on the operating system, not only one company
developers.
-Therefore app developers for Android devices are able to implement extra features
of their apps, due to the access to the source code.
● Storage:- SQLite, is used for data storage purposes.
● Media support: Android supports the following audio/video/still media formats:
WebM, H.263, H.264, AAC, HE-AAC (in 3GP or MP4 container), MPEG-4 SP, AMR,
AMR-WB in 3GP container), MP3, JPEG, PNG, GIF, BMP, WebP,etc..
● Multitouch:- Android has native support for multi-touch which was initially made
available in handsets such as the HTC Hero. -These features was originally disabled.
-Google has released an update version , which enables multi-touch natively.
● Video calling:- thanna ezhuthukaaa
● Multi-tasking:-User can jump from one task to another and same time various
application can run simultaneously.
● Accessibility: Built in text to speech is provided by Talk back for people with low or
no vision.
● Voice based features: Google search through voice has been available since opening
release. Voice activities for navigation, calling, texting, etc.
● External storage: Most Android devices include microSD slot. -and can read microSD
cards formatted with FAT32, Ext3
or Ext4 file system. (Bakki ezhuthikkonam)
● Messaging:-SMS and MMS.

->Architecture:-Mostly Android has the following layers (5 layers);


-When we are having blue colour in architecture applications and framework it is written
in Java, (execute in Dalvik).
-When the colour is yellow then it goes
to c and C# code libraries. It we want
to communicate between java application
and C,
-If the colour is dark grey then it is developed,
which executes a virtual machine
whose name is dalvik virtual machine, native
libraries, daemons and services
(written in C or C++).
-If the color is light grey it means it is a linear kernel which includes drivers for hardware,
networking, file system access and inter-process communication.
(“colour important allaaa”)
● Applications:-All applications in the Application layer are written using Java
Language.
-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.
-The applications that an android device provide includes
• SMS programs • Maps • Browser • Calender • Contacts
• Games etc
● Application framework:-On the top of Native libraries and android runtime, there is
android 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.
-The Android framework includes the following key services ;
1. Activity Manager − Controls all aspects of the application lifecycle and activity
stack.
2. Window manager- organizes the screen layout and locates the drawing
surface and performs other window related jobs.
3. Content Providers − Allows applications to publish and share data with other
applications.
4. Notifications Manager − Allows applications to display alerts and
notifications to the user.
5. Package Manager- manages the other packages in the system.
6. Telephony Manager- to handle the receiver call or voice calls.
7. Location Manager-helps to locate the mobile device.example-GPS.
8. XMPP Service Manager-Services like music,ringtone,browser etc managed
here.
● Linux kernel:-The basic layer is the Linux kernel.
-The entire Android OS is built on top of the Linux 2.6 Kernel with architectural
changes made by Google.
-Offers better security and networking.
-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.
-It is responsible for management of memory, power, devices etc.
-Following are the drivers: • Display drivers • Camera Drivers • Bluetooth driver •
Usb Driver • Keypad driver • Wifi driver etc..
● Libraries:-Written in C and C++ libraries.
-it provide a support for android development.
- major components of library are;
1. Media library provides support to play and record an audio and video
formats.
2. SQLite provides database support.
3. FreeType provides font support.
4. Web-Kit This open source web browser engine provides all the functionality
to display web content
5. SSL (Secure Sockets Layer) is security technology to establish an encrypted
link between a web server and a web browser.
● 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).
-it is responsible to run android application.
-DVM is like (Java Virtual Machine) JVM but it is optimized for mobile devices. It
consumes less memory and provides fast performance.
Android runtime= DVM + Core Java Libraries
->DVM (Dalvik virtual Machine):- it is a type of JVM used in android
devices to run apps and is optimized for low processing power and low
memory environment.
-it allow memory management, security,isolation, it is also developed by
Dan Bornstein of Google.
->Core libraries:-these are different from Java SE and Java ME libraries. But
these libraries provide most of the functionalities defined in the java SE
libraries. Like file access, network access etc.

#Configuration Of Android environment


*Operating System:-To develop an Android program, the necessary supporting
operating systems used in a computer can be as follows:
a. Windows XP (32 bit), Vista (32 or 64 bit), or Windows 7 (32 or 64 bit)
b. Mac OS X (Intel) 10.5.8 (x86 only)
c.Linux
*Java JDK (Java Development Kit) :-As android programs are
developed in Java programming language
-we have to install JDK which is a free software and which includes
Java RunTime Environment(JRE).
->JDK:-The Java Development Kit (JDK) is a software development environment
that offers a collection of tools and libraries necessary for developing Java
applications.
-You need the JDK to convert your source code into a format that the Java
Runtime Environment (JRE) can execute.
-The JDK includes the Java Runtime Environment (JRE), an interpreter (java), a
compiler (javac), an archiver (jar), a documentation generator (javadoc), and
some other development tools.
-The Java Runtime Environment itself consists of the Java Virtual Machine (JVM),
supporting files, and core classes.

*Android SDK:-The Android SDK (Software Development Kit) is the most


important software of android which is installed.
-The Android SDK (Software Development Kit) is a set of development tools that are
used to develop applications for the Android platform.
-Whether you create an application using Java, C#, you need the SDK to get it to run
on any Android device. You can also use an emulator in order to test the
applications that you have built.
-The Android SDK provides to test android applications, the API libraries, an
emulator,
documentation, sample code, developer tools, and tutorials which help you to
build, test and debug apps for Android.
-Android SDK is a software development kit developed by Google for the Android
platform.
-Android SDK can be downloaded from google and it is free.
-We find the Android SDK in a zip file and we have to unzip its contents
(android-sdk-windows) into a folder (c:\android\foldername).
-Android SDK is made up of two main parts: the tools and the packages.
-When you first install you get the basic tools(executables and supporting files) to
develop apps.
-Packages are records to a particular version of Android(platform).
-Some android SDK features are;
● No licensing,development fees,distribution
● Open source webkit based browser
● Media libraries
● Shared data stores
*Android Development Tools (ADT) :-Android Development Tools (ADT) is a plugin
for
the Eclipse IDE suitable environment to develop an android application where creation,
compilation and debugging are possible.
-ADT can able to set up new Android projects, create an application UI, add packages based
on the Android Framework API, debug your applications using the Android SDK tools, and
even export signed (or unsigned) .apk files in order to distribute your application.
-ADT provides custom XML editors and debug output pane .
-ADT BUNDLE provides
● Eclipse+ ADT plugin
● Android SDK Tools
● Android Platform tools
● The most recent Android platform

*Android Virtual Devices (AVD):-An Android Virtual Device (AVD) is an emulator


configuration that allows developers to test the application by simulating the real device
capabilities.
-We can configure the AVD by specifying the hardware and software options.
-AVD manager enables an easy way of creating and managing the AVD with its graphical
interface.
-Use the AVD Manager to create an AVD.
-Launch it from eclipse by clicking Window | AVD Manager.
-An Android Virtual Device (AVD) is used for testing the Android applications.
-An AVD is an emulator act as a real device.
-The Android emulator is an Android Virtual Device (AVD)
-The Android emulator provides almost all the functionality of a real device.
-We can get the incoming phone calls and text messages.
-It also gives the location of the device and simulates different network speeds. Android
emulator simulates rotation and other hardware sensors.
-It accesses the Google Play store, and much more
-An AVD consists of
● A hardware profile -defines hardware features of the virtual device.
● A mapping to a system image -you can define what version of Android platform will
run on the virtual machine.
● You can specify the emulator skin you want to use with the AVD.
*Emulator:-The Android Emulator simulates Android devices on your computer so
that you can test your application on a variety of devices.
-The emulator provides almost all of the capabilities of a real Android device.
-You can simulate incoming phone calls and text messages, specify the location of
the device, simulate different network speeds, simulate rotation and access the
Google Play Store, and much more.
-Testing your app on the emulator is in some ways faster and easier than a physical
device. For example, you can transfer data faster to the emulator than to a device
connected over USB.
*Dalvik Virtual Machine:-modern JVM is high performance and provides excellent
memory management.
- But it needs to be optimized for low-powered handheld devices as well.
-The Dalvik Virtual Machine (DVM) is an android virtual machine optimized for mobile
devices.
-It optimizes the virtual machine for memory, battery life and performance.
-Dalvik is a name of a town in Iceland. The Dalvik VM was written by Dan Bornstein.
-The Dex compiler converts the class files into the .dex file that run on the Dalvik VM.
-Multiple class files can be converted into one dex file.
-fig imp allaaa ( e fig inta explanation annu ethu—-------------------------------->

-Dalvik uses Dalvic byte code which is different from Java byte code.
-Java class files cannot directly run on Android, they need to be converted into Dalvic byte
code format by the Dex compiler.

->Dalvik virtual machine (DVM) vs Java virtual machine (JVM)

Dalvik virtual machine (DVM) Java virtual machine (JVM)


It is Register based which is designed to run It is Stack based.
on low memory.

DVM uses its own byte code and runs JVM uses java byte code and runs “.class”
“.Dex” file. file

DVM supports Android operating system JVM supports multiple operating systems.
only.

Runs on less memory Runs on more memory

Here the executable is APK. Here the executable is JAR.

For DVM very few Re-tools are available For JVM many Re-tool are available

->Steps to Install and Configure Eclipse and SDK


● Install the JDK
● Download and install the Eclipse for developing android application
● Download and Install the android SDK
● Install the ADT plugin for eclipse
● Configure the ADT plugin
● Create the AVD
● Create the hello android application.
*Layout / Type of layout:- The android SDK includes the following layout views that
may be used an
android user interface design;
1. Linear Layout:-Linear layouts are one of the simplest and common types of layouts
used by Android developers to keep controls within their user interfaces.
-Android LinearLayout is a view group that aligns all children in either vertically or
horizontally.
-it is theSimplest layout.
-The linear layout works as much as its name implies, it organizes the controls either
a vertical or horizontal pattern.
-When the layout's orientation is set to vertical, all child controls within organized in
a single column;
-and when the layout's orientation is set to horizontal, all child controls within in a
single row.
-Linear layouts can be defined within XML layout resources or programmatically in
the application's Java code.
-Child views can be arranged either horizontally or vertically.

-We have seen that android mobile screen size are different from device to device,
some mobile sizes are same. Suppose we are developing one application which
contains a text field and button, when the application changes from one mobile to
the other mobile then the problem is regarding the layout of the component. It
happens because the size of screen varies.
-Now we are having two options,

a) fill parent:-The component wants to display as big as its parent and fill in the
remaining spaces.
->fill_parent_width:-Change the layout_width" to "fill_parent”, now, the
button's width will fill in the remaining spaces,just as big as it's parent
"RelativeLayout",
-but button's height is still big enough to enclose it's content only.
->fill_parent_height:-Change the "layout_height" to "fill_parent”, now, the
button's height will fill in the remaining spaces, just as big as it's parent
"RelativeLayout",
-but button's width is still big enough to enclose it's content only.
->fill_parent_width, height:-Change the both "layout_width” and
"layout_height” to “fill_parent”,
-the button will display as big as the whole device screen, it just fill in the
entire screen space.
b) wrap_content:-The component want to display as big enough to enclose its
content only.
eg ; A button component, set "wrap_content" on both width and height
attribute. It tell Android display the button big enough to enclose it's
content only.
->Attributes;
● Layout_width:-it specifies the width of the view or viewgroup
● Layout_height:-it specifies the height of the view or viewgroup
● layout_marginTop:- it specifies extra space on the top side of the view or
viewgroup
● layout_marginBottom:-it specifies extra space on the bottom side of the view
or viewgroup
● layout_marginLeft:- it specifies extra space on the left side of the view or
viewgroup
● layout_marginRight:- it specifies extra space on the right side of the view or
viewgroup
2.Absolute Layout:-An Absolute Layout lets you specify exact locations
(x/y coordinates) of its children.
-Absolute layouts are less flexible and harder to maintain
than other types of layouts .
-Absolute layouts is based on the simple idea
of placing each control at an absolute position.
-> Attributes
● layout_x:- This specifies the x-coordinate of the view
● layout_y:- This specifies the y-coordinate of the view.

3.Frame Layout:-Frame Layout is designed to allocate an


area on the screen to display a single item.
-Generally, FrameLayout should be used to hold a single child view, (ie a single item
once).
-We can have multiple elements, each element will be positioned based on top left of
screen.
4.Relative Layout:-RelativeLayout is a view group that displays child views in relative
positions.
-The position of each view can be specified as relative to sibling elements (such as to the
left-of or below another view) or in positions relative to the parent RelativeLayout area
(such as aligned to the bottom, left or center).
-A RelativeLayout is a very powerful utility for designing a user interface
-because it can eliminate nested view groups and keep your layout hierarchy flat, which
improves performance.

-By default, all child views are drawn at the top-left of the layout, so you must define the
position of each view using the various layout properties available from RelativeLayout.

5.Table Layout:-Android TableLayout going to be


arranged groups of views into rows and columns.
-You will use the element to build a row in the table.
-Each row has zero or more cells; each cell can hold
one View object.

Module 2

#Android User Interface:-The user interface (UI) for an Android app is built as
a hierarchy of layouts and widgets.
-The layouts are ViewGroup objects, containers that control how their child views are
positioned on the screen.
-Widgets are View objects, UI components such as buttons and text boxes.

*components of a screen:- An Activity displays the user interface of our application,


which may image buttons, text boxes, labels, etc.
-Typically , you define your UI using an XML file.

*Fundamental UI design:- Every item in a user interface is a subclass of the Android


View class which is present inside the package (android.view) .
-The Android SDK provides a set of pre-build view that can be used to construct user
interface.
-Typical example such as the Button, ImageButton, CheckBox, progress Bar and TextView
Classes.
->Views:-Views are the base class for all visual interface elements (commonly known as
controls or widgets).
- UI controls & layout classes are derived from View.
-A View is an object/widget that draws something on the screen by the help of user
interact.
-One or more views can be grouped together into one GroupView.
-Examples of widgets are buttons, text boxes ,labels etc.
->View Groups :- View Groups are extensions of the View class that can contain multiple
child Views.
-One or more views can be grouped together into one GroupView.
-The ViewGroup class is also extended to provide the Layout Managers that help us to
control layout within our Activities.
- The ViewGroup is the base class for Layouts in android.
-In other words, ViewGroup is generally used to define the layout in which
views(widgets) will be set/arranged/listed on the android screen.
->Difference between View & View group

->Fragments:- introduced in Android 3.0 which uses API level 11, are used to
encapsulate portions of your UI.
-This encapsulation makes Fragments useful when optimizing your UI layouts for
different
screen sizes.
-and creating reusable user interface (UI).
->Activities :- Activities, represent a single screen that user interact .
- To display a UI, we assign a View (usually a layout or Fragment) to an Activity.

#Layout Manager:-In case of java application there are many layouts found they are;
● Flow Layout: This is a default layout of applet.
- it is used to arrange the components in a line, one after another (in a flow).
● Border Layout: This is default layout of frame.
-The BorderLayout is used to arrange the components in five regions: north, south,
east, west, and center.
-Each region (area) may contain one component only.
-the default position is border layout is center.
● Grid Layout: This layout divides the frame into row and column.
● Card Layout:-his layout clicks the first panel so that second panel is visible and goes
on.
● BoxLayout:- is used to arrange the components either vertically or horizontally.
● Null layout:-his layout can placed the visual component in any position of frame or
applet.

#User interface with View:-It is very important to design a good looking page for
apps in android.
-with the help of GUI like TextView,Button,CheckBox etc,make better in android

*Text View:-TextView displays text to the user and optionally allows them to edit it.
-A TextView is a complete text editor, however the basic class is configured to not allow
editing.
->properties /Attributes of TextView
● Alpha:-alpha property of the view, as a value between 0 and 1
● Auto link :-Control links such as urls and email addresses are automatically found and
converted to clickable links.
● fontFamily:- Font family (named by string) for the text.
● Clickable:-Defines whether this view reacts to click events
● Cursor visible:-Makes the cursor visible or invisible.
● Id:- Supply an identifier name of this view, to later retrieve it with
View.findViewById()./ This is the ID which uniquely identifies the control.
● Input type:-the type of data being placed in a text field.
● Max height: makes the textview be at most this many pixels tall.
● Min height: makes the textview be at least this many pixels tall.
● Text:- text to display.

*Button:-A push button which can be pressed or clicked by the user to perform an action.
->properties/attributes of Button:-
● Auto link: Controls links such as urls and email addresses are automatically found
and converted to clickable links.
● Background: To use as the background. [reference, color].
● Cursor visible:-Makes the cursor visible or invisible.
● Id:- Supply an identifier name of this view, to later retrieve it with
View.findViewById()./ This is the ID which uniquely identifies the control.
● id:- This supplies an identifier name for this view.
● Text:- text to display.

*Image Button:- A push button for which you can specify a customized background
image (Drawable).
->Properties of ImageButton
● Background: To use as the background. (reference, color]
● Clickable:-Defines whether this view reacts to click events
● Id:- Supply an identifier name of this view, to later retrieve it with
View.findViewById()./ This is the ID which uniquely identifies the control.
● cropToPadding:- If true, the image will be cropped to fit within its padding.
● contentDescription:- This defines text that briefly describes content of the view.
● src:- This sets a drawable as the content of this ImageView.
● Text:- text to display.

*Edit Text:-A EditText is an overlay over TextView that configures itself to be editable.
-It is the predefined subclass of TextView that includes
rich editing capabilities.
->Properties of Edit Text;
● autoText:- If set, specifies that this TextView has a textual input method and
automatically corrects some common spelling errors.
● drawableBottom:- This is the drawable to be drawn below the text.
● drawableRight:- This is the drawable to be drawn to the right of the text.
● background:- This is a drawable to use as the background.
● id:- This supplies an identifier name for this view.
● Text:- text to display.

*CheckBox:-A CheckBox is an on/off switch that can be


toggled by the user.
-You should use check-boxes when presenting users with
a group of selectable options that are not mutually
Exclusive.
->Properties of CheckBox
● autoText:- If set, specifies that this TextView has a
textual input method and automatically corrects
some common spelling errors.
● drawableBottom:- This is the drawable to be drawn below the text.
● drawableRight This is the drawable to be drawn to the right of the text.
● background:- This is a drawable to use as the background.
● id:- This supplies an identifier name for this view.
● Button: Drawable used for the button graphic.
● Cursor visible:-Makes the cursor visible or invisible.
● Text:- text to display.

*Toggle Button:-Toggle Button can be used to display checked/unchecked


(On/Off) state on the button.
-it can be used as an alternative to a check box.
-A toggle button allow the user to change a setting between two states,
On state and Off state.
->properties of toggle button
● autoText:- If set, specifies that this TextView has a textual input method and
automatically corrects some common spelling errors.
● background:- To use as the background.
● Cursor visible:-Makes the cursor visible or invisible.
● Button:- used for button graphics.
● textOff:- This is the text for the button when it is not checked. /The text for the
button when it is not checked.
● textOn:- This is the text for the button when it is checked./ The text for the button
when it is checked

● Text:- text to display.


*Radio Button and Radio Group:- it is a two state grouped buttons.
-A radio button has two states that can be either checked or unchecked.
-Once the radio button is unchecked, the user be able to press or click it to check it.
-Radio buttons are normally used together in a Radio Group.
-When a number of radio buttons live inside a radio group, checking one radio button
unchecks all the others.

->properties of Radio button


● autolink:- Checks whether links such as url and email addresses are automatically
found and converted to clickable links.
● Button:- used for button graphics.
● Cursor visible:-Makes the cursor visible or invisible.
● Text:- text to display.

*Progress Bar:- ProgressBar is used to show the progress of an operation.


-ProgressBar is a Visual indicator of progress in a number of operation.
-Displays a bar to the user representing how far the
operation has progressed.
-he application can change the amount of progress
(modifying the length of the bar) as it move forward.
-There is also a secondary progress displayable on a progress bar which is useful for
displaying intermediate progress, such as the buffer level during a stream playback progress
bar.
-For example, when you are uploading or downloading something from the internet, it is
better to show the progress of download/upload to the user.
->properties of progress bar
● Background: A drawable to use as the background. [reference, color]
● Clickable: Defines whether this view reacts to click events.
● Content description: Defines text that briefly describes content of the view.
● Interpolator:- defines the rate of change of animation.
● Text direction :- Direction of the text.
● id:- used to uniquely identify the control.
● max:- maximum value of the progress bar.
● minHeight- used to set the height of the progress bar.
● minWidth- used to set the width of the progress bar.

*Autocomplete Text View:- It is an editable text view.


-AutoCompleteTextView is a view that is similar to EditText, except that it shows a list of
completion suggestions automatically while the user is typing.

->properties of AutoCompleteTextView
● Completion hint: Defines the hint displayed in the drop down menu.
● Completion hint view: Defines the hint view displayed in the drop down menu.
● Content description: Defines text that briefly describes content of the view.
● Text is selectable: Indicates that the content of a non-editable selected.
● completionThreshold:- the number of characters that the user must type before
completion suggestions are displayed in a drop down menu.
● dropDownHeight:- It specifies the basic height of the dropdown.
● dropDownWidth:- This specifies the basic width of the dropdown.

*Spinner:-spinner is like the drop down menu with multiple values from which the end
user can select only one value.
-Spinner is a view similar to the dropdown list
which is used to select one option from the
list of options.
-It provides an easy way to select one item
from the list of items and it shows a
dropdown list of all values when we click on it.
-The default value of the android spinner will be the currently selected value.
->properties of spinner
● Id:- Used to specify the id of the view.
● textAlignment:- Used to the text alignment in the dropdown list.
● background:- Used to set the background of the view.
● padding:- Used to set the padding of the view.
● visibility:- Used to set the visibility of the view.
● gravity:- Used to specify the gravity of the view like centre, top, bottom, etc.
● Spinner mode:- Display mode for spinner option.

*List View:- ListView is a view which groups several items and display them in vertical
scrollable list.
-The list items are automatically inserted to the list using an Adapter that pulls content from
a source such as an array or database.
->properties of List View;
● id:- This is the ID which uniquely identifies the layout.
● dividerHeight:- This specifies height of the divider. This
could be in px, dp, sp, in, or mm.
● Stack from bottom:- used to stack their content from
the bottom.
● List selector:- Drawable used to indicate the currently
selected item in the list.

* Grid View:- will fill the entire screen.


-Android has a grid view control that can display data in the form of a grid.
-The content of the grid can be text, images, and so on.
-The ListView and GridView are subclasses of AdapterView and they can be populated by
binding them to an Adapter, which retrieves data from an external source and creates a
View that represents each data entry.
->properties of grid view
● id:- This is the ID which uniquely identifies the layout.
● columnWidth:;- This specifies the fixed width for each column. This could be in px,
dp, sp, in, or mm.
● gravity:- Specifies the gravity within each
cell. Possible values are top, bottom, left,
right, centre, center_vertical,
center_horizontal etc.
● numColumns:- Defines how many columns
to show. Maybe an integer value.
● verticalSpacing:- Defines the default vertical
spacing between rows. This could be in px,
dp, sp, in, or mm.
*Image View:-In Android, we can use "android.widget. Image View" class to display an
image file.
-Image file is simple to use but hard to master, because of the various screens.
-In Android, ImageView class is used to display an image file in application.
->properties of image view
● maxHeight:- Used to specify a maximum height for this view.
● maxWidth:- Used to specify a maximum width for this view.
● src:- Sets a drawable as the content for this ImageView.
● scaleType:- Controls how the image should be resized or moved to match the size of
the ImageView.
● tint:- Tints the colour of the image in the ImageView.
● background:- This property gives a background color to your ImageView.
● padding:- To provide padding or extra space inside the ImageView for the image.

*Scroll View:-A ScrollView is a view group that is used to make vertically scrollable views.
- A scroll view contains a single direct child only.
- A ScrollView supports Vertical scrolling only, so in order to create a horizontally scrollable
view, Horizontal scroll view is used.

*Custom Toast Alert:- A toast is a view containing a quick little message for the user.
-In Android, Toast is used to display information for a period of time.
-It contains a message to be displayed quickly and disappears after specified period of time.
->Methods
● makeText:- (Context context, CharSequence text, int duration): This method is used
to initiate the Toast.
-This method take three parameters First is for the application Context, Second is
text message and last one is duration for the Toast.
a. LENGTH_LONG:- It is used to display the Toast for a long period of time.
When we set this duration the Toast will be displayed for a long duration.
b. LENGTH_SHORT: It is used to display the Toast for short period of time.
When we set this duration the Toast will be displayed for short duration.
● show():- This method is used to display the Toast on the screen.
● setText:- This method is used to set the text for the Toast.

*Time and Date Picker:- Date picker is widget for selecting a date.
-The date should be able to be selected by a year, month, and spinners or a Calendar view.
->property of Date picker
● getDayOfMonth():- This method gets the selected day of month.
● getMonth():- This method gets the selected month.
● getYear():- This method gets the selected year.
● updateDate:- This method updates the current date.
- Time Picker allows you to select the time of day in either 24 hour or AM/PM mode.
-The time consists of hours, minutes and clock format.
->property of time
● setCurrentHour:- This method sets the current hour.
● setCurrentMinute:- This method sets the current minute.

Module 3

#Activity :-An activity represents a single screen with a user interface just like window.
-Android activity is the subclass of ContextThemeWrapper class.
-Depending on the application, there can be single to multiple
activities, meaning one or more screens.
-Android apps start from a main activity and from there additional
activities can be opened.
-The activities could be independent of one another
Eg;using the camera application to take photos in facebook.
-Another example
Example-Facebook app provides an activity to log into the application.
There could be other activities like posting a photograph, send a message to a friend etc.
-There are two methods to implement Activity they are;
● onCreate(Bundle):- method in which we initialize our activity.
- Here we usually call setContentView(int) with a layout resource defining the UI and
findVewbyId(id)to retrieve the widgets in that UI that we need to interact with
programmatially.
● onPause():-another method in which we deal with the user leaving the activity.
-Any changes made by the user at this point be committed.

*Intent:-Intents are the message passing mechanisms to communicate an action.


-Intent provides a description of the actions that you want to done.
For example, view a message, send an email,display a photograph, play a video, etc.
-Intent is very closely related to an activity.
Example-You are accessing Facebook homepage in your mobile phone and want to view
recent photograph posted by one of your friends in your homepage. To do so, we must
click the photograph which results in firing the intent associated with click activity. This
will lead to a new screen displaying photograph along with the associated information.
-3 fundamental use cases for using intents,they are;
● Starting an activity:-An Activity represents a single screen in an app.
- You can start a new instance of an Activity by passing an Intent to startActivity().
-The Intent describes the activity to start and carries any necessary data.
● Starting a service:-A Service is a component that performs operations in the
background without a user interface.
-You can start a service to perform a one-time operation (such as downloading a file)
by passing an Intent to startService().
● Delivering a broadcast:-A broadcast is a message that any app can receive.
-The system delivers various broadcasts for system events, such as when the system
boots up or the device starts charging.
-You can deliver a broadcast to other apps by passing an intent to sendBroadcast() or
sendOrderedBroadcast().
->Pending Intent:- The Pending Intent class provides a mechanism for creating intents that
can be called by another application at a later on time.
-it is commonly used to package an Intent.
-Pending Intent can be created in three types;
1.getActivity
2.getBroadcast
3.getService

->Intent structure:-In Android intents are the message passing mechanisms to communicate
an action.
● action:-- general action to be performed such as ACTION_VIEW , ACTION_EDIT ,
ACTION_MAIN etc
● data:-Data to operate on such as a person record in the contact database ,expressed
as a URI.
*Types of intents:-There are two type of intent they are;
1. Explicit intent:-Explicit Intent specifies the component.
-Explicit intent going to be connected internal world of application,suppose if
you wants to connect one activity to another activity, we can do this by
explicit intent.
example, there are two activities (FirstActivity, SecondActivity). When you
click on the ‘GO TO OTHER ACTIVITY’ Button in the FirstActivity, then you
move to the SecondActivity. When you click on the ‘GO TO HOME
ACTIVITY’
button in the SecondActivity, then you move to the first activity. This is
getting done through Explicit Intent.
2. Implicit intent:-Implicit Intent doesn’t specify the component.
- An action to be performed is declared by implicit intent.
For example, if you want to show the user a location on a map, you can
use an implicit intent to request that another capable app show a
specified location on a map.

*Intent_filter:-Intent_filters is a very powerful way to connect different applications


together hence allowing better user experience.
-They take care of intent resolution to match activities, services and broadcast receiver.
-Intent filter are declared in the Android Manifest.xml.
-An intent filters is an instance of the IntentFilter class.

*Activity Life Cycle/ Activity life cycle diagram :- Activities in the system are
managed as an activity stack.
-When a new activity is happening, it is placed on the top of the stack and becomes the
running activity.
-The activity always remains below it in the stack, and will not come to the foreground again
until the new activity exits.
-fig
-1.Another foregrounds comes to the foreground.
-2.The activity is no longer.
-3.The activity is finishing or being destroyed by the system
-4.APPs with higher priority need money.
-5.User navigates to the activity
-6.User returns to the activity.
-7.User navigates to the activity
-OR—---------------------------------------------->
-7 lifecycle methods of android activity.
They are—--- (next page)
Method Description

onCreate called when activity is first created.

onStart called when activity is becoming 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 called when activity is no longer visible to the user.

onRestart called after your activity is stopped, prior to start.

onDestroy called before the activity is destroyed.

*Broadcast Life Cycle:- A broadcast receiver is a component that do nothing but receive
and react to broadcast announcements.
-roadcast Receivers simply respond to broadcast messages from other applications or from
the system itself.
-These messages are sometime called events or intents.
For example, applications can also initiate broadcasts to let other applications know
that some data has been downloaded to the device and is available for them to use,
so this is broadcast receiver who will intercept this communication and will initiate
appropriate action.
-There are mainly two types of Broadcast Receivers:
● Static Broadcast Receivers: These types of Receivers are declared in the manifest
file and works even if the app is closed.
● Dynamic Broadcast Receivers: These types of receivers work only if the app is
active or minimized.

-The following table lists a few important system events.


● android.intent.action.BATTERY_LOW :- Indicates low battery condition on
the device.
● android.intent.action.BOOT_COMPLETED :- This is broadcast once, after the
system has finished booting
● android.intent.action.REBOOT:-Have the device reboot.
● android.intent.action.BATTERY_OKAY:- Indicates the battery is now okay
after being low.
*Flags:-
● FLAG_CANCEL_CURRENT: - If the described PendingIntent already exists, the current
one should be canceled before generating a new one.
● FLAG_NO_CREATE: - If the described PendingIntent does not already exist, then
simply return null instead of creating it.
● FLAG_ONE_SHOT: - PendingIntent can be used only once.
● FLAG_UPDATE_CURRENT :- If the described PendingIntent already exists, then keep
it but replace its extra data with what is in this new Intent.
*Services:-A services is a application component which run without direct interaction with
the user in the background.
-The Android platform provides and run predefined system services such as updating
ContentProviders, firing Intents, and triggering Notifications etc .
-A service is a component that runs in the background to perform long-running operations
without needing to interact with the user and it works even if application is destroyed.
- A service have two states they are;
● Started :-A service is started when an application component, such as an activity,
starts it by calling startService(). Once started, a service can run in the background
indefinitely, even if the component that started it is destroyed.
● Bounded :-A bound service offers a client-server interface.
-It allows components ( such as activities) to interact with the service, send
requests, receive results, and perform interprocess communication (IPC).
-A bound service runs only as long as another application component is bound to it.
-These are the three different types of services they are;
● Foreground service:-A foreground service
performs some operation that is noticeable
to the user.
-For example, an audio app would use a
foreground service to play an audio track.
Foreground services must display a notification.
● Background Services:--A background service
performs an operation that isn't directly noticed by the user.
● Bound Services:- Bound services perform their task as long as any application
component is bound to it.
-In order to bind an application component with a service bindService() method is
used.
-The following diagram on the left shows the life cycle when the service is created with
startService()
-and the diagram on the right shows the life cycle when the service is created with
bindService():
1. onStartCommand():-The system calls this method when another
component, such as an activity, requests that the service be started, by
calling startService().
-Once we implement this method, it is your responsibility to stop the service
when its work is done, by calling stopSelf() or stopService() methods.
2. onBind():-The system calls this method when another component wants to
bind with the service by calling bindService().
-If the binding of service is not required then the method must return null.
3. onUnbind():- method when all the clients
get disconnected from a particular service interface.

4. onRebind():-Once all clients are disconnected from the particular interface


of service and there is a need to connect the service with new clients, the
system calls this method.
5. onCreate():-Whenever a service is created either using onStartCommand()
or onBind() the android system calls this method.
6. onDestroy():-The system calls this method when the service is no longer
used and is being destroyed.
-Example of Android Services, Playing music in the background is a very common example of
services in android.

#multimedia:-The Android multimedia framework includes support for playing variety


of common media types, so that you can easily integrate audio, video and images into your
applications.
-The following multimedia formats are supported:
➢ Bitmap
➢ JPEG
➢ PNG(portable network graphics)
➢ OGG
➢ MPEG4
➢ 3GPP(3rd generation partnership project)
➢ MP3
*Architecture of Android System / Android System Architecture :- Android
software stack is categorized into 5 parts

● Linux kernel -it is the heart of android


architecture that interfaces computers
hardware and its processes.
-Responsible for device drivers,
power management, memory management,
device management and resource access.
● Native libraries:- On the top of linux kernel,
there are native libraries like WebKit, OpenGl,FreeType,SQLite, Media,C runtime
library(libc).
● Android runtime:- There are core libraries and DVM(Dalvic virtual machine)
responsible to run android application.
-DVM is like JVM but optimized for mobile devices.
-It consumes less memory and provides fast performance.
● Android framework:- Includes android API’s such as UI, telephony, resources
,locations,content providers and package managers.
-Provides lot of classes and interfaces for android application development.
● Applications:- All applications such as home ,contact,settings,games,browsers are
using android framework that uses android runtime and libraries. Android runtime
and native libraries use linux kernel.
*Multimedia framework:-Multimedia framework is a software framework that handles
media on a computer and through a network.
-A good multimedia framework add support for new audio ,video,container formats and
transmission protocol.
-Used by applications like media player, audio or video editors,also to build video
conferencing applications ,media converters and other multimedia tools.

* Play Audio and Video:-2 types of classes to play audio and video in android.
->Play Audio:-We can play and control the audio files in android by the help of MediaPlayer
class.
-The android.media.MediaPlayer class is used to control the audio or video files.
-some methods of MediaPlayer class are;
public void start() it starts or resumes the playback

public void stop() it stops the playback.

public void pause() it pauses the playback.

public void pause() it pauses the playback.

Public void setLooping sets the player for looping or non-looping.


(boolean looping)

public boolean isLooping() checks if the player is looping or non-looping.

->Video:-By the help of MediaController and VideoView classes, we can play the video files
in android.
-The android.widget.MediaController is a view that contains media controls like
play/pause, previous, next, fast-forward, rewind etc.
-The android.widget.VideoView class provides methods to play and control the video
player.
-The commonly used some methods of VideoView class are;

Method Description

public void start() starts the video view.

public void stopPlayback() stops the playback.

public void pause() pauses the playback.

public void suspend() suspends the playback.

public void resume() resumes the playback.

*Text to Speech:-Android allows you convert your text into voice.


-Not only you can convert it but it also allows you to speak text in variety of different
languages.
-Android provides TextToSpeech class for this purpose.
-bakki thanna ezhuthukaaa.

*Sensors:- A sensors is a piece of hardware wired into the device feeding data from the
physical world to application.
-Android device come with build in sensors and provide a framework for working with
sensors.
-working with sensors is real fun in android.
-Sensors are easy to use.
-Sensors can operate in one direction only and read-only.
-some of the sensors type are ;
● Light sensor:-used for control screen brightness.
● Proximity sensor:- Phone position during a call
● Temperature sensor:-monitoring air temperature
● pressure sensor:-monitoring air pressure change
● Magnetic field sensor:- creating compass.
-Android support 3 categories of sensors:
● Motion sensors:- These sensors measure acceleration forces and rotating forces
along three axes.
-This category include gravity sensors , accelerators,gyroscopes and rotational
sensors.
● Environmental sensors:-These sensors measure various environmental parameter.
-This category includes photometers,thermometers etc
● Position sensors:- These sensors measure the physical position of a device.
-this category includes orientation sensors and magnetometers.

Module 4

SQLite Database in Android:-SQLite is a open source relational database used to


perform database operations on android devices like storing, manipulating or retrieving
persistent data from the database.
- Android comes in with built in SQLite database implementation.
-SQLite supports all the relational database features.
-In order to access this database, you don't need to establish any kind of connections for it
like JDBC,ODBC e.t.c
-SQLite is one of the fastest-growing database engines around, but that's growth in terms of
popularity, not with its size.
-The source code for SQLite is in the public domain.
*Why SQLite? :-SQLite does not require a separate server process or system to operate
(serverless).
-SQLite comes with no setup or administration needed.
- A complete SQLite database is stored in a single cross-platform disk file.
-SQLite is very small and light weight, less than 400KB fully configured or less than 250KB
with optional features omitted.
-SQLite is self-contained, which means no external dependencies.
-SQLite is free to use for any purpose commercial or private.
-SQLite is written in ANSI-C and provides simple and easy-to-use .
-SQLite supports most of the query language.
-SQLite is available on UNIX and Windows .
-It Supports 3 datatypes they are:
● Text(like string):-for storing datatype string.
● Integer(like int):-for storing integer primary key.
● Real(like double):-for storing long values.

* Creation and Connection of the Database:-


● Create "SQLiteDatabase" object.
● Open or Create a database and create a connection.
● Perform insert, update or delete operation.
● Create a Cursor to display data from the table of the database.
● Close the database connectivity.
● SQLite is a open source SQL database that stores data to a text file on a device.
->Properties to set database:-Some database properties must be set after connecting to
the database.
1.setVersion()-sets the database version.
2.setLocale()-sets the default locale for the database.
3.setLockingEnabled()-enables locking on the database.

Step 1:
-Import android.database.sqlite.
-This method is used to create/open database. As the name suggests, it will open a
database connection if it is already there, otherwise, it will create a new one.
Step 2: Execute DDL command
- This command is used to execute a single SQL statement that doesn't return any data
means other than SELECT or any other.
-Try and Catch block is required while performing this operation.
-An exception that indicates there was an error with SQL parsing or execution.
Step 3: Create an object and Initiate it.
-This class is used to store a set of values.
-We can also say, it will map ColumnName and relevant ColumnValue.
Step 4: Perform Insert Statement.
-This method returns a long. The row ID of the newly inserted row, or -1 if an error
occurred.
Step 5: Create Cursor
-This interface provides random read-write access to the result set returned by a database
query.
Step 6: Close Cursor and Close Database connectivity
- It is very important to release our connections before closing our activity.
-It is advisable to release the Database connectivity in "onStop" method. And Cursor
connectivity after using it.

*How can we create the Tables?:- After executing the statements the table is created on
the database.
-The queries are executed by the execSQL() statement.

*Inserting records ( in database):- First we create a ContentValues object to store


data to insert and use the put() method to load data.
-Then we use the insert() method to insert the records in SQLite.
-This function returns long which holds the primary key of the newly inserted row.
-We can create a table or insert data into the table using execSQL method

*Updating data in the database:-The update() method is used to update the records
in the database.
-The update() supports WHERE syntax.
-It Contains 2 parameters 1.Tablename 2.ContentValues instance.
* Deleting data from the database:-Delete() method has 3 parameters
a.Database name.
b.WHERE clause.
c.An argument array for the WHERE clause.
-To delete all the records from a table pass null for the WHERE clause and WHERE clause
argument array.

*Database – Fetching / Extracting values from Cursors :-We can retrieve anything
from database using an object of the Cursor class.
-We will call a method of this class called rawQuery and it will return a resultset with the
cursor pointing to the table.
- We can move the cursor forward and retrieve the data.
-There are other functions available in the Cursor class that allows us to effectively retrieve
the data they are;
● getColumnCount():- This method return the total number of columns of the table.
● getColumnNames():- This method returns the array of all the column names of the
table.
● getCount():- This method returns the total number of rows in the cursor.
● getPosition():- This method returns the current position of the cursor in the table.

*Transactions in SQLite:-A transaction is a unit of work that is performed against a


database.
- A transaction is the propagation of one or more changes to the database.
For example, if you are creating, updating, or deleting a record from the table, then
you are performing transaction on the table.
- It is important to control transactions to ensure data integrity and to handle database
errors.
-SQLite is a transactional database that all changes and queries are atomic, consistent,
isolated, and durable (ACID).
- SQLite guarantees all the transactions are ACID compliant even if the transaction is
interrupted by a program crash, operation system dump, or power failure to the computer.
->Properties of Transactions
● Atomic: a transaction should be atomic. It means that a change cannot be broken
down into smaller ones.
● Consistent: a transaction must ensure to change the database from one valid state
to another.
-When a transaction starts and executes a statement to modify data, the database
becomes inconsistent.
-However, when the transaction is committed or rolled back, it is important that the
transaction must keep the database consistent.
● Isolation: a pending transaction performed by a session must be isolated from other
sessions.
-When a session starts a transaction and executes the insert or update statement to
change the data, these changes are only visible to the current session, not others.
-On the other hand, the changes committed by other sessions after the transaction
started should not be visible to the current session.
● Durable: if a transaction is successfully committed, the changes must be permanent
in the database regardless of the condition such as power failure or program crash.
- On the contrary, if the program crashes before the transaction is committed, the
change should not persist.

#Telephoning and Messaging

*SMS Telephony:-Telephony system is a software framework to provide mobile phones


to voice calls,video call,SMS,MMS,data service,network management and so on.
-Android phones support dialling numbers, receiving calls, sending and receiving text and
multimedia messages, and other related telephony services.
-In contrast to other smartphone platforms, all these items are accessible to developers
through simple-to-use APIs and built-in applications.
-You can easily leverage Android’s telephony support into your own applications.
-SMS messaging is one great killer application for the mobile phone.
-It created a steady revenue stream for mobile operators.
-Android Telephony architecture works in 4 layers that are :
• Communication Processor:- It is an input/output processor to distribute and collect
data from a number of remote terminals.
-It is a specialized processor designed to communicate with the data communication
network.
• Radio Interface Layer (RIL):-It is a bridge between the hardware and Android phone
framework services.
- It has two main components that are:
1.RIL Daemon– It starts when the android system starts.
2.Vendor RIL– It is also known as RIL Driver.
-Android Telephony Framework consists of two types of packages that are:
1. Internal Telephony Packages: This is generally the used for default telephony app.apk.
2. Open Technology Packages: This is for third-party apps.
-Telephony Applications
1.Dialer
2.Contacts
3.Messaging-SMS/MMS
4.Settings app- a.Airplane mode b.Network Selection(auto/manual) c.Call
5.Browser.

*Sending SMS:-In Android, we can use SmsManager API or devices Built-in SMS
application to send SMS's.
- Both need SEND_SMS permission to send SMS.

*Receiving SMS:-To receive sms,use the onReceive() method.


-bakki thanna ezhuthukaaa

*Wi-Fi Activity:-Android allows applications to view the state of the wireless connections
at very low level.
-Application can access almost all the information of a wifi connection.
-Android provides WifiManager API to manage all aspects of WIFI connectivity.
-bakki thanna ezhuthukka

*Run android app on a real device Set up your device as follows:


-Connect your device to your development machine with a USB cable.
-If you developed on Windows, you might need to install the appropriate device driver for
your device.
- Perform the following steps to enable USB debugging in the Developer options window:
● Open the Settings app.
● If your device uses Android v8.0 or higher, select System. Otherwise, proceed to the
next step.
● Scroll to the bottom and select About phone.
● Scroll to the bottom and tap Build number seven times.
● Return to the previous screen, scroll to the bottom, and tap Developer options.
● In the Developer options window, scroll down to find and enable USB debugging.
-Run the app on your device as follows:
● In Android Studio, select your app from the run/debug configurations drop-down
menu in the toolbar.
● In the toolbar, select the device that you want to run your app on from the target
device drop-down menu.
Module 5

# JSON:- stands for JavaScript Object Notation.


-It is a lightweight text-based open standard designed for human-readable data interchange.
-Best alternative for XML.
-It has been extended from the JavaScript scripting language.
-The filename extension is .json.
-JSON is "self-describing" and easy to understand.
-It is Used for transmitting data between server and web application.
-JSON is plain text written in JavaScript object notation.
-JSON is used to send data between computers.
-> JSON Syntax Rules
 Data is in name/value pairs.
 Data is separated by commas.
 Curly braces hold objects.
 Square brackets hold arrays.

* XML:- XML stands for eXtensible Markup Language.


-XML is a markup language.
-XML was designed to store and transport data.
-XML was designed to be self-descriptive.
- It is a little hard to understand.
- The XML above is quite self-descriptive:
 It has sender information
 It has receiver information
 It has a heading
 It has a message body
- Xml was released in late 90’s.
- XML is not a replacement for HTML.
- XML is designed to carry data, not to display data.
- XML tags are not predefined. You must define your own tags.

*Similarity between XML and JSON


JSON XML
It is a plain text Plain text
It is human readable (self-describing) Human readable
It support unicode It also support unicode

*Advantage of JSON over XML


-JSON has no end tags like XML.
-It is shorter/smaller than XML.
-It is quicker to read and write.
-It uses arrays.
-It has no reserved words.

*Uses of JSON
-JSON ina kurichu ezhuthiyal mathi

* JSON vs XML /Difference


JSON is simple and easier to read and write XML is less readable

JSON doesn’t use end tag In XML, the end tag is mandatory

JSON supports array XML doesn’t support array

JSON is short XML is lengthy

JSON is less secure than XML XML is more secured than JSON

JSON file is more readable than XML because it is short XML file is big and filled with user-
and to the point. defined tags, thus less-readable

JSON is data-oriented XML is document-oriented

* JSON Syntax Rules


 Data is in name/value pairs.
 Data is separated by commas.
 Curly braces hold objects.
 Square brackets hold arrays.
OR
*JSON PARSER
• Parsing means interpreting.
• Here we are converting the string into a JSON object.
• JSON parser parses a JSON object embedded in a string field and parses the
parsed data to an output field in the record.
• Based on the contents of the JSON object, the resulting field is either a
string, a map or an array.

#Google Play services:- With google play services,your app takes advantage of
the latest google powered features such as maps,cast and more.
-It runs in the background and manages notifications, location etc.
-Google is not putting all updates into the android os but has been pushing updates
through google apps and services.
-bakki thanna ezhuthukaa..

You might also like