Wednesday, March 26, 2014

Android Components



  • The Android operating system is a multi-user Linux system in which each app is a different user.


Layers:

LINUX KERNEL
The Linux kernel is released under the GNU, therefore you can use on your phone as use slackware instead of android. Here you can find the drivers for hw. The kernel is a  manager's program to control, users, resources, input/output requests, process in a computer .

HARDWARE ABSTRACTION LAYER
Sets of routines in software that emulate some platform-specific details, giving programs direct access to the hardware resources. It makes the developers independent of the hardware. 


LIBRARY
Like other programming languages, making programming more efficient. Some libraries including OpenGL usually found (graphics engine), Libraries multimedia (audio formats, image and video), Webkit (browser), SSL (encrypted communication), FreeType (text fonts), SQLite (database), among other.
ART
Android Runtime Environment. Android makes use of a virtual machine as its runtime environment in order to run the APK files that constitute an Android application. The advantage of using a virtual machine is twofold – firstly, the app code is isolated from the core operating system, ensuring that should something go wrong, it’s contained in an isolated environment and does not effect the primary OS. And secondly, it allows for cross-compatibility, meaning even if an app is compiled on another platform (such as a PC, as is usually the case with developing mobile apps) , they can still be executed on the mobile platform using the virtual machine. on 

APPLICATION FRAMEWORK

  • Activity Manager. It manages the activities of our stack and application lifecycle . 
  •  Windows Manager. It organizes what is displayed. Basically creates surfaces on the screen that subsequently will be used by the activities.
  • Content Provider. This library is very interesting because it creates a layer that encapsulates the data to be shared between applications to have control over how the information is accessed
  • Views. In Android , view items that will help us to build user interfaces : buttons , text boxes , lists, and even more advanced features such as a web browser or display Google Maps.
  • Notification Manager. Includes services to notify you when something needs attention alerts showing the status bar . Importantly, this library also allows to play with sound , turn the vibrator or phone use LEDs if present.
  • Package Manager. This library provides information on the packages installed on the Android device, and manage the installation of new packages . With package we refer to how Android applications we distribute these contain the file apk .
  • Telephony Manager. With this library we can make calls or send and receive SMS / MMS, but otherwise not replace or eliminate the activity that is displayed when a call is in progress. 
  • Resource Manager. With this library we can manage all the elements that are part of the application that are outside of the code, for example text strings translated into different languages ​​, images, sounds or layouts.
  • Location Manager. Determines geographical position by GPS or Android device available networks and work with maps.
  • Sensor Manager. It allows us to manipulate the elements of the phone hardware like accelerometer , gyroscope, light sensor , magnetic field sensor , compass , pressure sensor , proximity sensor , temperature sensor ...
  • Camera: With this library we  take pictures or record video camera 
  •  Multimedia.Permiten reproduce and display audio , video and images on the device.

App components are the essential building blocks of an Android app. Each component is a different point through which the system can enter your app. Not all components are actual entry points for the user and some depend on each other, but each one exists as its own entity and plays a specific role—each one is a unique building block that helps define your app's overall behavior.
There are four different types of app components. Each type serves a distinct purpose and has a distinct lifecycle that defines how the component is created and destroyed.
Here are the four types of app components:

An activity represents a single screen with a user interface. For example, an email app 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 app, each one is independent of the others. As such, a different app can start any one of these activities (if the email app allows it). For example, a camera app can start the activity in the email app 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.

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 app, 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 provider manages a shared set of app data. You can store the data in the file system, an SQLite database, on the web, or any other persistent storage location your app can access. Through the content provider, other apps 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 app 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 app and not shared. For example, the Note Pad sample app 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 apps to perform transactions. For more information, see the Content Providersdeveloper guide.

broadcast receiver is a component that responds to system-wide broadcast announcements. Many broadcasts originate from the system—for example, a broadcast announcing that the screen has turned off, the battery is low, or a picture was captured. Apps can also initiate broadcasts—for example, to let other apps 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 notification to 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.



No comments:

Post a Comment