Android Operating System
- Android Versions
- Android 1.0
- Android 1.5 Cupcake
- Android 1.6 Donut
- Android 2.0 Eclair
- Android 2.2 Froyo
- Android 2.3 Gingerbread
- Android 3.0 Honeycomb
- Android 4.0 IceCreamSandwich
- Android 4.1 JellyBean
- Android 4.4 KitKat
- Android 5.0 Lollipop
- Android 6.0 Marshmallow
- Android 7.0 Nougat
- Android 8.0 Oreo
- Android 9.0 Pie
- Android 10 Q
- Android 11 R
- Android 12 S
- Building blocks: activities, intents, services, providers, receivers, context
- User interface: layouts, views, drawables
Android operating system is the largest installed base among various mobile platforms across the globe. Hundreds of millions of mobile devices are powered by Android and it conquered around 71% of the global market share by the end of 2021. The company Open Handset Alliance developed Android based on the modified version of the Linux kernel and other open-source software. Google sponsored the project at initial stages and in the year 2005, it acquired the whole company. In September 2008, the first Android-powered device was launched in the market. Android dominates the mobile OS industry because of the long list of features it provides. It’s user-friendly, has huge community support, provides a greater extent of customization, and a large number of companies build Android-compatible smartphones. As a result, the market observes a sharp increase in the demand for developing Android mobile applications, and with that companies need smart developers with the right skill set. At first, the purpose of Android was thought of as a mobile operating system. However, with the advancement of code libraries and its popularity among developers of the divergent domain, Android becomes an absolute set of software for all devices like tablets, wearables, set-top boxes, smart TVs, notebooks, etc.
Google first publicly announced Android in November 2007 but released Android 1.0 on 23 September 2008. The first phone that was launched with Android 1.0 was T-Mobile G1 (HTC Dream) in September 2008. This version marked the beginning of Android and it came with a physical keyboard, notification in status bar, camera support, Android market for applications, web browser, grouping of icons in one folder, email support, media player, add widgets to home screen, YouTube, Wi-Fi, Bluetooth and Google apps like Gmail, Google Maps, Google Search, Google Talk, Google Sync, etc.
In February 2009, Android 1.0 version was updated to Android 1.1 and some of the modifications included the provision of attaching a document in messages, longer on-call screen timeout – when the phone was put on speaker and detailed view of maps. However, Android was still evolving.
Android 1.5 Cupcake
On 27 April 2009, Android update 1.5 Cupcake was released and the tradition of naming Android versions was born. It was the first Android version to have an on-screen keyboard instead of a physical keyboard attached to the mobile earlier; this marked a big revolution. It also supported third-party widgets and video recording.
Android 1.6 Donut
Android Donut was released in September 2009 with CDMA network support and the ability of the OS to operate on a variety of screen sizes and resolutions. The donut was the first version that included Quick Search Box that allowed users to accomplish a lot of functions like web-search, store contacts, local files and more directly from home screen. It revolutionized the Android market with the provision of top free and paid apps as part of third-party app catalog.
Android 2.0 Eclair
On 26 October 2009, Android 2.0 Eclair was released with Motorola Droid phone that brought some massive changes to the operating system. Android 2.0 was the first device that featured Google Maps navigation. Turn-by-turn directions using Google Maps data included several features found in car navigation such as 3D view, voice guidance and traffic information without any charges. This version added HTML5 support to browser, ability to play videos and added screen lock to swipe to unlock. The comma key on the soft keyboard was replaced with a microphone, so that users could transcribe anything from their voice and it also supported multiple accounts.
Android 2.2 Froyo
On 20 May 2010, Android 2.2 Froyo was released in Nexus One, which was the first Nexus phone to be released and also the first phone to get the Android Froyo update. This update took Android voice capabilities to the next level with Voice Action, which allowed users to perform functions such as searching, getting directions, making notes, setting alarms and more with only sound. It provided users pin unlock feature, which was perfect for those who didn’t like pattern lock screen.
Android 2.3 Gingerbread
On 6 December 2010, Google released Nexus S with Android 2.3 Gingerbread, which was co-developed with Samsung. It was designed with the facility of graphics-intensive 3D games that took gaming to new heights. In this version, the new feature was NFC, which is used to transmit information between devices just by bringing them close together and it also includes front facing camera so that people can take selfies. It featured some more sensors like gyroscope, barometers, gravimeters, etc. This version improved the keyboard which offered new interface for keys and added battery management so that users could see the performance of their device.
Android 3.0 Honeycomb
Android 3.0 Honeycomb was released on 22 February 2011 in Motorola Xoom. It was later updated to 3.1 and 3.2. This version, basically designed for tablet, enhanced the facility of reading books, watching videos, exploring maps and doing many more things. In this version, Physical Home, Back and Menu buttons were removed and replaced with softkeys that were used in navigation. It also featured quick setting and OTG connection so that users could use a USB drive.
Android 4.0 IceCreamSandwich
Android 4.0 IceCreamSandwich was released on 19 October 2011 with Samsung Galaxy Nexus. It contained many of Honeycomb’s features such as virtual keys for Home, Back and Menu buttons as well as new features such as face unlock, swipe away recent apps, notifications, and 1080p video recording, etc. This version introduced app folders, and Data Usage control which enabled users to manage network data to keep costs under control and also added Android beam that allowed two phones to instantly share content via NFC by simply touching them together.
Android 4.1 JellyBean
On 27 June 2017, Android 4.1 JellyBean was released and it featured Google Now that allowed people to get information. Google Now gave weather information to know the time to commute before leaving home. This version added notification expanding feature and direct action from notifications. In this version, people could create or switch to multiple accounts with each account having its own customized home screen.
Android 4.4 KitKat
Android 4.4 KitKat was released on 25 June 2014 with Nexus 5 that featured the “OkGoogle” feature so that people could access Google Now without touching the phone with their hands. This hands-free activation worked only when screen was on. People were able to send text, get directions or even play a song. It also added full-screen apps, new hangouts app and new phone dialer.
Android 5.0 Lollipop
On 25 June 2014, Android 5.0 Lollipop was released with Nexus 6. This version included “Material Design”, an entirely new user interface based on shadows and motion. Material Design unites the classic principle of good design with the innovation of what’s possible through technology. The Lollipop version supported all screen sizes in both phones and tablets, TV, and Android Wear Watch. It also added direct notifications feature from lock screen so that users could view notification on lock screen and respond to the messages directly from home screen.
Android 6.0 Marshmallow
On 28 May 2015, the Android version 6.0 Marshmallow was released with Nexus 6P and Nexus 5X smartphones, along with its Pixel C tablet. It included features such as a new vertically scrolling app drawer along with Google Now on top, making Google Now accessible by just tapping and holding home key whether in app or website. It added fingerprint biometric unlocking of smartphone, USB Type-C support and Android Pay, etc. It also added permission feature so that users could decide what they want to share with the apps.
Android 7.0 Nougat
Android 7.0 Nought was released on 22 August 2016 with Pixel and Pixel XL, along with the LG V20. This version included multitasking enabling people to use split-screen mode that allowed use of two apps at the same screen and quick switching between apps. This version also changed behind the screen like switching JIT compiler to speed up apps, supported the Vulkan API for faster 3D rendering and enabled OEMs to support its Day dream Virtual Reality platform.
Android 8.0 Oreo
Android8.0 Oreo version was released on 21 August 2017. This version allowed short notifications based on importance and ability of snooze notification. It also included visual changes such as settings menu, along with native support for picture-in-picture mode, auto fill APIs for management to fill data and password and it replaced all blob-shaped emojis with Gradient Outlines.
Android 9.0 Pie
On 6 August 2018, Android 9.0 Pie was released. This version is designed to extend the battery, including prediction of app that can be used in the device by machine learning. It has a feature named Shush that automatically puts your device at Do Not Disturb mode when you turn your phone screen-down on a flat surface.
Android 10 Q
Google released Android 10 in September of 2019. Most noticeably, the software brought about a totally reimagined interface for Android gestures, this time doing away with the tappable Back button altogether and relying on a completely swipe-driven approach to system navigation.
Android 10 packed plenty of other quietly important improvements, including an updated permissions system with more granular control over location data along with a new system-wide dark theme, a new distraction-limiting Focus Mode, and a new on-demand live captioning system for any actively playing media, support for foldable phones and 5G.
Android 11 R
Android 11, launched at the start of September 2020, is a pretty substantial Android update both under the hood and on the surface. The version’s most significant changes revolve around privacy: The update builds upon the expanded permissions system introduced in Android 10 and adds in the ability for users to grant apps certain permissions — those related to location access, camera access, and microphone access — only on a limited, single-use basis.
Android 12 S
Google officially launched the final version of Android 12 in October 2021. Android 12 features the biggest reimagining of Android’s interface since 2014’s Android 5.0 (Lollipop) version. That version, was the first to showcase Google’s then-new Material Design standard. And this one is the first to integrate an updated and completely overhauled take on that standard — something known as Material You.
Material You brings a dramatically different look and feel to the entire Android experience, and it isn’t limited only to system-level elements, either. Eventually, Android 12’s design principles will stretch into both apps on your phone and Google services on the web. The same principles will show up on Chromebooks, Smart Displays, and Google-associated wearables as well. And since a huge part of the Material You concept is allowing you to customize the palette and other specifics of the interface’s appearance — even having your phone generate dynamic personalized themes for you on the fly, based on the colors of your phone’s wallpaper at any given moment — the changes run deep and will absolutely be noticeable.
Currently the distribution looks like this:
Building blocks: activities, intents, services, providers, receivers, context
Developing the Android Application using Kotlin is preferred by Google, as Kotlin was made an official language for Android Development in Google I/O 2017, which is developed and maintained by JetBrains. Previously Java was considered the official language for Android Development.
Advantages of Android Development
- The Android is an open-source Operating system and hence possesses a vast community for support.
- The design of the Android Application has guidelines from Google, which becomes easier for developers to produce more intuitive user applications.
- Fragmentation gives more power to Android Applications. This means the application can run two activities on a single screen.
- Releasing the Android application in the Google play store is easier when it is compared to other platforms.
- Disadvantages of Android Development
- Fragmentation provides a very intuitive approach to user experience but it has some drawbacks, where the development team needs time to adjust to the various screen sizes of mobile smartphones that are now available in the market and invoke the particular features in the application.
- The Android devices might vary broadly. So the testing of the application becomes more difficult.
As the development and testing consume more time, the cost of the application may increase, depending on the application’s complexity and features.
An android component is simply a piece of code that has a well defined life cycle e.g. Activity, Receiver, Service etc.
The core building blocks or fundamental components of android are activities, views, intents, services, content providers, receivers and context.
An activity is usually a single screen that the user sees on the device at one time. An application typically has multiple activities, and the user flips back and forth among them. As such, activities are the most visible part of your application.
Just like a website consists of multiple pages, so does an Android application consist of multiple activities. Just like a website has a “home page,” an Android app has a “main” activity, usually the one that is shown first when you launch the application. And just like a website has to provide some sort of navigation among various pages, an Android app should do the same.
On the Web, you can jump from a page on one website to a page on another. Similarly, in Android, you could be looking at an activity of one application, but shortly after you could start another activity in a completely separate application. For example, if you are in your Contacts app and you choose to text a friend, you’d be launching the activity to compose a text message in the Messaging application.
Activity Life Cycle
Launching an activity can be quite expensive. It may involve creating a new Linux process, allocating memory for all the UI objects, inflating all the objects from XML layouts, and setting up the whole screen. Since we’re doing a lot of work to launch an activity, it would be a waste to just toss it out once the user leaves that screen. To avoid this waste, the activity life cycle is managed via Activity Manager.
Activity Manager is responsible for creating, destroying, and managing activities. For example, when the user starts an application for the first time, the Activity Manager will create its activity and put it onto the screen. Later, when the user switches screens, the Activity Manager will move that previous activity to a holding place. This way, if the user wants to go back to an older activity, it can be started more quickly. Older activities that the user hasn’t used in a while will be destroyed in order to free more space for the currently active one. This mechanism is designed to help improve the speed of the user interface and thus improve the overall user experience.
Programming for Android is conceptually different than programming for some other environments. In Android, you find yourself responding more to certain changes in the state of your application rather than driving that change yourself. So, when it comes to an activity life cycle, you don’t get to say what state the activity is in, but you have plenty of opportunity to say what happens during the transitions from state to state. Here are the states that an activity can go through.
Fragment represents a behavior or a portion of UI in an Activity. It is a kind of sub-activity. Multiple fragments can be combined in a single activity to build a multi-pane UI and reuse a fragment in multiple activities. You can add or remove fragments in an activity, while activity is running. An activity can contain any number of fragments. Fragment life cycle is closely related to lifecycle of its host activity which means when activity is paused, all fragments available in activity will also be stopped. Fragments will have their own layout, events and complete lifecycle.
Intents are messages that are sent among the major building blocks. They trigger an activity to start up, tell a service to start or stop, or are simply broadcasts. Intents are asynchronous, meaning the code that sends them doesn’t have to wait for them to be completed.
An intent could be explicit or implicit. In an explicit intent, the sender clearly spells out which specific component should be on the receiving end. In an implicit intent, the sender specifies the type of receiver. For example, your activity could send an intent saying it simply wants someone to open up a web page. In that case, any application that is capable of opening a web page could “compete” to complete this action.
When you have competing applications, the system will ask you which one you’d like to use to complete a given action. You can also set an app as the default.
Services run in the background and don’t have any user interface components. They can perform the same actions as activities, but without any user interface. Services are useful for actions that we want to perform for a while, regardless of what is on the screen. For example, you might want your music player to play music even as you are flipping between other applications.
Services have a much simpler life cycle than activities. You either start a service or stop it. Also, the service life cycle is more or less controlled by the developer, and not so much by the system. Consequently, we as developers have to be mindful to run our services so that they don’t consume shared resources unnecessarily, such as the CPU and battery.
Content providers are interfaces for sharing data between applications. By default, Android runs each application in its own sandbox so that all data that belongs to an application is totally isolated from other applications on the system. Although small amounts of data can be passed between applications via intents, content providers are much better suited for sharing persistent data between possibly large datasets. As such, the content provider API nicely adheres to the CRUD principle.
Broadcast receivers are Android’s implementation of a system-wide publish/subscribe mechanism, or more precisely, an Observer pattern. The receiver is simply dormant code that gets activated once an event to which it is subscribed happens.
The system itself broadcasts events all the time. For example, when an SMS arrives, a call comes in, the battery runs low, or the system gets booted, all those events are broadcasted, and any number of receivers could be triggered by them.
You can also send your own broadcasts from one part of your application to another, or to a totally different application.
Broadcast receivers themselves do not have any visual representation, nor are they actively running in memory. But when triggered, they get to execute some code, such as starting an activity, a service, or something else.
So far you have seen activities, services, content providers, and broadcast receivers. Together, they make up an application. Another way of saying this is that they live inside the same application context.
Application context refers to the application environment and the process within which all its components are running. It allows applications to share the data and resources between various building blocks.
An application context gets created whenever the first component of this application is started up, regardless of whether that component is an activity, service, or something else. Application context lives as long as your application is alive. As such, it is independent of the activities life cycle.
User interface: layouts, views, drawables
Android Layout is used to define the user interface that holds the UI controls or widgets that will appear on the screen of an android application or activity screen. Generally, every application is a combination of View and ViewGroup. As we know, an android application contains a large number of activities and we can say each activity is one page of the application. So, each activity contains multiple user interface components and those components are the instances of the View and ViewGroup. All the elements in a layout are built using a hierarchy of View and ViewGroup objects.
A View is defined as the user interface which is used to create interactive UI components such as TextView, ImageView, EditText, RadioButton, etc., and is responsible for event handling and drawing. They are Generally Called Widgets.
A ViewGroup act as a base class for layouts and layouts parameters that hold other Views or ViewGroups and to define the layout properties. They are Generally Called layouts.
The Android framework will allow us to use UI elements or widgets in two ways:
- Use UI elements in the XML file
- Create elements in the Kotlin file dynamically
Types of Android Layout
- Android Linear Layout: LinearLayout is a ViewGroup subclass, used to provide child View elements one by one either in a particular direction either horizontally or vertically based on the orientation property.
- Android Relative Layout: RelativeLayout is a ViewGroup subclass, used to specify the position of child View elements relative to each other like (A to the right of B) or relative to the parent (fix to the top of the parent).
- Android Constraint Layout: ConstraintLayout is a ViewGroup subclass, used to specify the position of layout constraints for every child View relative to other views present. A ConstraintLayout is similar to a RelativeLayout, but having more power.
- Android Frame Layout: FrameLayout is a ViewGroup subclass, used to specify the position of View elements it contains on the top of each other to display only a single View inside the FrameLayout.
- Android Table Layout: TableLayout is a ViewGroup subclass, used to display the child View elements in rows and columns.
- Android Web View: WebView is a browser that is used to display the web pages in our activity layout.
- Android ListView: ListView is a ViewGroup, used to display scrollable lists of items in a single column.
- Android Grid View: GridView is a ViewGroup that is used to display a scrollable list of items in a grid view of rows and columns.