Module_2_MAD

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 55

Module 2

Fundamentals of
Android Development
INTRODUCTION TO ANDROID
 Android is a mobile operating system developed by Google

The Android Operating System is a Linux-based OS developed by the Open


Handset Alliance (OHA).
The Android OS was originally created by Android, Inc., which was bought
by Google in 2005.
Google teamed up with other companies to form the Open Handset
Alliance (OHA), which has become responsible for the continued
development of the Android OS.
INTRODUCTION TO ANDROID
The android is an open source operating system means that it’s free
and any one can use it.

Each time the OHA releases an Android version, it names the release
after a dessert. Android 1.5 is known as Cupcake, 1.6 as Donut,
2.0/2.1 as Eclair, 2.2 as Froyo and 2.3 is dubbed Gingerbread. Once a
version is released, so is its source code.
The features of android
1) It is open-source.
2) Anyone can customize the Android Platform.
3) There are a lot of mobile applications that can be chosen by the
consumer.
4) It provides many interesting features like weather details,
Health details ,Stock market details ,payment , Banking services
5) It provides support for messaging services(SMS and MMS), web
browser, storage (SQLite), connectivity (GSM, CDMA, Blue
Tooth, Wi-Fi etc.), media, handset layout etc.
Android versions:
• Google did not attach any high-calorie code name to its initial versions
1.0 and 1.1 of the Android Operating System.

• The code names of android ranges from A to N currently, such as


Aestro, Blender, Cupcake, Donut, Eclair, Froyo, Gingerbread,
Honeycomb, Ice Cream Sandwitch, Jelly Bean, KitKat, Lollipop and
Marshmallow.
THE ANDROID 4.1 JELLY BEAN SDK

• The Android 4.1 Jelly Bean SDK was released with new features for developers in July
2012
It contains variety of new features

• Project Butter: —Makes the Jelly Bean UI faster and more responsive.
Touch Responsiveness is added, which increases the CPU performance
whenever the screen is touched

• Faster speech recognition: Speech recognition is now faster and doesn’t require any
network to convert voice into text

• Improved notification system:


 The notifications include pictures and lists along with text.
 Notifications can be expanded or collapsed through a variety of gestures, and users
 can block notifications if desired..
THE ANDROID 4.1 JELLY BEAN SDK
• Supports new languages: Hindhi Arabic ,kannada

• Improved Google Voice search :Jelly Bean is equipped with a


question and answer search method that helps in solving users’ queries
similar to Apple’s popular Siri.

Better communication in Jelly Bean :Two devices can communicate


with Near Field Communication (NFC); that is, two NFC-enabled
Android devices can be tapped to share data

Auto-arranging Home screen—Icons and widgets automatically resize


and realign as per the existing space.
Google Play Widgets: Provides quick and easy access to movies,
games, magazines, and other media on the device.

• Faster Google Search—Google Search can be opened quickly, from


the lock screen and from the system bar by swiping up
• Improved Camera app
Understanding the Android Software Stack OR Architecture of
Android
1) Linux kernel
• 1) Linux kernel It is the heart of android architecture that exists at the
root of android architecture.
• Linux kernel is responsible for device drivers, power management,
memory management, device management and resource access. This
layer is the foundation of the Android Platform.
• Contains all low level drivers for various hardware components
support
• Driver model
• Security and more.
2) Libraries
WebKit Library mainly provides Web Browsing engine and a lot more related

features. Rendering of web pages

The surface manager library that provides display management functionality. A

collection of OpenGL (Open Graphic Library) and SGL (Scalable Graphics

Library), used for creating 2D and 3D graphics..

The media framework library provides media codecs for audio and video. 

The OpenGl (Open Graphics Library) and SGL(Scalable Graphics Library) are the

graphics libraries for 3D and 2D rendering


3) Android Runtime
• In android runtime, there are core libraries and DVM (Dalvik Virtual
Machine) which is responsible to run android application.

• DVM is like JVM but it is optimized for mobile devices.

• It consumes less memory and provides fast performance.

• The Dalvik VM makes use of Linux core features like memory


management and multi-threading,
3) Android Runtime
4) Android Framework

• Android framework includes Android API's such as UI (User Interface),


telephony, resources, locations, Content Providers (data) and package
managers

• Activity Manager: Manager, the Android System manages a


stack of activities which are in different states (starting,
running, paused, stopped, destroyed).

• Package Manager: keeps track of which applications are installed in


your device. Allows an application to request installation of
packages.. Allows an app to see all installed package
• Window Manager : - It is responsible for organizing the
screen. It allocates surface and decide where
they(Applications) go and how they are layered. At
create surface for all the applications
About Android SDK
• Android SDK is a collection of libraries and Software
Development tools that are essential for Developing
Android Applications.

Whenever Google releases a new version or update of Android


Software, a corresponding SDK also releases with it
Below are the SDK developer tools:
1. Android SDK Build tool.

The main functions of Android SDK Build tools are built,


debug, run and test Android applications. The latest version
of the Android SDK Build tool is 30.0.3.

2. Android Emulator.

• Android Emulator. In Android Emulator the virtual android


device is shown on our system on which we run the Android
application that we code.

• The emulator’s come with the configuration for Various


android phones, tablets, Wear OS, and Android TV devices.
3. Android SDK Platform-tools

• Android SDK Platform-tools is helpful when we are working on


Project and they will show the error messages at the same
time. It is specifically used for testing. It includes:

• Android Debug Bridge (ADB), is a command-line tool that


helps to communicate with the device. It allows us to perform
an action such as Installing App and Debugging App etc.
• Gradle Sync is a Gradle task who’s main function is to check
all the dependencies in your build.
• Gradle files which are associated with your Android studio
project and then download that specified version (if not
downloaded already).
AVD (Android virtual device
manager )
Installation of Android studio guide
USING THE ANDROID EMULATOR

The Android emulator is used for testing and debugging applications before they are
loaded onto a real handset
Android emulator is typically used for deploying apps that are developed in your IDE
without actually installing it in a mobile

Example: Bluestack
Limitations of the Android Emulator

 Emulator doesn’t reveal the information like memory, CPU, or other


physical limitation
 SMS messages are also simulated and do not use a real network.

Phone calls cannot be placed or received but are simulated

 No support for device-attached headphones is available.

 Peripherals such as camera/video capture are not fully functional

. No USB or Bluetooth support is available


Anatomy of android
The various folders and their files are as follows:

• src — Contains the file, MainActivity.java. It is the source file for


your activity. You will write the code for your application in this file.

• Android 4.4.2 — This item contains one file, android.jar, which


contains all the class libraries needed for an Android application.

• gen — Contains the R.java file, a compiler-generated file that


references all the resources found in your project. You should not
modify this file.
• assets — This folder contains all the assets used by your application, such
as HTML, text files, databases, etc.

• res — This folder contains all the resources used in your application. It
also contains a few other subfolders:

• drawable - <resolution>: All the image files to be used by the Android


application must be stored here.

• layout - contains activity_main.xml file, which the is GUI of the application.

• values - contains files like strings.xml, styles.xml that are need for storing
the string variables used in the applications, creating style-sheets etc.
• AndroidManifest.xml — This is the manifest file for your
Android application. Here you specify the permissions needed
by your application, as well as other features for example
sending messages and email
U S IN G T H E T E X T V IE WC O N T R O L

• TEXTVIEW control are the View components which are used to design the user
interface of an application

• we have a wide variety of UI or input controls available, those are TextView, EditText,
Buttons, Checkbox, Progressbar, Spinners, etc.

• In android, Text View is a user interface control which is used to set and display the text
to the user based on our requirements.

• The TextView control will act as like label control and it won’t allow users to edit the
text.

• Example of TextView control usage would be to display textual labels for other controls,
like "Enter a Date:", "Enter a Name:" or "Enter a Password:".
Specific attributes of Text View controls you will want to be aware of:

Give the TextView control a unique name using the id

property

Set the text displayed within the TextView control using the

text property using setText() method.

Set the layout height and layout width properties of the

control as appropriate.
• By default, text contents of a TextView control are left-aligned. However, you
can position the text using the gravity attribute
android: gravity="center”

• Set any other attributes you desire to adjust the control’s appearance. For
example, adjust the text size, color, font or other style settings.

android:textColor="#ff0000”

android:textStyle="bold"

android:typeface="monospace"
• By default, any text contents within a TextView control is displayed as
plain text. However, by setting one simple attribute called autoLink,
all you can enable automatic detection of web, email, phone and
address information within the text. In XML, this property would
appear within your TextView control as:

• android:autoLink="all"

You might also like