Wednesday 18 October 2017

2.Architecture and Basic Things in Android App development

Architecture and Basic Things in Android App development


               
Quick Points:
1. Basic things
2. Android Architecture
3. Android Components

Basic Things:

  • Apps are written in Java
  • Bundled by Android Asset Packaging Tool
  • Every App runs its own Linux process
  • Each process has it’s own Java Virtual Machine
  • Each App is assigned a unique Linux user ID
  • Apps can share the same user ID to see each other’s files

Architecture Of Android:



Layers in android:


Applications

Located at the top of the Android software stack are the applications. These comprise both the native applications provided with the particular Android implementation (for example web browser and email applications) and the third party applications installed by the user after purchasing the device.

Application Framework

The Application Framework is a set of services that collectively form the environment in which Android applications run and are managed. This framework implements the concept that Android applications are constructed from reusable, interchangeable and replaceable components. This concept is taken a step further in that an application is also able to publish its capabilities along with any corresponding data so that they can be found and reused by other applications.
The Android framework includes the following key services:
  • Activity Manager – Controls all aspects of the application lifecycle and activity stack.
  • Content Providers – Allows applications to publish and share data with other applications.
  • Resource Manager – Provides access to non-code embedded resources such as strings, color settings and user interface layouts.
  • Notifications Manager – Allows applications to display alerts and notifications to the user.
  • View System – An extensible set of views used to create application user interfaces.
  • Package Manager – The system by which applications are able to find out information about other applications currently installed on the device.
  • Telephony Manager – Provides information to the application about the telephony services available on the device such as status and subscriber information.
  • Location Manager – Provides access to the location services allowing an application to receive updates about location changes.

Android Libraries

This category encompasses those Java-based libraries that are specific to Android development. Examples of libraries in this category include the application framework libraries in addition to those that facilitate user interface building, graphics drawing and database access.
A summary of some key core Android libraries available to the Android developer is as follows:
  • android.app – Provides access to the application model and is the cornerstone of all Android applications.
  • android.content – Facilitates content access, publishing and messaging between applications and application components.
  • android.database – Used to access data published by content providers and includes SQLite database management classes.
  • android.graphics – A low-level 2D graphics drawing API including colors, points, filters, rectangles and canvases.
  • android.hardware – Presents an API providing access to hardware such as the accelerometer and light sensor.
  • android.opengl – A Java interface to the OpenGL ES 3D graphics rendering API.
  • android.os – Provides applications with access to standard operating system services including messages, system services and inter-process communication.
  • android.media – Provides classes to enable playback of audio and video.
  • android.net – A set of APIs providing access to the network stack. Includes android.net.wifi, which provides access to the device’s wireless stack.
  • android.provider – A set of convenience classes that provide access to standard Android content provider databases such as those maintained by the calendar and contact applications.
  • android.text – Used to render and manipulate text on a device display.
  • android.util – A set of utility classes for performing tasks such as string and number conversion, XML handling and date and time manipulation.
  • android.view – The fundamental building blocks of application user interfaces.
  • android.widget - A rich collection of pre-built user interface components such as buttons, labels, list views, layout managers, radio buttons etc.
  • android.webkit – A set of classes intended to allow web-browsing capabilities to be built into applications.

Android Runtime - Dalvik Virtual Machine

Dalvik Virtual Machine(VM) - As we have seen, android is linux based and Linux kernel provides a multitasking execution environment allowing multiple processes to execute concurrently. It would be easy to assume, therefore, that each Android application simply runs as a process directly on the Linux kernel. In fact, each application running on an Android device does so within its own instance of the Dalvik virtual machine (VM).


Linux Kernel


the Linux Kernel provides a level of abstraction between the device hardware and the other layers. The kernel provides preemptive multitasking, low-level core system services such as memory, process and power management in addition to providing a network stack and device drivers for hardware such as the device display, Wi-Fi and audio.

Android Application Components:




Activity
Present a visual user interface for one focused endeavor the user can undertake
Example: a list of menu items users can choose from
Services
Run in the background for an indefinite period of time
Example: calculate and provide the result to activities that need it
Broadcast Receivers
Receive and react to broadcast announcements
Example: announcements that the time zone has changed
Content Providers
Store and retrieve data and make it accessible to all applications
Example: Android ships with a number of content providers for common data types (e.g., audio, video, images, personal contact information, etc.)
Intents
Hold the content of a message
Example: convey a request for an activity to present an image to the user or let the user edit some text

No comments:

Post a Comment

Extract error records while inserting into db table using JDBCIO apache beam in java

 I was inserting data into postgres db using apache beam pipeline. it works perfectly with JdbcIO write of apache beam library. But, now, i ...