0% found this document useful (0 votes)
96 views25 pages

Unit 4 Android

Android is an open-source, Linux-based operating system for mobile devices and smart TVs. It is developed by Google and the Open Handset Alliance. Android uses Java for application development and includes key apps, APIs, and middleware in its software stack. Popular versions include KitKat, Lollipop, and Oreo. Android powers many smartphones, tablets, and other devices.

Uploaded by

Arun
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)
96 views25 pages

Unit 4 Android

Android is an open-source, Linux-based operating system for mobile devices and smart TVs. It is developed by Google and the Open Handset Alliance. Android uses Java for application development and includes key apps, APIs, and middleware in its software stack. Popular versions include KitKat, Lollipop, and Oreo. Android powers many smartphones, tablets, and other devices.

Uploaded by

Arun
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/ 25

1

Introduction
Android is a complete set of software for mobile devices such as tablet
computers, notebooks, smartphones, electronic book readers, set-top boxes
etc.
It contains a linux-based Operating System, middleware and key mobile
applications.
It can be thought of as a mobile operating system. But it is not limited to
mobile only. It is currently used in various devices such as mobiles, tablets,
televisions etc.

What is Android?
Android is a software package and linux based operating system for mobile
devices such as tablet computers and smartphones.
It is developed by Google and later the OHA (Open Handset Alliance). Java
language is mainly used to write the android code even though other
languages can be used.
The goal of android project is to create a successful real-world product that
improves the mobile experience for end users.
There are many code names of android such as Lollipop, Kitkat, Jelly Bean, Ice
cream Sandwich, Froyo, Ecliar, Donut etc
Features of Android
After learning what is android, let's see the features of android. The important
features of android are given below:
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, opening screen,
live RSS (Really Simple Syndication) feeds etc.
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.
Categories of Android applications
There are many android applications in the market. The top categories are:
o Entertainment
o Tools
o Communication
o Productivity
o Personalization
2

o Music and Audio


o Social
o Media and Video
o Travel and Local etc.
History of Android
The history and versions of android are interesting to know. The code names
of android ranges from A to J currently, such
as Aestro, Blender, Cupcake, Donut, Eclair, Froyo, Gingerbread, Honeycom
b, Ice Cream Sandwitch, Jelly Bean, KitKat and Lollipop. Let's understand
the android history in a sequence.
1) Initially, Andy Rubin founded Android Incorporation in Palo Alto, California,
United States in October, 2003.
2) In 17th August 2005, Google acquired android Incorporation. Since then, it
is in the subsidiary of Google Incorporation.
3) The key employees of Android Incorporation are Andy Rubin, Rich
Miner, Chris White and Nick Sears.How to find Nth Highest Salary in SQL
4) Originally intended for camera but shifted to smart phones later because of
low market for camera only.
5) Android is the nick name of Andy Rubin given by coworkers because of his
love to robots.
6) In 2007, Google announces the development of android OS.
7) In 2008, HTC launched the first android mobile.
Android Versions, Codename and API
Let's see the android versions, codenames and API Level provided by Google.

Version Code name API Level

1.5 Cupcake 3

1.6 Donut 4

2.1 Eclair 7

2.2 Froyo 8

2.3 Gingerbread 9 and 10

3.1 and 3.3 Honeycomb 12 and 13


3

4.0 Ice Cream Sandwitch 15

4.1, 4.2 and 4.3 Jelly Bean 16, 17 and 18

4.4 KitKat 19

5.0 Lollipop 21

6.0 Marshmallow 23

7.0 Nougat 24-25

8.0 Oreo 26-27

Android Architecture
android architecture or Android software stack is categorized into five
parts:
1. linux kernel
2. native libraries (middleware),
3. Android Runtime
4. Application Framework
5. Applications

Let's see the android architecture first.


4

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.
2) Native Libraries
On the top of linux kernel, their are Native libraries such as WebKit, OpenGL,
FreeType, SQLite, Media, C runtime library (libc) etc.Hello Java Program for
Beginners
The WebKit library is responsible for browser support, SQLite is for database,
FreeType for font support, Media for playing and recording audio and video
formats.
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.
5

4) Android Framework
On the top of Native libraries and android runtime, there is android
framework. Android framework includes Android API's such as UI (User
Interface), telephony, resources, locations, Content Providers (data) and
package managers. It provides a lot of classes and interfaces for android
application development.
5) Applications
On the top of android framework, there are 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 are
using linux kernal.

Android Core Building Blocks


An android component is simply a piece of code that has a well defined life
cycle e.g. Activity, Receiver, Service etc.
The core building blocks or fundamental components of android are
activities, views, intents, services, content providers, fragments and
AndroidManifest.xml.
1. Activity
An activity is a class that represents a single screen. It is like a Frame in AWT.
2. View
A view is the UI element such as button, label, text field etc. Anything that you
see is a view.
3. Intent
Intent is used to invoke components. It is mainly used to:
o Start the service
o Launch an activity
o Display a web page
o Display a list of contacts
o Broadcast a message
o Dial a phone call etc.
For example, you may write the following code to view the webpage.
a) Intent intent=new Intent(Intent.ACTION_VIEW);  
b) intent.setData(Uri.parse("http://www.javatpoint.com"));  
c) startActivity(intent);  
4. Service
Service is a background process that can run for a long time.
6

There are two types of services local and remote. Local service is accessed
from within the application whereas remote service is accessed remotely from
other applications running on the same device.
5. Content Provider
Content Providers are used to share data between the applications.
6. Fragment
Fragments are like parts of activity. An activity can display one or more
fragments on the screen at the same time.
7. AndroidManifest.xml
It contains informations about activities, content providers, permissions etc. It
is like the web.xml file in Java EE.
8. Android Virtual Device (AVD)
It is used to test the android application without the need for mobile or tablet
etc. It can be created in different configurations to emulate different types of
real devices.

Android Emulator
The Android emulator is an Android Virtual Device (AVD), which represents
a specific Android device. We can use the Android emulator as a target device
to execute and test our Android application on our PC. 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
Testing Android applications on emulator are sometimes faster and easier
than doing on a real device. For example, we can transfer data faster to the
emulator than to a real device connected through USB.
The Android emulator comes with predefined configurations for several
Android phones, Wear OS, tablet, Android TV devices.
Requirement and recommendations
The Android emulator takes additional requirements beyond the basic system
requirement for Android Studio. These requirements are given below:
o SDK Tools 26.1.1 or higher
o 64-bit processor
o Windows: CPU with UG (unrestricted guest) support
o HAXM 6.2.1 or later (recommended HAXM 7.2.0 or later)
Install the emulator
The Android emulator is installed while installing the Android Studio. However
some components of emulator may or may not be installed while installing
7

Android Studio. To install the emulator component, select the Android


Emulator component in the SDK Tools tab of the SDK Manager.

Android Widgets
There are given a lot of android widgets with simplified examples such as
Button, EditText, AutoCompleteTextView, ToggleButton, DatePicker,
TimePicker, ProgressBar etc.
Android widgets are easy to learn. The widely used android widgets with
examples are given below:
Android Button
Let's learn how to perform event handling on button click.
Android Toast
Displays information for the short duration of time.00:00/11:48
Custom Toast
We are able to customize the toast, such as we can display image on the toast
ToggleButton
It has two states ON/OFF.
CheckBox
Let's see the application of simple food ordering.
AlertDialog
AlertDialog displays a alert dialog containing the message with OK and Cancel
buttons.
Spinner
Spinner displays the multiple options, but only one can be selected at a time.
AutoCompleteTextView
Let's see the simple example of AutoCompleteTextView.
RatingBar
RatingBar displays the rating bar.
DatePicker
Datepicker displays the datepicker dialog that can be used to pick the date.
TimePicker
TimePicker displays the timepicker dialog that can be used to pick the time.
ProgressBar
ProgressBar displays progress task.
8

Activity and Intents

Android Activity Lifecycle


Let's see the 7 lifecycle methods of android activity.

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.


9

Android Intent

Android Intent is the message that is passed between components such as


activities, content providers, broadcast receivers, services etc.
It is generally used with startActivity() method to invoke activity, broadcast
receivers etc.
10

The dictionary meaning of intent is intention or purpose. So, it can be


described as the intention to do action.
The LabeledIntent is the subclass of android.content.Intent class.
Android intents are mainly used to:
o Start the service
o Launch an activity
o Display a web page
o Display a list of contacts
o Broadcast a message
o Dial a phone call etc.
Types of Android Intents
There are two types of intents in android: implicit and explicit.
1) Implicit Intent
Implicit Intent doesn't specifiy the component. In such case, intent provides
information of available components provided by the system that is to be
invoked.
For example, you may write the following code to view the webpage.
1. Intent intent=new Intent(Intent.ACTION_VIEW);  
2. intent.setData(Uri.parse("http://www.javatpoint.com"));  
3. startActivity(intent);  
2) Explicit Intent
Android Explicit intent specifies the component to be invoked from activity.
In other words, we can call another activity in android by explicit intent.
We can also pass the information from one activity to another using explicit
intent.
1. Intent i = new Intent(getApplicationContext(), ActivityTwo.class);  
2. startActivity(i);  

Android Fragments:
Android Fragment is the part of activity, it is also known as sub-activity. There
can be more than one fragment in an activity. Fragments represent multiple
screen inside one activity.
Android fragment lifecycle is affected by activity lifecycle because fragments
are included in activity.
Each fragment has its own life cycle methods that is affected by activity life
cycle because fragments are embedded in activity.
11

The FragmentManager class is responsible to make interaction between


fragment objects.
11.5M
203Third-Party Call Recording Apps To Be Banned From Google Play Store
Android Fragment Lifecycle:
The lifecycle of android fragment is like the activity lifecycle. There are 12
lifecycle methods for fragment.
12

Android Fragment Lifecycle Methods:


No. Method Description

1) onAttach(Activity) it is called only once when it is attached


with activity.

2) onCreate(Bundle) It is used to initialize the fragment.

3) onCreateView(LayoutInflater, creates and returns view hierarchy.


ViewGroup, Bundle)

4) onActivityCreated(Bundle) It is invoked after the completion of


onCreate() method.

5) onViewStateRestored(Bundle) It provides information to the fragment that


all the saved state of fragment view
hierarchy has been restored.

6) onStart() makes the fragment visible.

7) onResume() makes the fragment interactive.

8) onPause() is called when fragment is no longer


interactive.

9) onStop() is called when fragment is no longer visible.

10) onDestroyView() allows the fragment to clean up resources.

11) onDestroy() allows the fragment to do final clean up of


fragment state.

12) onDetach() It is called immediately prior to the


fragment no longer being associated with
its activity.

Android Menu :
13

1. Option Menu
Android Option Menus are the primary menus of android. They can be used
for settings, search, delete item etc.
Here, we are going to see two examples of option menus. First, the simple
option menus and second, options menus with images.
Here, we are inflating the menu by calling the inflate() method
of MenuInflater class. To perform event handling on menu items, you need to
override onOptionsItemSelected() method of Activity class.
2. Context Menu
Android context menu appears when user press long click on the element. It is
also known as floating menu.
It affects the selected content while doing action on it.
It doesn't support item shortcuts and icons.
3. Popup Menu
Android Popup Menu displays the menu below the anchor text if space is
available otherwise above the anchor text. It disappears if you click outside the
popup menu.
The android.widget.PopupMenu is the direct subclass of java.lang.Object class.
Android Service :

Android service is a component that is used to perform operations on the


background such as playing music, handle network transactions, interacting
content providers etc. It doesn't has any UI (user interface).
The service runs in the background indefinitely even if application is
destroyed.
Moreover, service can be bounded by a component to perform interactivity
and inter process communication (IPC).
The android.app.Service is subclass of ContextWrapper class.
Life Cycle of Android Service:
There can be two forms of a service.The lifecycle of service can follow two
different paths: started or bound.
1. Started
14

2. Bound
1) Started Service
A service is started when component (like activity) calls startService() method,
now it runs in the background indefinitely. It is stopped
by stopService() method. The service can stop itself by calling
the stopSelf() method.
2) Bound Service
A service is bound when another component (e.g. client)
calls bindService() method. The client can unbind the service by calling
the unbindService() method.
The service cannot be stopped until all clients unbind the service.

Understanding Started and Bound Service by background music


example
Suppose, I want to play music in the background, so call startService() method.
But I want to get information of the current song being played, I will bind the
service that provides information about the current song.
15

Android SQLite :
SQLite is an open-source relational database i.e. used to perform database
operations on android devices such as storing, manipulating or retrieving
persistent data from the database.
It is embedded in android bydefault. So, there is no need to perform any
database setup or administration task.
Here, we are going to see the example of sqlite to store and fetch the data.
Data is displayed in the logcat. For displaying data on the spinner or listview,
move to the next page.
SQLiteOpenHelper class provides the functionality to use the SQLite
database.
SQLiteOpenHelper class:
The android.database.sqlite.SQLiteOpenHelper class is used for database
creation and version management. For performing any database operation,
you have to provide the implementation
of onCreate() and onUpgrade() methods of SQLiteOpenHelper class.
Constructors of SQLiteOpenHelper class
There are two constructors of SQLiteOpenHelper class.

Constructor Description

SQLiteOpenHelper(Context context, String creates an object for creating, opening


name, SQLiteDatabase.CursorFactory and managing the database.
factory, int version)

SQLiteOpenHelper(Context context, String creates an object for creating, opening


name, SQLiteDatabase.CursorFactory and managing the database. It specifies
factory, int version, DatabaseErrorHandler the error handler.
errorHandler)

Methods of SQLiteOpenHelper class

Method Description

public abstract void onCreate(SQLiteDatabase called only once when database


db) is created for the first time.
16

public abstract void called when database needs to


onUpgrade(SQLiteDatabase db, int oldVersion, be upgraded.
int newVersion)

public synchronized void close () closes the database object.

public void onDowngrade(SQLiteDatabase db, called when database needs to


int oldVersion, int newVersion) be downgraded.

Android JSON Parser:


JSON (Javascript Object Notation) is a programming language . It is minimal,
textual, and a subset of JavaScript. It is an alternative to XML.
Android provides support to parse the JSON object and array.
Advantage of JSON over XML
1) JSON is faster and easier than xml for AJAX applications.
2) Unlike XML, it is shorter and quicker to read and write.E
3) It uses array.

json object:
A JSON object contains key/value pairs like map. The keys are strings and the
values are the JSON types. Keys and values are separated by comma. The
{ (curly brace) represents the json object.
1. {  
2.     "employee": {  
3.         "name":       "sachin",   
4.         "salary":      56000,   
5.         "married":    true  
6.     }  
7. }  
json array:
The [ (square bracket) represents the json array.
1. ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday
"]  
Let's take another example of json array.
1. { "Employee" :  
2.     [  
17

3.      {"id":"101","name":"Sonoo Jaiswal","salary":"50000"},  
4.      {"id":"102","name":"Vimal Jaiswal","salary":"60000"}  
5.     ]   
6. }  

Android Speech:
A. Text to Speech
In android, you can convert your text into speech by the help
of TextToSpeech class. After completion of the conversion, you can playback
or create the sound file.
Constructor of TextToSpeech class:
TextToSpeech(Context context, TextToSpeech.OnInitListener)
Methods of TextToSpeech class:
The commonly used methods of TextToSpeech class are as follows:

Method Description

int speak (String text, int converts the text into speech. Queue Mode may be
queueMode, HashMap params) QUEUE_ADD or QUEUE_FLUSH. Request parameters
can be null, KEY_PARAM_STREAM,
KEY_PARAM_VALUME etc.

int setSpeechRate(float speed) it sets the speed for the speech.

int setPitch(float speed) it sets the pitch for the speech.

int setLanguage (Locale loc) it sets the locale specific language for the speech.

void shutdown() it releases the resource set by TextToSpeech Engine.

int stop() it interrupts the current utterance (whether played or


rendered to file) and discards other utterances in the
queue.
18

TextToSpeech.OnInitListener Interface
You need to implement TextToSpeech.OnInitListener interface, for performing
event handling on TextToSpeech engine.
Method of TextToSpeech.OnInitListener Interface
There is only one method in this interface.6Montinue Explosive Growth

Method Description

void onInit (int Called to signal the completion of the TextToSpeech engine
status) initialization. The status can be SUCCESS or ERROR.

B. MediaPlayer class
The android.media.MediaPlayer class is used to control the audio or video
files.
Methods of MediaPlayer class:
There are many methods of MediaPlayer class. Some of them are as
follows:Difference between JDK, JRE, and JVM

Method Description

public void setDataSource(String path) sets the data source (file path or
http url) to use.

public void prepare() prepares the player for playback


synchronously.

public void start() it starts or resumes the playback.

public void stop() it stops the playback.

public void pause() it pauses the playback.

public boolean isPlaying() checks if media player is playing.

public void seekTo(int millis) seeks to specified time in


miliseconds.

public void setLooping(boolean looping) sets the player for looping or non-
looping.
19

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


non-looping.

public void selectTrack(int index) it selects a track for the specified


index.

public int getCurrentPosition() returns the current playback


position.

public int getDuration() returns duration of the file.

public void setVolume(float leftVolume,float sets the volume on this player.


rightVolume)

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

Method Description

public void setMediaController(MediaController sets the media controller to


controller) the video view.

public void setVideoURI (Uri uri) sets the URI of the video file.

public void start() starts the video view.

public void stopPlayback() stops the playback.

public void pause() pauses the playback.


20

public void suspend() suspends the playback.

public void resume() resumes the playback.

public void seekTo(int millis) seeks to specified time in


miliseconds.

D. MediaRecorder class:
MediaRecorder class can be used to record audio and video files.
After recording the media, we can create a sound file that can be played later.
In this example, we are going to record the audio file and storing it in the
external directory in 3gp format.
Android Telephony:
Android TelephonyManager Class
The android.telephony.TelephonyManager class provides information about
the telephony services such as subscriber id, sim serial number, phone network
type etc. Moreover, you can determine the phone state etc.
Android Call State
We can also get the information of call state using
the TelephonyManager class. For this purpose, we need to call the listen
method of TelephonyManager class by passing the PhonStateListener
instance.
The PhoneStateListener interface must be implemented to get the call state.
It provides one method onCallStateChanged().

How to make a phone call in android?


We are able to make a phone call in android via intent. You need to write only
three lines of code to make a phone call.
1. Intent callIntent = new Intent(Intent.ACTION_CALL);  
2. callIntent.setData(Uri.parse("tel:"+8802177690));//change the number  
3. startActivity(callIntent);
  

How to send SMS in android?


We can send sms in android via intent. You need to write only 4 lines of code
the send sms in android.
1. //Getting intent and PendingIntent instance  
21

2. Intent intent=new Intent(getApplicationContext(),MainActivity.class);  
3. PendingIntent pi=PendingIntent.getActivity(getApplicationContext(), 0, intent,
0);   
4. //Get the SmsManager instance and call the sendTextMessage method to sen
d message                 
5. SmsManager sms=SmsManager.getDefault();  
6. sms.sendTextMessage("8802177690", null, "hello javatpoint", pi,null);  

How to send email in android using intent?


We can easily send email in android via intent. You need to write few lines of
code only as given below
1. Intent email = new Intent(Intent.ACTION_SEND);  
2. email.putExtra(Intent.EXTRA_EMAIL, new String[]{ to});  
3. email.putExtra(Intent.EXTRA_SUBJECT, subject);  
4. email.putExtra(Intent.EXTRA_TEXT, message);  
      
5. //need this to prompts email client only  
6. email.setType("message/rfc822");  
 
7. startActivity(Intent.createChooser(email, "Choose an Email client :"));  
Android Google Map:
Android provides facility to integrate Google map in our application. Google
map displays your current location, navigate location direction, search location
etc. We can also customize Google map according to our requirement.
Types of Google Maps:
There are four different types of Google maps, as well as an optional to no
map at all. Each of them gives different view on map. These maps are as
follow:
1. Normal: This type of map displays typical road map, natural features
like river and some features build by humans.
2. Hybrid: This type of map displays satellite photograph data with typical
road maps. It also displays road and feature labels.
3. Satellite: Satellite type displays satellite photograph data, but doesn't
display road and feature labels.
22

4. Terrain: This type displays photographic data. This includes colors,


contour lines and labels and perspective shading.
5. None: This type displays an empty grid with no tiles loaded.

Syntax of different types of map


1. googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);  
2. googleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);  
3. googleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);  
4. googleMap.setMapType(GoogleMap.MAP_TYPE_TERRAIN);  

Methods of Google map:


Google map API provides several methods that help to customize Google
map. These methods are as following:

Methods Description

addCircle(CircleOptions options) This method add circle to map.

addPolygon(PolygonOptions options) This method add polygon to map.

addTileOverlay(TileOverlayOptions options) This method add tile overlay to the map.

animateCamera(CameraUpdate update) This method moves the map according


to the update with an animation.

clear() This method removes everything from


the map.

getMyLocation() This method returns the currently


displayed user location.

moveCamera(CameraUpdate update) This method reposition the camera


according to the instructions defined in
the update.

setTrafficEnabled(boolean enabled) This method set the traffic layer on or off.

snapshot(GoogleMap.SnapshotReadyCallback This method takes a snapshot of the


23

callback) map.

stopAnimation() This method stops the camera animation


if there is any progress.

Design Patterns in Java:


A design patterns are well-proved solution for solving the specific
problem/task.
Now, a question will be arising in your mind what kind of specific problem? Let
me explain by taking an example.
Problem Given:
Suppose you want to create a class for which only a single instance (or object)
should be created and that single object can be used by all other classes.
Solution:
Singleton design pattern is the best solution of above specific problem. So,
every design pattern has some specification or set of rules for solving the
problems. What are those specifications, you will see later in the types of
design patterns.

But remember one-thing, design patterns are programming language


independent strategies for solving the common object-oriented design
problems. That means, a design pattern represents an idea, not a particular
implementation.
By using the design patterns you can make your code more flexible, reusable
and maintainable. It is the most important part because java internally follows
design patterns.
To become a professional software developer, you must know at least some
popular solutions (i.e. design patterns) to the coding problems.
Advantage of design pattern:
1. They are reusable in multiple projects.
2. They provide the solutions that help to define the system architecture.
3. They capture the software engineering experiences.
4. They provide transparency to the design of an application.
5. They are well-proved and testified solutions since they have been built
upon the knowledge and experience of expert software developers.
24

6. Design patterns don?t guarantee an absolute solution to a problem.


They provide clarity to the system architecture and the possibility of
building a better system.
When should we use the design patterns?
We must use the design patterns during the analysis and requirement
phase of SDLC(Software Development Life Cycle).
Design patterns ease the analysis and requirement phase of SDLC by
providing information based on prior hands-on experiences.
Categorization of design patterns:
Basically, design patterns are categorized into two parts:
1. Core Java (or JSE) Design Patterns.
2. JEE Design Patterns.
Core Java Design Patterns
In core java, there are mainly three types of design patterns, which are further
divided into their sub-parts:
1. Creational Design Pattern
1. Factory Pattern
2. Abstract Factory Pattern
3. Singleton Pattern
4. Prototype Pattern
5. Builder Pattern.
2. Structural Design Pattern
1. Adapter Pattern
2. Bridge Pattern
3. Composite Pattern
4. Decorator Pattern
5. Facade Pattern
6. Flyweight Pattern
7. Proxy Pattern
3. Behavioral Design Pattern
1. Chain Of Responsibility Pattern
2. Command Pattern
3. Interpreter Pattern
4. Iterator Pattern
25

5. Mediator Pattern
6. Memento Pattern
7. Observer Pattern
8. State Pattern
9. Strategy Pattern
10.Template Pattern
11.Visitor Pattern

You might also like