Android Base Concepts

What is Android? Environment & Tools Artifacts Concepts Environment Artifacts Application & Process

Base Concepts

What is Android?

Android are a lot of things.

The Android Platform is Google Inc.’s open and free software stack that includes an operating system, middleware, development tools and also key applications for use on different type of devices, including smartphones. Android is an Open Handset Alliance Project.

What would it take to build a better mobile phone?

A commitment to openness, a shared vision for the future, and concrete plans to make the vision a reality.

Welcome to the Open Handset Alliance™, a group of 84 technology and mobile companies who have come together to accelerate innovation in mobile and offer consumers a richer, less expensive, and better mobile experience. Together we have developed Android™, the first complete, open, and free mobile platform.

Android OS is software for mobile phones, tablets and a growing range of devices encompassing everything from wearable computing to in-car entertainment. It launched in 2003 and is the world’s most popular mobile operating system (OS).

Android OS is an open source project (led by Google but it doesn’t belong to them) called AOSP (Android Open Source Project). Google uses this project as a base to create its version of Android, which is then used by the other manufacturers.

As an OS, Android’s job is to act as a translator between you and your gadget. When you take a photo, Android provides the button you tap and tells the phone what to do when you tap it. When you make or receive a call, Android tells your phone how to do that. When you play a game, Android tells the game what movements you’re making and what buttons you’re pressing. It’s like Windows, but for mobile devices.

The Android software itself is developed in conjunction with Google, who releases major updates to the platform every year. Manufacturers which run Android on their phones include Samsung, Huawei, Sony, Lenovo, HTC, LG and many others; it’s currently operational on more than one billion devices.

The well known Android mascot is called Bugdroid, it is a green robot:


Where does Android come from?

It comes from Google, who actually acquired Android in 2005 (no, Google didn’t invent it). The search giant performs regular updates along with an annual major update.

The operating system is based on the Linux kernel – if you have friends who work in IT, you may have heard of it. This is the GNU / Linux operating system based structure, which is a unix type system (portable operating system, multitasking and multi-user). The Linux kernel is one of the most prominent examples of free software.

What’s with the candy names?

Each new version of Android gets a code name based on consecutive letters of the alphabet. The most recent version is known as Oreo 8.0 because it is the Android O release. Previous versions have included, N 7.0 Nougat, M Marshmallow,..

You can find all releases list on: Platform Versions DashBoard

androidpit android kitkat


Environment & Tools

Android Studio is the Official IDE for Android.

Android Studio provides the fastest tools for building apps on every type of Android device.


The follow url is used to install & download the software.
Included all necessary for develop, build and testing an Android app.

Outstanding features

Instant Run

When you click Run or Debug, Android Studio’s Instant Run feature pushes code and resource changes to your running app. It intelligently understands the changes and often delivers them without restarting your app or rebuilding your APK, so you can see the effects immediately.

Intelligent code editor

The code editor helps you write better code, work faster, and be more productive by offering advanced code completion, refactoring, and code analysis. As you type, Android Studio provides suggestions in a dropdown list. Simply press Tab to insert the code.

 Fast and feature-rich emulator and real devices for all Android devices

Android Studio provides a unified environment where you can build apps for Android phones, tablets, Android Wear, Android TV, and Android Auto.

Code templates and sample apps

Android Studio includes project and code templates that make it easy to add well-established patterns such as a navigation drawer and view pager. You can start with a code template or even right-click an API in the editor and select Find Sample Code to search for examples. Moreover, you can import fully functional apps from GitHub, right from the Create Project screen.

QA Lint

Android Studio provides a robust static analysis framework and includes over 280 different lint checks across the entirety of your app. Additionally, it provides several quick fixes that help you address issues in various categories, such as performance, security, and correctness, with a single click.

Build & Testing tools & dependences frameworks resolving

Based on gradle tool help you test your Android apps with JUnit 4 and functional UI test frameworks.
With Espresso Test Recorder, you can generate UI test code, also local testing with mock objects and unit testing with emulation are possible.
You can run your tests on a device, an emulator, a continuous integration environment, or in Firebase Test Lab.

 Layout Editor

Wysiwyg editor for android view layouts

Vector Asset Studio

Android Studio makes it easy to create a new image asset for every density size.

Create Rich and Connected Apps

Android Studio knows not all code is written in Java and not all code runs on the user’s device.

C++ and NDK support

Only as a comment because is a advanced programming model we can develop on C++ using the NDK (Native Development Kit). Android Studio fully supports editing C/C++ project files so you can quickly build JNI components in your app. Yes, the IDE provides debug your Java and C/C++ code.

Firebase and Cloud integration

The Firebase Assistant helps you connect your app to Firebase Services.

Firebase a Mobile Cloud services from Google that let improve ours apps with Analytics, Crashes, notifications,…

In the advanced level we’ll work with Firebase Services.


Android Platform Architecture

The base architecture of the platform follow the next diagram:

The Linux Kernel

The foundation of the Android platform is the Linux kernel. For example, the Android Runtime (ART) relies on the 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 device manufacturers to develop hardware drivers for a well-known kernel.


Hardware Abstraction Layer (HAL)

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 component, 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.


Android Runtime

For devices running Android version 5.0 (API level 21) or higher, each app runs in its own process and with its own instance of the Android Runtime (ART). ART is written to run multiple virtual machines on low-memory devices by executing DEX files, a bytecode format designed specially for Android that’s optimized for minimal memory footprint. Build toolchains, such as Jack, compile Java sources into DEX bytecode, which can run on the Android platform.

Some of the major features of ART include the following:

  • Ahead-of-time (AOT) and just-in-time (JIT) compilation
  • Optimized garbage collection (GC)
  • Better debugging support, including a dedicated sampling profiler, detailed diagnostic exceptions and crash reporting, and the ability to set watchpoints to monitor specific fields

Prior to Android version 5.0 (API level 21), Dalvik was the Android runtime. If your app runs well on ART, then it should work on Dalvik as well, but the reverse may not be true.

Android also includes a set of core runtime libraries that provide most of the functionality of the Java programming language, including some Java 8 language features, that the Java API framework uses.


Native C/C++ Libraries

Many core Android system components and services, such as ART and HAL, are built from native code that require native libraries written in C and C++. The Android platform provides Java framework APIs to expose the functionality of some of these native libraries to apps. For example, you can access OpenGL ES through the Android framework’s Java OpenGL API to add support for drawing and manipulating 2D and 3D graphics in your app.


Java API Framework

The entire feature-set of the Android OS is available to you through APIs written in the Java language. These APIs form the building blocks you need to create Android apps by simplifying the reuse of core, modular system components and services that we can study in next chapters.


System Apps

Android comes with a set of core apps for email, SMS messaging, calendars, internet browsing, contacts, and more. Apps included with the platform have no special status among the apps the user chooses to install. So a third-party app can become the user’s default web browser, SMS messenger, or even the default keyboard (some exceptions apply, such as the system’s Settings app).

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 yourself—you can instead invoke whichever SMS app is already installed to deliver a message to the recipient you specify.

Base Development Artifacts Concepts




Please a little more a detail:

Activity – represents the controller of presentation layer of an Android application, e.g. a screen which the user sees. An Android application can have several activities and it can be switched between them during runtime of the application. Each activity has a lifecycle and run over an independent process. Android OS is the responsible to destroy the activity for save performance.

ContentProvider – provides data to applications, via a content provider your application can share data with other applications. Android contains a SQLite DB which can serve as data provider

Intents – are asynchronous messages which allow the application to request functionality from other services or activities. An application can call directly a service or activity (explicit intent) or ask the Android system for registered services and applications for an intent (implicit intents). For example the application could ask via an intent for a contact application. Applications register themselves to an intent via an IntentFilter. Intents are a powerful concept as they allow the creation of loosely coupled applications.

MVC (Model View Controller)

There is no universally unique MVC pattern in Android . MVC is a concept rather than a solid programming framework, so it is about conceptual understanding of MVC. We can implement our own MVC in any platforms. As long as we stick to the following basic idea, we are implementing MVC:

  • Model: What to render
  • View: How to render
  • Controller: Events, user input

we can say MVC is already implemented in Android as:

  1. View = layout, resources and built-in classes like Button derived from android.view.View.
  2. Controller = Activity
  3. Model = the classes that implement the application logic

Also we can  think about this way, when we program our model, the model should not need to worry about the rendering (or platform specific code). The model would say to the view, we don’t care our rendering is Android or iOS or Windows Phone, this is what I need you to render. The view would only handle the platform specific rendering code.


represents the controller of presentation layer of an Android application, e.g. a screen which the user sees. An Android application can have several activities and it can be switched between them during runtime of the application. Each activity has a lifecycle and run over an independent process. Android OS is the responsible to destroy the activity for save performance.

Each Activity normally has associated an layout . A Layout represent a view (page) to show on screen. It`s composed by visual components or sub-views.

For example in a Model, View Controller MVC  paradigm, the view should be the layout and the Controller the activity is the place access to the visual components of the view and receives the events e.g. at push a button.

In the following chapters will explain the android concepts related to view (layout), controller (activity), model (logic) and persistence in depth.


Environments Artifacts

The principal artifacts are the following, don’t worry, in the next chapter we are explaining by example the use of each piece.


Android Studio Structure Project Artifacts

Android Studio Structure Project Artifacts


This contains the .java source files for your project. By default, it includes an source file having an activity class that runs when your app is launched using the app icon.


This is a directory for drawable objects that are designed for high-density screens.


This is a directory for files that define your app’s user interface.


This is a directory for other various XML files that contain a collection of resources, such as strings and colours definitions.


This is the manifest file which describes the fundamental characteristics of the app and defines each of its components.


This is an auto generated file which contains compileSdkVersion, buildToolsVersion, applicationId, minSdkVersion, targetSdkVersion, versionCode and versionName

Application & Process

Processes and Application Life Cycle

In most cases, every Android application runs in its own Linux process. This process is created for the application when some of its code needs to be run, and will remain running until it is no longer needed and the system needs to reclaim its memory for use by other applications.

When an application component starts and the application does not have any other components running, the Android system starts a new Linux process for the application with a single thread of execution. By default, all components of the same application run in the same process and thread (called the “main” thread).

An unusual and fundamental feature of Android is that an application process’s lifetime is not directly controlled by the application itself. Instead, it is determined by the system through a combination of the parts of the application that the system knows are running, how important these things are to the user, and how much overall memory is available in the system.

Low Memory & killed process

To determine which processes should be killed when low on memory, Android places each process into an “importance hierarchy” based on the components running in them and the state of those components. These process types are (in order of importance):

    1. A visible process is doing work that the user is currently aware of, so killing it would have a noticeable negative impact on the user experience. A process is considered foreground in the following conditions:
      • It is running an Activity that is visible to the user on-screen but not in the foreground (its onPause() method has been called). This may occur, for example, if the foreground Activity is displayed as a dialog that allows the previous Activity to be seen behind it.
      • It has a Service that is running as a foreground service, through Service.startForeground() (which is asking the system to treat the service as something the user is aware of, or essentially visible to them).
      • It is hosting a service that the system is using for a particular feature that the user is aware, such as a live wallpaper, input method service, etc.

      The number of these processes running in the system is less bounded than foreground processes, but still relatively controlled. These processes are considered extremely important and will not be killed unless doing so is required to keep all foreground processes running.

    2. A service process is one holding a Service that has been started with the startService() method. Though these processes are not directly visible to the user, they are generally doing things that the user cares about (such as background network data upload or download), so the system will always keep such processes running unless there is not enough memory to retain all foreground and visible process.Services that have been running for a long time (such as 30 minutes or more) may be demoted in importance to allow their process to drop to the cached LRU list described next. This helps avoid situations where very long running services with memory leaks or other problems consume so much RAM that they prevent the system from making effective use of cached processes.
    3. A cached process is one that is not currently needed, so the system is free to kill it as desired when memory is needed elsewhere. In a normally behaving system, these are the only processes involved in memory management: a well running system will have multiple cached processes always available (for more efficient switching between applications) and regularly kill the oldest ones as needed. Only in very critical (and undesireable) situations will the system get to a point where all cached processes are killed and it must start killing service processes.


By default, all components of the same application run in the same process and most applications should not change this. However, if you find that you need to control which process a certain component belongs to, you can do so in the manifest file.

The manifest entry for each type of component element—activity, service, receiver, and provider—supports an android:process attribute that can specify a process in which that component should run. You can set this attribute so that each component runs in its own process or so that some components share a process while others do not. You can also set android:process so that components of different applications run in the same process—provided that the applications share the same Linux user ID and are signed with the same certificates.

The application element also supports an android:process attribute, to set a default value that applies to all components.

Info Links

Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Leave a Reply

Social media & sharing icons powered by UltimatelySocial