Sunday, 3 February 2013





HI THIS TOUTORIAL WILL HELP FULL FOR STARTUP IN ANDROID CREATED BY NAVEENRAJU



ANDROID BASICS EXPLINATIONS BY NAVEENRAJU


 Android Basic

  • Applying Styles and Themes
  • Resources and Assets
  • Database - SQlite DB
  • Creating an Android Project
  • Running Your Application
  • Creating an AVD
  • Creating a Run Configuration




Android Architecture:


android architecture:


Being an Android user you may know how the basic functions such as making a call, sending a text message, changing the system settings, install or uninstall apps etc. Well! All Android users know these, but not enough for a developer. Then what else details are a developer required to know about Android, I’ll explain. To be a developer, you should know all the key concepts of Android. That is, you should know all the nuts and bolts of Android OS.
Here we start:

Android Architecture Diagram:

Android architecture- Diagram
The above figure shows the diagram of Android Architecture. The Android OS can be referred to as a software stack of different layers, where each layer is a group of sveral  program components. Together it includes operating system, middleware and important applications. Each layer in the architecture provides different services to the layer just above it. We will examine the features of each layer in detail.

Linux Kernel

The basic layer is the Linux kernel. The whole Android OS is built on top of the Linux 2.6 Kernel with some further architectural changes made by Google.  It is this Linux that interacts with the hardware and contains all the essential hardware drivers. Drivers are programs that control and communicate with the hardware. For example, consider the Bluetooth function. All devices has a Bluetooth hardware in it. Therefore the kernel must include a Bluetooth driver to communicate with the Bluetooth hardware.  The Linux kernel also  acts as an abstraction layer between the hardware and other software layers. Android uses the Linux for all its core functionality such as Memory management, process management, networking, security settings etc. As the Android is built on a most popular and proven foundation, it made the porting of Android to variety of hardware, a relatively painless task.

Libraries

The next layer is the Android’s native libraries. It is this layer that enables the device to handle different types of data. These libraries are written in c or c++ language and are specific for a particular hardware.
Some of the important native libraries include the following:
Surface Manager: It is used for compositing window manager with off-screen buffering. Off-screen buffering means you cant directly draw into the screen, but your drawings go to the off-screen buffer. There it is combined with other drawings and form the final screen the user will see. This off screen buffer is the reason behind the transparency of windows.
Media framework: Media framework provides different media codecs allowing the recording and playback of different media formats
SQLite: SQLite is the database engine used in android for data storage purposes
WebKit: It is the browser engine used to display HTML content
OpenGL: Used to render 2D or 3D graphics content to the screen

Android Runtime

Android Runtime consists of Dalvik Virtual machine and Core Java libraries.
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 environments. Unlike the JVM, the Dalvik Virtual Machine doesn’t run .class files, instead it runs .dex files. .dex files are built from .class file at the time of compilation and provides hifger efficiency in low resource environments. The Dalvik VM allows multiple instance of Virtual machine to be created simultaneously providing security, isolation, memory management and threading support. It is developed by Dan Bornstein of Google.
Core Java Libraries
These are different from Java SE and Java ME libraries. However these libraries provides most of the functionalities defined in the Java SE libraries.

Application Framework

These are the blocks that our applications directly interacts with. These programs manage the basic functions of phone like resource management, voice call management etc. As a developer, you just consider these are some basic tools with which we are building our applications.
Important blocks of Application framework are:
Activity Manager: Manages the activity life cycle of applications
Content Providers: Manage the data sharing between applications
Telephony Manager: Manages all voice calls. We use telephony manager if we want to access voice calls in our application.
Location Manager: Location management, using GPS or cell tower
Resource Manager: Manage the various types of resources we use in our Application

Applications

Applications are the top layer in the Android architecture and this is where our applications are gonna fit. Several standard applications comes pre-installed with every device, such as:
  • SMS client app
  • Dialer
  • Web browser
  • Contact manager
As a developer we are able to write an app which replace any existing system app. That is, you are not limited in accessing any particular feature. You are practically limitless and can whatever you want to do with the android (as long as the users of your app permits it). Thus Android is opening endless opportunities to the developer.







Application lifetime & states:





onCreate() This method is called for initialization and static set up purposes. It may get passed an older state for resuming.

 The next method is always onStart().

onRestart() After an activity is stopped and about to be started again, this hook is called and after it onStart().

onStart() The application process type changes to visible and the activity is about

to be visible to the user, but it’s not in the foreground.

onResume() The activity has the focus and can get user input. The application

process type is set to foreground.

onPause() If the application loses the focus or the device is going to sleep, this

hook is called and the process type is set to visible. After running this hook,

the system is allowed to kill the application at any time. All CPU consuming

operations should be stopped and unsaved data should be saved. The activity

may be resumed or get stopped.

onStop() The activity is no longer visible, the process type is set to background

and the application may be killed at any time by the system to regain memory.

The activity is either going to get destroyed, or restarted.

onDestroy() The last method that is called in an activity right before the system

kills the application or the application deletes the activity. The application

process may be set to empty if the system keeps the process for caching

purposes.


No comments:

Post a Comment