Monday, 8 October 2018

Android Architecture

Android is an open source, Linux-based operating system. The following diagram shows the major components of the Android platform.


The Linux Kernel:
Linux kernel is the foundation of the Android operating system. Android Runtime (ART) based on Linux kernel for underlying functionalities such as threading and low-level memory management. Using a Linux kernel allows Android to take advantage of key security features and allows manufacturers to develop hardware drivers for the well-known kernel. Security features mean at the operating system level, the Android platform provides the security of the Linux kernel, as well as a secure inter-process communication (IPC) facility to enable secure communication between applications running in different processes. These security features at the OS level ensure that even native code is forced by the Application Sandbox. The Linux kernel has been in widespread use for years and is used in millions of security-sensitive environments. Through its history of constantly being researched, attacked, and fixed by thousands of developers, Linux has become a stable and secure kernel trusted by many corporations and security professionals. As the base for a mobile computing environment, the Linux kernel provides Android with several key security features, including:

  • A user-based permissions model
  • Process isolation
  • Extensible mechanism for secure IPC
  • The ability to remove unnecessary and potentially insecure parts of the kernel


Libraries and Android Runtime:

  • One GC pause instead of twoParallelized processing during the remaining GC pause.
  • A collector with a lower total GC time for the special case of cleaning up recently-allocated, short-lived objects.
  • Improved garbage collection ergonomics, making concurrent garbage collections more timely, which makes GC_FOR_ALLOC events extremely rare in typical use cases.
  • Compacting GC to reduce background memory usage and fragmentation
  • ART supports a number of new debugging options, particularly in monitor- and garbage collection-related functionality.

          Sandbox:  

          The Android uses this UID to set up a kernel-level Application Sandbox. The kernel enforces security between apps and the system at the process level through standard Linux facilities, such as user and group IDs that are assigned to apps. By default, apps can't interact with each other and have limited access to the operating system. For example, if application A tries to do something malicious, such as read application B's data or dial the phone without permission (which is a separate application), then the operating system protects against this behavior because application A does not have the appropriate user privileges. The sandbox is simple, auditable, and based on decades-old UNIX-style user separation of processes and file permissions.
          Hardware Abstract Layer:

          The Hardware Abstraction Layer (HAL) provides standard interfaces that expose device hardware capabilities to the higher-level Java API framework. The HAL consists of multiple library modules, each of which implements an interface for a specific type of hardware components, such as the camera or Bluetooth module. When a framework API makes a call to access device hardware, the Android system loads the library module for that hardware component. For more information about HAL please follow given link

          On the top of the Linux kernel and HAL, android architecture contains libraries and android runtime. Libraries include WebKit, OpenGL, FreeType, SQLite, and Media, C runtime library (Libc), SSL, and SGL. The WebKit library is responsible for browser support; SQLite is for the database, FreeType for font support, Media for playing and recording audio and video formats.

          Android Runtime(ART):
          In Android Runtime, there are core libraries and DVM (Dalvik Virtual Machine) which is responsible to run the android application. DVM is like JVM but it is optimized for mobile devices. ART introduces ahead-of-time (AOT) compilation, which can improve app performance. ART also has tighter install-time verification than Dalvik. Android runtime improves garbage collection. Garbage collection can harm performance which resulting in poor app performance and UI.
          ART solve garbage collection issue by following ways.
          How it works?
          The Dex compiler converts the java class files into the .dex file that run on the Dalvik VM. Multiple class files are converted into one dex file. AAPT stands for Android Assets Packaging Tool which converts .dex files into .apk (Android Packaging)


          Application Framework:


          On the top of Native libraries and android runtime, there is the android framework. Android framework includes Android APIs such as UI (User Interface), telephony, resources, locations, Content Providers (data) and package managers. It provides a lot of classes and interfaces for android application development such as,

          1.   A rich and extensible View System you can use to build an app’s UI, including lists, grids, text boxes, buttons, and even an embeddable web browser.

          2.   Content Provider that enables apps to access data from other apps, such as the Contacts app, or to share their own data.

          3.   Telephony class provides information about the telephony services such as subscriber id, SIM serial number, phone network type etc. Moreover, you can determine the phone state etc.
          4.   Android provides facility to integrate Google map in our application. Google map displays your current location, navigate location direction, search location etc. We can also customize Google map according to our requirement.





           System Applications:

          All applications such as home, contact, settings, games, browsers are using an android framework that uses android runtime and libraries. The system apps function both as apps for users and to provide key capabilities that developers can access from their own app. For example, if your app would like to deliver an SMS message, you don't need to build that functionality you-you can instead invoke whichever SMS app is already installed to deliver a message to the recipient you specify.


          Thank you so much reading my tutorial, Please comment below down if you like it :-)








          Android Introduction

          Android Introduction


          What is Android?


          Android is a mobile operating system developed by Google, based on the Linux kernel and other open source software and designed primarily for touchscreen mobile devices such as Smartphones and tablets. In addition, Google has further developed Android TV for televisions, Android Auto for cars and Wear OS for wrist watches, each with a specialized user interface. Variants of Android are also used on game consoles, digital cameras, PCs and other electronics
          Initially developed by Android Inc., which Google bought in 2005, Android was unveiled in 2007, with the first commercial Android device launched in September 2008. The operating system has since gone through multiple major releases, with the current version being 9.0 "Pie", released in August 2018. The core Android source code is known as Android Open Source Project (AOSP) and is primarily licensed under the Apache License.

          History:
          This amazing operating system was by founded in Palo Alto, California, in October 2003 by Andy Rubin, Rich Miner, Nick Sears, and Chris White. Cameras Company diverted its efforts and was pitching Android as a handset operating system that would rival Symbian and Microsoft Windows Mobile. In July 2005, Google acquired Android Inc. for at least $50 million. Its key employees, including Rubin, Miner, and White, joined Google as part of the acquisition.
          At Google, the team led by Rubin developed a mobile device platform powered by the Linux kernel. In 2007, Google announces the development of Android OS. Android is also associated with a suite of proprietary software developed by Google, including core apps for services such as Gmail and Google Search, as well as the application store and digital distribution platform Google Play, and associated development platform.
          The first commercially available Smartphone running Android was the HTC Dream, also known as T-Mobile G1, announced on September 23, 2008. On November 5, 2007, the Open Handset Alliance, a consortium of technology companies including Google, device manufacturers such as HTC, Motorola and Samsung, wireless carriers such as Sprint and T-Mobile, and chipset makers such as Qualcomm and Texas Instruments, unveiled itself, with a goal to develop "the first truly open and comprehensive platform for mobile devices.
          In 2010, Google launched its Nexus series of devices, a line-up in which Google partnered with different device manufacturers to produce new devices and introduce new Android versions. Since 2008, Android has seen numerous updates which have incrementally improved the operating system, adding new features and fixing bugs in previous releases. Google explained that "Since these devices make our lives so sweet, each Android version is named after a dessert".
          Why Android?
          Android is open source operating system which has larger developers community. Android has a higher success ratio and it provides a rich development environment with a good market

          Features Of Android:



          Sr. No.

           Features & description

              1

          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 services.

          2


          Auto Correction and Dictionary

          Android Operating System has an interesting feature called Auto Correction. When any word is misspelled, then Android recommends the meaningful and correct words matching the words that are available in Dictionary. Users can add, edit and remove words from Dictionary as per their wish

          3

          Voice-based features

          Google search through voice has been available

          4

          Web browser

          The web browser available in Android is based on the open-source Blink (previously WebKit) layout engine, coupled with Chrome's V8 JavaScript engine

          5

          Multi-touch

          Android has native support for multi-touch which was initially made available in handsets such as the HTC Hero.

          6

          Multitasking

          The user can jump from one task to another and same time various applications can run simultaneously.

          7

          Screen capture

          Android supports capturing a screenshot by pressing the power and home-screen buttons at the same time

          8

          Accessibility

          Built-in text-to-speech is provided by Talkback for people with low or no vision. Enhancements for people with hearing difficulties are available, as are other aids.

          9

          Connectivity

          Android supports connectivity technologies including GSM/EDGE, IDEN, CDMA, EV-DO, UMTS, Bluetooth, Wi-Fi, LTE, NFC, and WiMAX.

          10

          Hardware Support

          Android devices can include still/video cameras, touchscreensGPSaccelerometersgyroscopesbarometersmagnetometers, dedicated gaming controls, proximity and pressure sensorsthermometers, accelerated 2D bit blitz(with hardware orientation, scaling, pixel format conversion) and accelerated 3D graphics.

          11

          Media support  
          Android supports the following audio/video/still media formats: WebM, H.263, H.264, AAC, HE-AAC (in 3GP or MP4 container), MPEG-4 SP, AMR, AMR-WB (in 3GP container), MP3, MIDI, Ogg Vorbis, FLAC, WAV, JPEG, PNG, GIF, BMP, and WebP  

          12

           Storage  
           SQLite, a lightweight relational database, is used for data storage purposes.  


           

          Android applications are usually developed in the Java language using the Android Software Development Kit.  On May 2017 Google announced that it will officially support Kotlin on Android as a “first-class” language. Kotlin is a super new programming language built by JetBrains, which also coincidentally develops the JetBrains IDE that Android Studio — Google's official developer tool — is based on. Like Java, which is the default language for Android development, Kotlin is a language that runs on the JVM (Java Virtual Machine), and it's already possible to use Kotlin and many other JVM languages for Android development. Once developed, Android applications can be packaged easily and sold out either through a store such as Google PlaySlideMEOpera Mobile StoreMobangoF-droid, and the Amazon Appstore.
          Please follow given the link to know more about Android’s various versions and their comparison with each other.
          http://socialcompare.com/en/comparison/android-versions-comparison
          Thank you so much for reading my first blog on Android. Please comment below down if you like it :-)

          Android Architecture

          Android is an open source, Linux-based operating system. The following diagram shows the major components of the Android platform. ...