1. 程式人生 > >Android Architecture and Libraries Every Android Developer Should Know

Android Architecture and Libraries Every Android Developer Should Know

The Android Architecture encourages the concept of component reuse, allowing you to publish and share activities, services, and data with other applications with access managed by the security restrictions you put in place. That being said, today I would like to share information about the android architecture and then some libraries that are provided to you for use while building your next killer app. So are you ready for this? If you said yes, then read on!

android architecture

Don’t be intimidated by the above image – you will not have to understand all that stuff today or even tomorrow.

Android architecture’s mechanism that enables you to produce a replacement contact manager or phone dialer can let you expose your application components to let other developers create new User Interfaces (UI) front ends and functionality extensions or otherwise build on them! How fantastic is that huh?

Dissecting The Android Architecture

In this first list, I am going to show you the application services which are the android architectural cornerstones or as you might call it pillars of all android applications providing the framework you will be using for your own software:

  • Activity Manager – This controls the life cycle of your activities, and that includes the management of the activities stack!
  • Views – Views are used to construct the user interfaces for your application activities.
  • Notification Manager – Provides a consistent and non-intrusive mechanism for signaling your users (example: when you are playing a game and someone sends you a text message, a notification does not terminate your game, instead, you might hear a sound).
  • Content Providers – This lets your application share data between applications.
  • Resource Manager – Supports non-code resources like strings and graphics to be externalized.

Now that we have the first main part out of the way, we can now look at the Android Libraries that will make your android application development easier and fun. As you can tell, these are just short descriptions and you can read more using the link I will share!

Android Libraries You Need To Know

Android also provides a number of APIs for developing your applications. So, in this list, I share the core APIs helping you see what is available to you as an android developer. All android devices will offer support for at least these APIs:

  • android.util – The core utility package contains low-level classes like specialized containers, string formatters, and XML parsing utilities.
  • android.os – The operating system package provides access to basic operating system services like message passing, interprocess communication, clock functions, and debugging.
  • android.graphics – The graphics API provides the low-level graphics classes that support canvases, colors, and drawing primitives and lets you draw on canvases.
  • android.text – The text processing tools for displaying and parsing texts.
  • android.database – Supplies the low-level classes required for handling cursors when working with databases.
  • android.content – The content API is used to manage data access and publishing by providing services for dealing with resources, content providers, and packages.
  • android.view – Views are the core user interface class. All user interface elements are constructed using a series of views to provide the user interaction components.
  • android.widget – Built on the View package, the widget classes are the “here is one we created earlier” user-interface element for you to use in your applications. They include lists, buttons, and layouts.
  • com.google.android.maps – A high leel API that provides access to native map controls that you can use within your application. Includes the MapView control as well as the Overlay and MapController classes used to annotate and control your embedded maps.
  • android.app – A high-level package that provides access to the application model. The application package includes the Activity and Service APIs that form the basis for all your Android applications.
  • android.provider – To ease developer access to certain standard Content Providers( such as the contacts database), the Provider package offers classes to provide access to standard databases included in all Android distributions.
  • android.telephony – The telephony APIs give you the ability to directly interact with the device’s phone stack, letting you make, receive, and monitor phone calls, phone status and SMS messages.
  • android.webkit – The webkit package features APIs for working with Web-based content, including a WebView control for embedding browsers in your activities and a cookie manager.

Again, what you just saw is a simplified list of the Android libraries that helps you build applications that pop! In addition to the Android APIs, the Android stack includes a set of C/C++ libraries that are exposed through the application framework. They include:

  • OpenGL – The library used to support 3D graphics based on the Open GL ES 1.0 API
  • FreeType – This supports bitmap and vector font rendering.
  • SGL –  The core library used to provide a 2D graphics engine.
  • libc – The standard C library optimized for Linux-based embedded devices.
  • SQLite – The lightweight relation database engine used to store application data.
  • SSL – Support for using the Secure Sockets Layer cryptographic protocol for secure internet communications.

NOTE: This post, I figure, is getting longer but I am almost done here. Just one more part and you will be on your way to other important things. If you cannot finish reading the whole post, you can bookmark it for future references because, well, most of these will not change much!

The Advanced Android Libraries

The core libraries we have seen so far provide all the functionality you need to start churning out android applications, but it wont be long before you are ready to delve into the advanced APIs that offer the really kick-ass and fun functionality.

That being said however, it is worth noting that Android hopes to target a wide range of mobile hardware, so be aware that the suitability and implementation of the following APIs will vary depending on the device upon which they are implemented.

  • android.location – The location-based services API gives your applications access to the device’s current physical location. Location-based services provide generic access to location information using whatever position-fixing hardware or technology is available on the device.
  • android.media – The media APIs provide support for playback and recording of audio and video media files, including streamed media.
  • android.opengl – Android offers a powerful 3D rendering engine using the OpenGL ES API that you can use to create dynamic 3D user interfaces for your applications.
  • android.hardware – Where available, the hardware API exposes sensor hardware including the camera, accelerometer. and compass sensors.
  • android.bluetooth, android.net.wifi, android.telephony – Android also provides low-level access to the hardware platform, including Bluetooth, Wi-Fi, and telephony hardware.

You can, most certainly, read more about the Android Architecture and libraries and getting started by clicking here.

Thank you for reading and if you liked it, please use the buttons below to share this Android Architecture post with your cool friends online! If you have any questions, please let me know. Drop me some comments and let us connect on Facebook, Google+ and Twitter. Oh, please subscribe for other awesome future posts!