[go: up one dir, main page]

0% found this document useful (0 votes)
26 views4 pages

Unit 4

ds

Uploaded by

amitrajput82871
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)
26 views4 pages

Unit 4

ds

Uploaded by

amitrajput82871
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/ 4

ANDROID- 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 linux-based
OS, middleware & 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. 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. HISTORY-
Initially, Andy Rubin founded Android Incorporation in Palo Alto, California, United States in
October, 2003. In 17th August 2005, Google acquired android Incorporation. Since then, it is in the
subsidiary of Google Incorporation. The key employees of Android Incorporation are Andy
Rubin, Rich Miner, Chris White & Nick Sears. Originally intended for camera but shifted to smart
phones later because of low market for camera only. Android is the nick name of Andy Rubin given
by co-workers because of his love to robots. In 2007, Google announces the development of
android OS. In 2008, HTC launched the first android mobile. ARCHITECTURE- It has 5 Parts: 1.Linux
Kernal- 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 & 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. The WebKit
library is responsible for browser support, SQLite is for database, FreeType for font support, Media
for playing & recording audio & 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. 4.Application 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) & package managers. It provides lot of
classes & interfaces for android application development. 5. Application- 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. 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. ACTIVITY- An activity is a class that represents a
single screen. It is like a Frame in AWT. VIEW- A view is the UI element such as button, label, text
field etc. Anything that you see is a view. INTENT- Intent is used to invoke components. It is mainly
used to Start the service, Launch an activity, Display a web page, Display a list of contacts,
Broadcast a message, Dial a phone call etc SERVICE- Service is a background process that can run
for a long time. 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. CONTENT PROVIDER- Content Providers are used to share data
between the applications. FRAGMENT- Fragments are like parts of activity. An activity can display
one or more fragments on the screen at the same time. ANDROIDMANIFEST.XML- It contains
informations about activities, content providers, permissions etc. It is like the web.xml file in Java
EE. ANDROID VIRTUAL DEVICE- 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: It 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.

DESIGN PATTERNS-They are well-proved solutions for solving the specific problem/task. 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 &
maintainable. It is the most important part because java internally follows design patterns.
ADVANTAGES- They are reusable in multiple projects. They provide the solutions that help to
define the system architecture. They capture the software engineering experiences. They provide
transparency to the design of an application. They are well-proved & testified solutions since they
have been built upon the knowledge & experience of expert software developers. USAGE: We
must use the design patterns during the analysis & requirement phase of SDLC. Design patterns
ease the analysis & requirement phase of SDLC by providing information based on prior hands-on
experiences.
TYPES: Core Java Design Patterns- 1.Creational Design Pattern- They are concerned with the way
of creating objects. These design patterns are used when a decision must be made at the time of
instantiation of a class. Hard-Coded code is not the good programming approach. Here, we are
creating the instance by using the new keyword. Sometimes, the nature of the object must be
changed according to the nature of the program. In such cases, we must get the help of creational
design patterns to provide more general & flexible approach. i. Singleton Design Pattern- It is a
creational design pattern that restricts the number of objects of a class. It ensures that there is
only one instance of the class in the JVM. It is very simple design pattern but we need to
implement it, there are a lot of implementation concerns. Singleton pattern allows an application
to have one & only one instance or object of a class per JVM. ii. Factory Design Pattern- It is useful
when we have a super class with multiple subclasses & we need to return one of the sub-class
based on the input. We can apply a singleton design pattern on the factory class or declare the
factory method as static. A factory design pattern is more suitable when there is an involvement of
complex object creation steps. The factory pattern ensures that these steps work in a centralized
manner & not exposed to composing classes. iii. Java Prototype Pattern- It is useful when the
process of object creation is very costly & time consuming. So using this pattern we can copy the
original object to a new object & then change it according to our requirements. This pattern uses a
Java cloning mechanism to copy the object. 2. Structural Design Pattern- They are concerned with
how classes & objects can be composed, to form larger structures. It simplifies the structure by
identifying the relationships. These patterns focus on, how the classes inherit from each other &
how they are composed from other classes. i. Proxy Pattern- Simply, proxy means an object
representing another object. According to GoF, a Proxy Pattern "provides the control for accessing
the original object". So, we can perform many operations like hiding the information of original
object, on dem& loading etc. Proxy pattern is also known as Surrogate or Placeholder. It provides
the protection to the original object from the outside world. ii. Flyweight Pattern- Flyweight
Pattern says that just "to reuse already existing similar kind of objects by storing them & create
new object when no matching object is found". It reduces the number of objects. It reduces the
amount of memory & storage devices required if the objects are persisted. It is used When an
application uses number of objects. It is used When the storage cost is high because of the
quantity of objects. It is used When the application does not depend on object identity. iii. Facade
Pattern- A Facade Pattern says that just "just provide a unified & simplified interface to a set of
interfaces in a subsystem, therefore it hides the complexities of the subsystem from the client". In
other words, Facade Pattern describes a higher-level interface that makes the sub-system easier to
use. Practically, every Abstract Factory is a type of Facade. It shields the clients from the
complexities of the sub-system components. It promotes loose coupling between subsystems & its
clients. It is used When you want to provide simple interface to a complex sub-system. It is used
when several dependencies exist between clients & the implementation classes of an abstraction.
3.Behavioral Design Pattern- Behavioral design patterns are concerned with the interaction and
responsibility of objects. In these design patterns, the interaction between the objects should be in
such a way that they can easily talk to each other and still should be loosely coupled. That means
the implementation and the client should be loosely coupled in order to avoid hard coding and
dependencies. i. Template Pattern- A Template Pattern says that "just define the skeleton of a
function in an operation, deferring some steps to its subclasses". It is very common technique for
reusing the code. This is only the main benefit of it. It is used when the common behavior among
sub-classes should be moved to a single common class by avoiding the duplication. ii. Observer
Pattern- An Observer Pattern says that "just define a one-to-one dependency so that when one
object changes state, all its dependents are notified and updated automatically". The observer
pattern is also known as Dependents or Publish-Subscribe. It describes the coupling between the
objects and the observer. It provides the support for broadcast-type communication. iii. Strategy
Pattern- A Strategy Pattern says that "defines a family of functionality, encapsulate each one, and
make them interchangeable". The Strategy Pattern is also known as Policy. It provides a substitute
to subclassing. It defines each behavior within its own class, eliminating the need for conditional
statements. It makes it easier to extend & incorporate new behavior without changing application.
iv. Command Pattern- A Command Pattern says that "encapsulate a request under an object as a
command and pass it to invoker object. Invoker object looks for the appropriate object which can
handle this command and pass the command to the corresponding object and that object executes
the command". It is also known as Action or Transaction. It separates the object that invokes the
operation from the object that actually performs the operation. It makes easy to add new
commands, because existing classes remain unchanged. When you need parameterize objects
according to an action perform. When you need to create and execute requests at different times.
When you need to support rollback, logging or transaction functionality. v. State Pattern- A State
Pattern says that "the class behavior changes based on its state". In State Pattern, we create
objects which represent various states and a context object whose behavior varies as its state
object changes. The State Pattern is also known as Objects for States. It keeps the state-specific
behavior. It makes any state transitions explicit. Usage- When the behavior of object depends on
its state and it must be able to change its behavior at runtime according to the new state. It is used
when the operations have large, multipart conditional statements that depend on the state of an
object.
J2EE DESIGN PATTERN- They are built for the developing the Enterprise Web-based Apps.
TYPES: 1. Presentation Layer Design Pattern- i. Intercepting Filter Pattern - An Intercepting Filter
Pattern says that "if you want to intercept and manipulate a request and response before and after
the request is processed". It provides central control with loosely coupled handlers. It improves
reusability. Usage- When you want centralization, common processing across requests, such as
logging information about each request, compressing an outgoing response or checking the data
encoding scheme of each request. When you want pre and post processing the components which
are loosely coupled with core request-handling services to facilitate which are not suitable for
addition and removal. ii. Front Controller Pattern- A Front Controller Pattern says that if you want
to provide the centralized request handling mechanism so that all the requests will be handled by
a single handler". This handler can do the authentication or authorization or logging or tracking of
request and then pass the requests to corresponding handlers. It reduces the duplication of code
in JSP pages, especially in those cases where several resources require the same processing. It
maintains and controls a web application more effectively. A web application of two-tier
architecture, the recommended approach is front controller to deal with user requests. Usage-
When you want to control the page flow and navigation. When you want to access and manage
the data model. When you want to handle the business processing. 2.Business Layer Design
Pattern 3.Integration Layer Design Pattern.

You might also like