Sunteți pe pagina 1din 11

Android is a Linux-based operating system designed primarily for touchscreen mobile devices such as smartphones and tablet computers.

Android is open source and Google releases the code under the Apache License. This open source code and permissive licensing allows the software to be freely modified and distributed by device manufacturers, wireless carriers and enthusiast developers

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.

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 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 Androids native libraries 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. 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
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 doesnt run .class files, instead it runs .dex files. Dex files are built from .class file at the time of compilation and provide higher efficiency in low resource environments. Core Java Libraries These are different from Java SE and Java ME libraries. However these libraries provide most of the functionalities defined in the Java SE libraries.

Application Framework
These are the blocks that our applications directly interact with. These programs manage the basic functions of phone like resource management, voice call management etc. 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
SMS client app Dialer Web browser Contact manager

Ans2

Android 1.6 (Donut) The third and last software update of 2009, Donut, came in out September. It brought many improvements to the Android Market. It also introduced the Mark All option in the gallery. Additionally, screens with 800x480 were also supported by the platform. Apart from that, the OS also made way for voice search functionality. Android 2.0 \ 2.1 (Eclair) Eclair came with a revamped UI and support for animated wallpapers. Camera features including digital zoom, macro, and white balance were added. The browser got a facelift and HTML5 support. Additionally, Bluetooth support was bumped up to version 2.1. Android 2.2 (Froyo) Released in the summer of 2010, Froyo (short for Frozen Yoghurt) was a huge improvement over its predecessor in terms of performance. The users could now finally install the apps on a memory card. Additionally, support for 720p screens, USB and Wi-Fi tethering made it to Android. With theAdobe Flash 10.1 integration, devices running on this OS could handle web videos through the browser. Android 2.3 (Gingerbread) Gingerbread landed by the end of 2010. This version of the Android offered the support for relatively large screen-sizes, gyroscopes, and even barometers. It also brought native internet telephony and video chat capabilities. Google also introduced the much-hyped NFC (Near Field Communications) feature along with improved power management. Android 3.0 (Honeycomb) For the first time Google released a software that was totally focused on tablets. This version, released in 2011, came up with a fresh UI that depended more on software buttons. It also introduced hardware acceleration to the platform. On the multimedia front, the OS could support FLAC files. Moreover, it supported external input devices such as keyboards and mice. Android 4.0 (Ice Cream Sandwich 4.0). The latest Android 4.0 is designed to play nice with both phones as well as slates. This update is claimed to be the most enhanced version of the platform with full support for multi-core CPUs.
Android 4.2, Jelly Bean improves on the speed and simplicity of Android 4.1 and includes all new features Photo Sphere and a completely redesigned camera app, new Gesture Typing keyboard, Google Now with all new cards,

ans 3 This is a list of features in the Android operating system: Handset layouts The platform is adaptable to larger, VGA, 2D graphics library, 3D graphics library based on OpenGL ES 2.0 specifications, and traditional smartphone layouts. Storage SQLite, a lightweight relational database, is used for data storage purposes. Connectivity Android supports connectivity technologies including GSM/EDGE, IDEN, CDMA, EVDO, UMTS, Bluetooth, Wi-Fi, LTE, NFC and WiMAX. Messaging SMS and MMS are available forms of messaging, including threaded text messaging and Android Cloud To Device Messaging (C2DM) and now enhanced version of C2DM, Android Google Cloud Messaging (GCM) is also a part of Android Push Messaging service. Multiple language support Android supports multiple languages. Web browser The web browser available in Android is based on the open-source WebKit layout engine, coupled with Chrome's V8 JavaScript engine. The browser scores 100/100 on the Acid3 test on Android 4.0. Java support While most Android applications are written in Java, there is no Java Virtual Machine in the platform and Java byte code is not executed. Java classes are compiled into Dalvikexecutables and run on Dalvik, a specialized virtual machine designed specifically for Android and optimized for battery-powered mobile devices with limited memory and CPU.J2ME support can be provided via third-party applications. Media support Android supports the following audio/video/still media formats: WebM, H.263, H.264, AAC, HEAAC (in 3GP or MP4 container), MPEG-4 SP, AMR, AMR-WB (in 3GP container), MP3, MIDI, OggVorbis, FLAC, WAV, JPEG, PNG, GIF, BMP, WebP. Streaming media support RTP/RTSP streaming (3GPP PSS, ISMA), HTML progressive download (HTML5 <video> tag). Adobe Flash Streaming (RTMP) and HTTP Dynamic Streaming are supported by the Flash plugin. Apple HTTP Live Streaming is supported by RealPlayer for Android, and by the operating system in Android 3.0 (Honeycomb).
[7] [6] [5] [3] [4] [1][2][3]

Additional hardware support Android can use video/still cameras, touchscreens, GPS, accelerometers, gyroscopes, barometers, magnetometers, dedicated gaming

controls, proximity and pressure sensors, thermometers, accelerated 2D bit blits (with hardware orientation, scaling, pixel format conversion) and accelerated 3D graphics. Multi-touch Android has native support for multi-touch which was initially made available in handsets such as the HTC Hero. The feature was originally disabled at the kernel level (possibly to avoid infringing Apple's patents on touch-screen technology at the time). Google has since released an update for the Nexus One and the Motorola Droid which enables multi-touch natively. Bluetooth Supports A2DP, AVRCP, sending files (OPP), accessing the phone book (PBAP), voice dialing and sending contacts between phones. Keyboard, mouse and joystick (HID) support is available in Android 3.1+, and in earlier versions through manufacturer customizations and third-party applications. Video calling Android does not support native video calling, but some handsets have a customized version of the operating system that supports it, either via the UMTS network (like theSamsung Galaxy S) or over IP. Video calling through Google Talk is available in Android 2.3.4 and later. Gingerbread allows Nexus S to place Internet calls with a SIP account. This allows for enhanced VoIP dialing to other SIP accounts and even phone numbers. Skype 2.1 offers video calling in Android 2.3, including front camera support. Users with the Google+ android app can video chat with other google+ users through hangouts. Multitasking Multitasking of applications, with unique handling of memory allocation, is available. Accessibility Built in text to speech is provided by Talk back for people with low or no vision. Enhancements for people with hearing disabilities is available as is other aids. Voice based features Google search through voice has been available since initial release. navigation, etc. are supported on Android 2.2 onwards.
[14] [13] [12] [11] [10] [9] [8]

Voice actions for calling, texting,

As of Android 4.1, Google has expanded Voice

Actions with the ability to talk back and read answers from Google's Knowledge Graph when queried with specific commands. The ability to control hardware has not yet been implemented. Tethering Android supports tethering, which allows a phone to be used as a wireless/wired Wi-Fi hotspot. Before Android 2.2 this was supported by third-party applications or manufacturer customizations. Screen capture Android supports capturing a screenshot by pressing the power and volume-down buttons at the same time.
[16] [15]

Prior to Android 4.0, the only methods of capturing a screenshot were through manufacturer and

third-party customizations or otherwise by using a PC connection (DDMS developer's tool). These alternative methods are still available with the latest Android.

External storage Most Android devices include microSD slot and can read microSD cards formatted with FAT32, Ext3 or Ext4 file system. To allow use of high-capacity storage media such asUSB flash drives and USB HDDs, many Android tablets also include USB 'A' receptacle. Storage formatted with FAT32 is handled by Linux Kernel VFAT driver, while 3rd party solutions are required to handle other popular file systems such as NTFS, HFS Plus and exFAT

Ans 5

Basic Android project structure


After you have installed all the plug-ins necessary for the development of an Android file, you can now begin to develop an Android application. From the top menu, choose File -> Project, and from the "New Project window", choose "Android Project". Follow the project setup wizard and after finishing the wizard, you will have a basicAndroid application. Every Android project contains several folders:

src: This folder contains the Java source files. gen: Generated Java library, this library is for Android internal use only. Res: Here we can store resource files such as pictures, XML files for defining layouts, and so forth. Within this folder there are additional folders such as Drawable, Layout, and Values. Drawable: Here we store the various graphic files. We can see three types of drawable folders. This is because there are many Android devices with different screen resolutions. By default, there are several versions of this folder such as: Drawable-mdpi, drawable-hdpi, and so forth. This is required in order to adapt to different screen resolutions. Layout: This is the place for XML layout files. Layout files are XML files which define how various Androidobjects (such as textboxes, buttons, etc.) are organized on the screen. Values: XML files which store various string values (titles, labels, etc.). Major files in the Android project:

AndroidManifest.xml: This is the Android definition file. It contains information about the Android application such as minimum Android version, permission to access Android device capabilities such as internet access permission, ability to use phone permission, etc. MainLayout.xml: This file describes the layout of the page. This means the placement of every component (such as textboxes, labels, radio buttons, user defined components, etc.) on the app screen. Activity class: Every application that occupies the entire device screen needs at least one class which inherits from the Activity class. One major method is called OnCreate. This method initiates the app and loads the layout page.

Ans 6 .apk file format


Android application package file (APK) is the file format used to distribute and install application software and middlewareonto Google's Android operating system. To make an APK file, a program for Android is first compiled, and then all of its parts are packaged into one file. This holds all of that program's code (such

as .dex files), resources, assets, certificates, and manifest file. As is the case with many file formats, APK files can [1][2][3][4] have any name needed, provided that the file name ends in ".apk". APK files are ZIP file formatted packages based on the JAR file format, with .apk file extensions. The MIME [5 type associated with APK files is application/vnd.android.package-archive.

R.java

ANS 7
Activities An activity represents a single screen with a user interface. For example, an email application might have one activity that shows a list of new emails, another activity to compose an email, and another activity for reading emails. Although the activities work together to form a cohesive user experience in the email application, each one is independent of the others. As such, a different application can start any one of these activities (if the email application allows it). For example, a camera application can start the activity in the email application that composes new mail, in order for the user to share a picture. An activity is implemented as a subclass of Activity and you can learn more about it in the Activitiesdeveloper guide. Services A service is a component that runs in the background to perform long-running operations or to perform work for remote processes. A service does not provide a user interface. For example, a service might play music in the background while the user is in a different application, or it might fetch data over the network without blocking user interaction with an activity. Another component, such as an activity, can start the service and let it run or bind to it in order to interact with it. A service is implemented as a subclass of Service and you can learn more about it in the Servicesdeveloper guide. Content providers A content provider manages a shared set of application data. You can store the data in the file system, an SQLite database, on the web, or any other persistent storage location your application can access. Through the content provider, other applications can query or even modify the data (if the content provider allows it). For example, the Android system provides a content provider that manages the user's contact information. As such, any application with the proper permissions can query part of the content provider (such as ContactsContract.Data) to read and write information about a particular person. Content providers are also useful for reading and writing data that is private to your application and not shared. For example, the Note Pad sample application uses a content provider to save notes.

A content provider is implemented as a subclass of ContentProvider and must implement a standard set of APIs that enable other applications to perform transactions. For more information, see the Content Providers developer guide. Broadcast receivers A broadcast receiver is a component that responds to system-wide broadcast announcements. Many broadcasts originate from the systemfor example, a broadcast announcing that the screen has turned off, the battery is low, or a picture was captured. Applications can also initiate broadcasts for example, to let other applications know that some data has been downloaded to the device and is available for them to use. Although broadcast receivers don't display a user interface, they may create a status bar notificationto alert the user when a broadcast event occurs. More commonly, though, a broadcast receiver is just a "gateway" to other components and is intended to do a very minimal amount of work. For instance, it might initiate a service to perform some work based on the event. A broadcast receiver is implemented as a subclass of BroadcastReceiver and each broadcast is delivered as an Intent object. For more information, see the BroadcastReceiver class.

ANS8 Activity Lifecycle


Activities in the system are managed as an activity stack. When a new activity is started, it is placed on the top of the stack and becomes the running activity -- the previous activity always remains below it in the stack, and will not come to the foreground again until the new activity exits. An activity has essentially four states:

If an activity in the foreground of the screen (at the top of the stack), it is active or running. If an activity has lost focus but is still visible (that is, a new non-full-sized or transparent activity has focus on top of your activity), it is paused. A paused activity is completely alive (it maintains all state and member information and remains attached to the window manager), but can be killed by the system in extreme low memory situations. If an activity is completely obscured by another activity, it is stopped. It still retains all state and member information, however, it is no longer visible to the user so its window is hidden and it will often be killed by the system when memory is needed elsewhere. If an activity is paused or stopped, the system can drop the activity from memory by either asking it to finish, or simply killing its process. When it is displayed again to the user, it must be completely restarted and restored to its previous state.

The following diagram shows the important state paths of an Activity. The square rectangles represent callback methods you can implement to perform operations when the Activity moves between states. The colored ovals are major states the Activity can be in.

There are three key loops you may be interested in monitoring within your activity:

The entire lifetime of an activity happens between the first call to onCreate(Bundle) through to a single final call to onDestroy(). An activity will do all setup of "global" state in onCreate(), and release all remaining resources in onDestroy(). For example, if it has a thread running in the background to download data from the network, it may create that thread in onCreate() and then stop the thread in onDestroy(). The visible lifetime of an activity happens between a call to onStart() until a corresponding call to onStop(). During this time the user can see the activity on-screen, though it may not be in the foreground and interacting with the user. Between these two methods you can maintain resources that are needed to show the activity to the user. For example, you can register a BroadcastReceiver in onStart() to monitor for changes that impact your UI, and unregister it in onStop() when the user no longer sees what you are displaying. The onStart() and onStop() methods can be called multiple times, as the activity becomes visible and hidden to the user.

The foreground lifetime of an activity happens between a call to onResume() until a corresponding call to onPause(). During this time the activity is in front of all other activities and interacting with the user. An

activity can frequently go between the resumed and paused states -- for example when the device goes to sleep, when an activity result is delivered, when a new intent is delivered -- so the code

Ans4
AVD An Android Virtual Device (AVD) is an emulator configuration that lets you model an actual device by defining hardware and software options to be emulated by the Android Emulator. An AVD consists of: * A hardware profile: Defines the hardware features of the virtual device. For example, you can define whether the device has a camera, whether it uses a physical QWERTY keyboard or a dialing pad, how much memory it has, and so on. * A mapping to a system image: You can define what version of the Android platform will run on the virtual device. You can choose a version of the standard Android platform or the system image packaged with an SDK add-on. * Other options: You can specify the emulator skin you want to use with the AVD, which lets you control the screen dimensions, appearance, and so on. You can also specify the emulated SD card to use with the AVD. * A dedicated storage area on your development machine: the device's user data (installed applications, settings, and so on) and emulated SD card are stored in this area. AVD manager The AVD Manager is an easy to use user interface to manage your AVD (Android Virtual Device) configurations. An AVD is a device configuration for the Android emulator that allows you to model different configurations of Android-powered devices. When you start the AVD Manager in Eclipse or navigate to your SDK'stools/ directory and execute android avd 1.Dalvik Virtual machine VS Java Virtual Machine: Dalvik Virtual machine: (DVM) is Register Architecture, designed to run on low memory, uses its own byte code and runs .Dex file (Dalvik Executable File) Java Virtual Machine: (JVM) is Stack Architecture, uses java byte code and runs .class file having JIT. Java source code is compiled by the Java compiler into .class files. Then the dx (dexer) tool, part of the Android SDK processes the .class files into a proprietary file format called DEX that contains Dalvikbytecode.

Ans7 R.java is an auto generated file when you build an android application. It contains unique identifiers (normally 32bit numbers) for elements in each category (drawable, string, layout, color, etc.) of resources (elements under directory res) available in your android application. The main purpose of R.java file is quick accessibility of resources in the project. If any resource has deleted or added to the project, R.java file will be updated

automatically, this can be done by ADT plugin in Eclipse. The ADT plugin in Eclipse will give you a warning if you try to modify this R.java file. Even if you modified this file, it may result into unknown output of your application.

S-ar putea să vă placă și