Architecture and Application Components

The following image will show you the hierarchy of architectures of Android: image here Linux Kernel: this is the core of android. This facilitates all the connections between hardware devices and consist all the basic hardware drivers like keyboard, camera and touch display. And also this level handles all the things of android. Libraries: above the kernel are sets of necessary library files which also includes open source code including web browser, libc, SQLite database which is a useful storage facility for sharing application data, files for record and play audio and video and library files for internet security. Android Libraries: these are JAVA-based library files that are used for android development. These are libraries for application framework which facilitate the user interface development, graphics and database access. Following are the uses of different libraries:
  • app: provides access to application model
  • content: provides access to publishing and application components
  • database: provides access to data in content providers by SQLite
  • opengl: provides JAVA interface to 3D graphics
  • os: provides application with access to OS
  • text: used to make and change the text which will be displayed on the device
  • view: it is used to make UI
  • widgets: built-in resizable buttons, lists, views, clocks etc
  • webkit: files that allow web-browsing
Android Runtime: this is the main part of android called the ‘Dalvik Virtual Machine’ which is a JAVA machine used for designing and optimizing for android. The DVM refers to LINUX main features like memory management and multi-threading. The DVM makes every android application to execute its own process. This gives a set of main library files which makes application developers to code android applications using JAVA programming languages. Application Framework: here you can make JAVA classes. These classes will be used by the developers to make applications. The android framework includes the following functions:
  • Activity Manager: controls all parts of application
  • Content Providers: allows applications share data with other applications
  • Resource Manager: manipulation of color settings and UI layouts
  • Notifications Manager: shows user alerts and notifications
  • View System: used to create application UI
Applications: the top layer is application layer. Here you will write the code and main designing of your application. For example, games and other applications. Application Components: these are the building blocks of any android application. This uses AndroidManifest.xml explains each part of applications and how they are connected with each other. Following are the main components and their uses:
  • Activities: this handles the UI of the smart phones
  • Services: this runs different applications at the same time
  • Broadcast Receivers: this enables the communication between android OS and its applications
  • Content Providers: this part enables data and database.
Activities: this handles activities on the screen. For example, you have to make an account on any website that shows the first and last name, password, alternate email and other formalities. These activities must be marked for launching the application. Following is the code to implement an Activity: public class MainActivity extends Activity{ } Services: this runs different applications at the same time. For example, viewing images and listening to images. Following is the code to implement a Services: public class MainService extends Services{ } Broadcast Receivers: this simply replies the broadcast messages from other applications or from the system. For example, certain applications can also send broadcasts messages to let other applications know that certain data has been downloaded in the device and is ready to use, then the receiver will execute appropriate actions. Following is the code to implement a Broadcast Receiver: public class MainReceivers extends BroadcastReceivers{ public void onReceive(context,intent){} } Content Providers: this sends data from one application to other applications. This data might be saved in the system or in the database. Following is the code to implement a Content Providers: public class MainContentProviders extends ContentProviders{ public void onCreate(){} } Additional Components: Following are the additional components used in the development of android application:
  • Fragments: it is a part of Activity which works with UI
  • Views: it is the UI elements that works with buttons, lists, forms etc
  • Layouts: controls screen format
  • Intents: messages wiring components
  • Resources: works with strings, constants, variables and pictures
  • Manifest: configuration of files

Add new comment