Codecademy Logo

Android Foundations

Android Apps

Apps are the main way a user interacts with their android device, they are essentially programs that run on Android and are composed of one or more interactive screens.

A collection of various application icons with the text 'Apps' to the left of the icons.

The graphic contains the word 'Apps' on the left side, and on the right there are two rows of four application icons. The top row has the SoundCloud logo, the Youtube logo, the Microsoft Word logo, and a chess application icon. Each of these logos and icons are in the shape of a circle. The bottom row contains the Google Play Music icon, the Vimeo icon, a notes icon, and a sudoku game icon. Each of the icons in the bottom row, except for the notes icon, are also in the shape of a circle, while the notes icon is a rounded square.

Android System Apps

System apps are apps the system has recognized as the default apps to perform common tasks like email, texting, camera operation, etc.

An illustrated example of a smartphone home screen displaying icons for 4 apps.

At the top left of the home screen there is a Google Play Store app icon. The Google Play Store app icon is a right pointing  triangle made up of smaller colored triangles in light and dark shades of blue, green, yellow, and red. At the bottom left of the home screen there is a Gmail app icon. The shape of the Gmail app icon is an envelope where the left and right sides, as well as the envelope opening, are outlined in red, to create the letter 'M'. In the bottom center of the home screen there is a Facebook Messenger app icon. The Facebook Messenger app icon is a blue speech bubble with a horizontal white lightning bolt shape in the center. At the bottom right corner of the home screen there is a camera app icon.  The camera app icon is an orange circle with a camera icon in the center.

Java API Framework

The Java API Framework is a set of software libraries and utilities essential for Android Development. This is the layer of the stack that developers will be interacting with and includes things like:

  • UI components
  • Resource management
  • Lifecycle management
A collection of three icons that represents the Java API framework.

The first icon in the collection represents UI Components.  It is left and horizontally centered, and displays a stylized layout similar to a web page. In this layout there is a long purple rectangle followed by a pink square on the right. Under the bar and square there is a rectangle outlined in blue with a white background. In the center of this rectangle there is a long pink bar, under that, there is a purple bar. The purple bar is followed by two small green rectangles, one in the bottom left corner of the layout and one in the bottom right corner. There is space around each of the rectangles that are in the center of the blue outlined rectangle.

The second icon in the upper right corner is a representation of Resource Management. This representation has irregularly stacked rectangles. The rectangles are of various sizes and alternating colors. The first, third, and fifth rectangles are various shades of Orange. The second and fourth rectangles are lighter shades of orange. 

The third icon, in the bottom right corner, representing Lifecycle Management, is a thick green arrow in the shape of the letter 'C'. The arrow is on the top side of the letter C's opening and is pointing down and to the right.

Android Runtime

Each application runs on its own instance of the Android runtime (ART). ART is a managed runtime that runs application code.

Think of an Android Runtime as an isolated container where each app lives and carries out its processes. It’s kind of like the house where each app lives.

An illustrated example of Android runtime (ART).

In the right bottom corner of the illustration there is a house with the text 'A.R.T.' at the top of the house. In the upper left of the illustration there is a rectangular bubble coming from the house. This bubble has a paper icon in the center that has gear icons and binary (zeros and ones) layered on top of the paper icon.

Hardware Abstraction Layer HAL

The hardware abstraction layer (HAL) consists of a number of library modules that manage access to the hardware of an Android device. This hardware includes the camera, audio, Bluetooth connectivity, and various internal sensors. Applications interact with HAL via the Java API framework.

An illustration of four smartphone views that show interaction with the hardware of the phone.  

The left-most illustration shows a screen with a bulleted list of items (rectangles). Above the screen, on top of the device, there is a black capsule shape with three dots in a horizontal line. From left to right the dots are red, yellow, and green. Above the capsule shape there is a blue connectivity icon.

The second illustration from the left shows a smartphone screen with an avatar icon in the center. At the bottom of the device there is a red fingerprint icon over the home button.

The third illustration from the left shows an app layout. The layout has two horizontal white rectangles followed by a square in the bottom left corner of the screen. To the right of the square there are two short rectangles stacked on top of each other.  There is space around each of the rectangles and around the square. At the top right of the device, overhanging the device screen, there is a vertically positioned rectangle. At the center of the rectangle there is a white circle with a heart icon in the center.

The rightmost screen shows a QR code icon with a search icon to the bottom left of the QR code icon.

Linux Kernal

The Linux kernel sits at the base of the Android stack. It handles threading, low-level memory management, security, and drivers. Essentially it’s the core brain of the operation. Linux is an operating system that can be run on desktop computers as well as phones. It’s the most complicated and most highly developed part of the Android stack and is the main reason something like Android is able to exist.

An illustration of the Linux penguin logo.

There is a large blue circle with a penguin sitting in the center. In the upper right corner, on the top edge of the circle, there is an illustrated brain.

Extensible Markup Langauge

XML stands for Extensible Markup Language and is a markup language (not a programming language). Essentially it’s a format for encoding data in a hierarchical (tree like) manner, and is intended to be readable by both humans and computers.

An XML file icon. 

The icon is the rectangular shape of a file icon with the upper right corner of the file (paper) dogeared. In the center of the file icon there is an orange left angle bracket followed by an orange forward slash and finally an orange right angle bracket. At the bottom of the file icon there is an orange rectangle the width of the file (paper) icon with white text, the letters 'XML', in the center of the rectangle.

XML Hierarchal Structure

An XML document is composed of a series of Elements that are organized in a hierarchical fashion through the use of Tags. A tag is a special syntax that indicates where an element should be placed in a document.

A simple illustration of a bonsai tree to illustrate XML hierarchical structure.

The illustration of the bonsai tree has three groups of leaves that are green and cloud shaped. There is one group of leaves at the top right of the tree. Then extending almost straight out to the left and slightly down from the first group of leaves is a second larger group of leaves. From the second group extending slightly down and further right than the first group, is a third set of leaves. This third set of leaves is slightly smaller than the second group of leaves, but larger than the first. Extending diagonally to the bottom left from the third group of leaves is a trunk that ends in a mound of soil. Under the soil is a striped pot that has a lip on the top and curves in and down to a flat bottom that is supported by two legs. The pot has a white stripe at the top, a light blue stripe in the middle, a medium blue stripe at the bottom, and a darker blue for the legs.

Container Tags

Container tags actually consist of two separate tags, a start tag, and an end tag. Each individual tag starts and ends with less than and greater than signs and has the name of the Element in the middle. End tags are differentiated with a forward slash at the beginning of the element name.

Container tags can have other tags nested inside of them, which results in a tree-like structure of elements nested inside one another.

<element1>
<element2>
</element2>
</element1>

Single Tags

Single tags, unlike container tags are self closing, meaning we only have one tag. These look similar to start tags but have a forward slash after the Element name.

<element />

Gradle Build Tool

Android applications can consist of hundreds or thousands of files worth of code, video, audio and images. These need to be packed in a way that can be understood by the Android device, which is where Gradle comes in. The Gradle tool in Android studio will package everything together in a compressed file called and APK, which can then be distributed and run on Android devices.

Example representations of compressed files using the Gradle tool. 

In the example there are three folder icons, two at the top and one at the bottom left. Next to the right of the bottom folder icon there is the text '. APK'. 

Underneath the top left folder icon there are four file icons. The first file icon has a camcorder icon in the center, the second file icon is empty, the third has an audio icon in the center, and the fourth is empty. 

Under the top right folder icon there are also four file icons. The first file icon has an icon of an image in the center, the second file icon is empty, and the third and fourth file icons also contain image icons. Under the third folder icon there are eight file icons in two rows of four. In the first row, the first, third, and fourth file icons are empty and the second file icon has an audio icon in the center. In the second row of file icons, the first, second, and fourth file icons are empty and the third file icon has a camcorder icon in the center.

Android Emulator

Android Studio also includes a suite of emulators which developers can use to test their apps. It comes pre-packaged with emulators for many of the most popular Android devices in the world.

Illustrations of various smartphone views.  

The left-most illustration shows a screen with a bulleted list of four items (rectangles).

The middle illustration shows a smartphone screen with an avatar icon in the center. 

The right-most  illustration shows another app layout view. The layout has two horizontal white rectangles followed by a square in the bottom left corner of the screen. To the right of the square there are two short rectangles stacked on top of each other.  There is space around each of the rectangles and around the square.

Learn more on Codecademy