Codecademy Logo

Why Android?

Android Hardware

Hardware is the physical “hard” components of the phone, like the screen, battery, processor and motherboard, or even more obscure hardware devices like accelerometers, gyroscopes, proximity sensors, etc. The software is the intelligence that makes the phone run, manages all of the input/output, and runs the apps (in this case Android).

A simplified illustration of the hardware in a mobile phone.

In the center of the illustration there is a mobile device with a blank screen. Extending out to the right from the center right edge of the device there is a line connected to an illustration of a battery in the top right corner of the illustration, and another line connected to an illustrated processor in the bottom right corner. 

From the center bottom edge of the device there is a line connected to an illustrated accelerometer. There is another line extending to the left from the top left corner of the device that is connected to an illustration of a proximity sensor. There is another line extending to the left from the left center edge of the device that is connected to an illustrated motherboard. Finally there is another line extending from the bottom left edge of the device connected to an illustration of a gyroscope.

Android Software

Software is the intelligence that operates the hardware, manages all of the input/output, and runs the apps. It’s the brain of the device.

A collection of various software application icons on a mobile device screen with a pink brain at the top of the illustration above the device. Layered on top of the brain in the center there is the green Android alien icon. There is a right pointing curved arrow pointing to the bottom left side of the brain, and another right pointing curved arrow on the other side of the brain pointing up and to the right.

Under the brain there are short straight lines connected to the top edge of the device. The software applications on the device screen are organized into three rows of three application icons. The top row has the Spotify logo, the Youtube logo, and the Angry Birds game logo. The middle row contains the SoundCloud icon, the Vimeo icon, and a chess application icon. The bottom row contains the Google Play Music icon, the Microsoft Word icon, and a sudoku game icon. Each of these logos and icons are in the shape of a circle

Android Source Code Modification

Because the Android source code is modifiable by companies selling the phones, the actual user interface from device to device will vary as well. Depending on the brand of phone and when it was purchased the default UI may differ.

An illustration of many Android devices in a basket. 

At the top of the illustration there is a pink brain. Layered on top of the brain in the center there is the green Android alien icon. Extending from the brain are lines that have yellow and blue circles at the end and look like circuitry. Under the brain with the Android icon and circuitry there is a red shopping basket with four different Android devices.

Android Software Development Kit

The Android Software Development Kit contains the libraries and tools you need to develop Android Apps.

An illustration of the Android Software Development Kit.

On the left side of the illustration there is a shelf of colorful books. In the center of the book shelf illustration there is a large white right angle bracket followed by a white underscore . To the right of the bookshelf there is the green Android alien icon that has a toolbelt on and has its right arm pointing up. The final illustration is to the right of the alien icon and is the mathematical symbol for a function (which looks like a lowercase letter 'f' followed by a lowercase letter 'x').

Under the Android alien icon there is the text 'SDK' to label the entire illustration.

Android Studio

Android Studio is an Integrated Development Environment (IDE) created by Google which is used to develop Android apps. Android Studio is a program specifically designed to make developing Android Apps easier, it helps to streamline development, and contains useful tools like a visual layout editor, a debugging suite, and a collection of device emulators to test your apps on. It also has the ability to load your app up on a real android device, and package your app for deployment to the Google Play Store.

Android Studio logo.

The Android Studio logo is a compass used to draw circles. There is a hinge adjusted so the two legs form a sixty degree angle. The left most arm is pointing toward the bottom left corner (of the container it's in). The right most arm is pointing to the bottom right corner. The handle of the compass is pointing up. The compass legs and hinge are white, while the handle is dark gray. 

Behind the compass there is a circle where the top half of the circle is a darker green than the bottom half.

The compass has shadows as if a light source is coming from the upper left area (of the container the logo is in).

How to Write Android Apps

Android apps are developed in one of two programming languages, either Java or Kotlin. Apps also utilize Extensible Markup Language (XML) which is used to describe data resources, build configuration files, and describe the UI of apps.

The logos for the Java and Kotlin programming languages.

The Java logo is on the left, the Kotlin logo is on the right, and in the center there is an illustrated robot character.

The Java logo is a line drawing of a steaming cup of coffee, with little detail. The cup and saucer is blue and the steam lines are red. The word 'Java' is in white below the coffee cup and saucer.

The Kotlin logo is two triangles and a trapezoid that form a blocky letter 'K'. The triangles are a blue to purple gradient, while the trapezoid is a pink to orange gradient. The word 'Kotlin' is in white, below the blocky letter 'K'.

The illustrated robot between the Java and Kotlin logos has a geometric body.  The "head" is the shape of a half square with very rounded corners. Connected to the "head",  with a centered vertical line as the "neck", is the "torso" which is a square. The upper "arms" are short, horizontal lines coming out from the body. There is a perpendicular line attached to each outer edge of the "upper" arms that starts above where the horizontal line attaches to the "torso" . These vertical lines are meant to be the "forearms", and the forearms are pointing down. The hands are horseshoe shaped with the opening of the horseshoe shape pointing down. The "legs" are connected to the "torso" via a centered vertical line. Connected to this vertical line is a horizontal line that is meant to be the upper "legs". There are two vertical lines (meant to be the lower "legs") on the very left and very right sides of the upper "legs" line. The lower "legs" are connected to the "feet". The "feet" are a capsule shape meant to look like the wheels of a track vehicle that has three wheels. The left and right half of the robot are mirrors of each other. The robot is various shades of blue. The right half of the robot has deeper tones of each shade of blue mirrored from the left side.

Android Virtual Devices

The Android emulator allows you to run your app on an Android Virtual Device (AVD), which behaves just like a physical Android device. You can set up numerous AVDs, each emulating a different type of device.

The Android emulator with an example of an Android Virtual Device (AVD) instance.

The Android emulator has an AVD smartphone and a bar of device controls displayed. The AVD is displaying a live preview of a view that contains a status bar, a heading, text, and a button. 

The status bar is at the very top of the device screen. It takes up the full width of the device screen and about 2% of the device screen height. It shows the time, a settings (cog) icon, a security (shield) icon, and a file icon in the upper left corner of the bar. On the right side of the status bar there is a wifi icon, a cellular service (bars) icon, and a battery icon. The background is dark blue-green, with white font/icon color.

Under the status bar there is a heading. The heading is a medium blue-green rectangle with text. The rectangle is the width of the device screen, and about 10% of the device screen height. There is the text, 'Hello World', on the left side of this rectangle in white font, with padding on the left of the word 'Hello'. The text is centered vertically in the rectangle. 

Under the heading there is the text 'Hello World!' The text is centered vertically and horizontally (in the remaining space of the device screen). The background color of the text is yellow while the text is dark gray. The text also takes up about 10% of the device screen's height.

Under the 'Hello World!' text there is a button. The button is centered horizontally and vertically between the 'Hello World!' text and the bottom of the view. The button has the text 'Button' in all capital letters. The button text has padding on each side of the text and has a gray background and dark-gray text color. The button width is about 20% of the device screen width, and about 5% of the device screen height.

At the bottom of the device under the view, there are device navigation controls. From left to right, the controls are: a back button (triangle), a home button (a circle), and a recently used apps button (square). These device navigation controls are light gray shapes that contrast with the black background of the device.

To the right of the AVD there is a bar of device controls. The bar is a long vertical rectangle. At the top left of the bar there is a close (X) icon, and at the top right there is a minimize (minus) icon. Under the close and minimize icons there are the following controls: power button, volume up, volume down, rotate device left, rotate device right, camera, zoom-in, back button (triangle), home button (circle), and a recently used apps button (square). At the bottom of the controls bar, there is a more icon (three dots).

Integrated Development Environment

Android Studio is the official integrated development environment for Google’s Android operating system, built on JetBrains IntelliJ IDEA software and designed specifically for Android development. It is available for download on Windows, macOS and Linux based operating systems. It is a replacement for the Eclipse Android Development Tools as the primary IDE for native Android application development.

 Android Studio logo.

The Android Studio logo is a compass used to draw circles. There is a hinge adjusted so the two legs form a sixty degree angle. The left-most arm is pointing toward the bottom left corner (of the container it's in). The right-most arm is pointing to the bottom right corner. The handle of the compass is pointing up. The compass legs and hinge are white, while the handle is dark gray. 

Behind the compass there is a circle where the top half of the circle is a darker green than the bottom half.

The compass has shadows as if a light source is coming from the upper left area (of the container the logo is in).

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.

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