As an Android developer, it's
good to have at least a basic understanding of
the architecture of the operating system and the rest of the platform. The
base of Android is a Kernel that's built around Linux. It's
a version of Linux that's highly optimized
for mobile operating systems made as small as
possible so that it works well on devices
that have very seriously constrained CPU and memory
capabilities. On
top of the Kernel is the Android Runtime.
And a set of libraries that enable the
behavior of the operating system itself. The
next level is the Application Framework which sits on
top of the Android Runtime and the associated libraries. And
then finally, at the top are the apps including
those that are included with the operating system. And
custom apps, that you might download from
the Google Play store or build yourself. Let's
break down each of these layers. The
Linux Kernel, again, starts with Linux itself, but
then also has a set of drivers.
And each driver is designed to interface with
an element of the hardware. A
phone, or a tablet for example. You'll
have drivers for audio, camera,
display, the keypad, to manage flash memory, power, wi-fi, and so on. It's
up to the OEMs, that is, the manufacturers of the devices themselves, to
customize these drivers, and make them work for those devices. So
if you're holding an Android device in your hand, the version
of Android that's on that device will be a combination of
what Google delivers and what the vendor delivers.
The next layer is the Android Runtime. And
this includes a setup of core libraries
and critically, the Dalvik virtual machine. . The
Dalvik virtual machine or JVM, replaces the
JVM that's used in conventional Java-based applications. Dalvik,
again, is highly optimized for very small
devices. And
the byte code that it reads is different in many ways
from the byte code that's generated by conventional Java compilers.
So, to get Dalvik byte code ,you have to use the
Dalvik compatible compiler that's included with the Android developer tools. The
associated libraries include libraries to manage
all sorts of features of Android, including
graphics, databases, encryption, typefaces, and so on. These
libraries work at the same level of the software
stack as the core Runtime, but they're expandable. And
so, device makers can add their own libraries to this layer.
The next level is the application framework. And
it has modules for controlling all the different
components of your apps. Including
activities, which represent the screens that the
user sees, content providers, to manage data and
move that data between apps, locations, notifications,
windows, resources, telephone management, and so on. And
finally there are the apps. Each
version of Android has been delivered with an expanded set
of included apps, but at minimum, every version of Android has had a home screen,
a browser, contact management, phone management, and a few other things.
As of the most recent version of Android,
Android 4.4
or Kit-kat, there's a full productivity suite now included. So
more and more new apps are included with each new version of
the operating system, but you can add as many apps to this layer as you want. Once
again including both those apps that you can get from
the store, but also the apps that you build yourself. As
a developer, you'll be putting together your apps based on components.
And there are four major types of components
that you'll be working with. Activities
are the screens themselves. This
is what the users sees. A
single activity can either take up an entire screen or a portion of a screen. As
you'll see in a moment, an activity is represented by a Java class in your programming,
but what the user sees is just an application screen. A
widget is a smaller component. Each
widget can be used to manage display and user interactivity and either to
display or to collect data.
But if you take many widgets put together, you
end up with a screen. And
you'll see how activities use layouts, and how layouts use widgets. Services
are a special kind of component that perform background jobs. Services,
by their nature, are invisible. The
user doesn't see them, but they can run in the background even while the
user is running an app in the foreground. And
broadcast receivers can react to system messages. Messages
that are dispatched by the operating system and by other apps.
Each component in an Android app is
implemented as a Java class. You'll
have both the Java classes that are included in
the SDK, and your own custom Java classes. Here's
an example.As I've previously mentioned, an activity represents a screen or a
portion of
a screen in an Android app, and it's an instance of a Java class named
android.app.activity. And
here's another example: a button.
When you add a button to a screen, it's
because you want
the user to be able to touch or click it. And
a button in Android is an instance of a Java class named
android.widget.Button. This just scratches the surface. There
are thousands of different Java classes in the Android SDK. And again you'll be
creating your own Java classes
to represent the components of your app.Because you'll be working with Java,
it's important to
understand which version you will be coding in.
The compiler that builds bite code for the
Dalvik JVM uses
and Android specific Java implementation. It
does't precisely map to any specific version of Oracle's Java. Instead
you find that Android's Java uses primarily Java
5 APIs with a smattering of Java 6. If
you're a Java developer who's moved on to Java 7, or even 8,
you'll find as of the time of this recording, that the features that
are new to those versions of Java are not available in Android.
For example, Java features like try with resources,
the switch statement with string values, or multiple catch clauses that were
introduced in Java 7
are not known to Android's Java compiler. And
similarly, the newest features that were available in Java SE
8, such as Lambda Expressions and the new date time
API Have not been implemented for Android, again
as of the time of this recording. So,
if you're an experienced Java developer, go back
to your Java 5 and Java 6 experiences.
Code the way you coded for those versions of
Java, and you'll be in good shape. And
if you forget and if you try to use a construct
or a part of an API that was only available to
later versions of Java, the Android Developer tools will correct you quickly.
ANDROID PLATFORM
Android SDK provides environment for creating the Application. SDK provides all the libraries and Development Tools , documentations etc to support the Application Development.
In order to compile your android Application you need to use SDK manager to download the system image for the particular version so that you can run your Application on that version.
Each platform release use includes the SDK Build tools , System images , documentation , processor architecture ,samples etc.
For more information regarding the SDK platform visit the following link :
http://developer.android.com/tools/revisions/platforms.html
Android Architecture
To understand the architecture we start from the Bottom.
1. Linux Kernel
Linux-Kernel provides the standard services like Security , Memory and Process Management , File and Network I/O , Device Drivers.
Android specific services provided by the Linux Kernel is Power management , Android shared memory , Low memory killer , Inter-process communication and much more.
2. Libraries
Android Supports various libraries as per the requirement of an developer like libc which help developers to get the System C libraries , Web-kit for the browser support , open GL|ES for Graphic Engines , SQLite for database management for mobile technology etc.
3. Android Run-time
Android Run-time includes two main components i.e. core java libraries (which provides basic classes , app life cycles , unit testing functionality, web services etc.) and Dalvik virtual machines (Which executes the application)
4.Application Framework
Android provides the rich application framework which enables users to builds innovative application and games.
5. Applications
Android provides some standards or you can say that key applications initially on the device.



0 comments:
Post a Comment