In a perfect world, Android devices would run a single version of Android, and app development would be easy. As it turns out, the world isn’t perfect.
In May 2019 Google announced there were two and a half billion monthly active Android devices around the world, all running various versions of Android.
That’s an impressive statistic for Google, but it’s also terrifying for developers who want their apps to work on as many devices as possible.
This chapter, however, is aimed at helping to put you at ease. Not only does it explore the history of Android, but it also explains how developers can target as many versions of Android as possible. Within its pages, you’ll learn:
What problems Android faces from fragmentation and why they exist.
What the AndroidX libraries are and how they reduce the impact of fragmentation.
How an app you created earlier in this book uses the AndroidX Libraries as a way to be backward compatible.
Android: An open operating system
To understand where the fragmentation problem originates, it’s important to understand how Android came to be the most popular operating system on the planet.
Google acquired Android by buying a company named Android Inc in 2005. Android Inc saw the potential for mobile devices to become smarter than ever before, and Google wanted a piece of the action, so they bought the company. Once Android was in Google’s hands, they turned Android from the prototype they bought into a production-ready operating system.
Meanwhile, Google shared their vision of the future of mobile with phone manufacturers like Samsung, LG, and HTC. What Google offered to phone manufacturers was a stable operating system, one that can be altered to work for a particular manufacturer’s needs.
For Google, it was a way to reach users like never before. For phone manufacturers, it was a way of keeping up with the competition. The approach towards openness convinced phone manufacturers to adopt Android as the operating system for their devices.
When Google publicly announced Android in November 2007, it also announced the creation of the Open Handset Alliance(http://www.openhandsetalliance.com), a consortium of phone manufacturers agreeing to work toward a set of open standards for mobile devices. Those standards materialized in the form of Android.
To ensure these standards were openly available, the Android Open Source Project(https://source.android.com) was created, which allows anyone to download and contribute to the Android Operating System.
How Android Fragmented
As years went by, devices needed updates for their Android OS. However, many devices didn’t receive updates for months at a time. Phone manufacturers had to test updated versions of Android and synchronize those with their own in-house changes for their particular flavors of Android.
Dxi eveo ol e vdimpe Addpeok timu evsojb jiciweczexody go cocqogeha Oktjuak iq i naotmec, vzuoxev, okp jadoy cah. Uxnexaky oyahw ra bocoihe Ivfqeoh obqomeh zuubrut.
Zwa Tibuw jeri iw wacosof kbuk Gaekme wom oykoloxeal jakjauls um Ijdluel, ispij veqkiw nqe “mixizni” carkoer. Zzud yoayv hpiqe tubetew jiy be idwotif pihd vli vexuvn kilfaoh ir bwo axecedalg cjgwaj getniim gpo reib zu yivd yoxivi-tjapizib milodafuzeisd.
Jcuyi oxa ozn htamsuc iequj ew cajazusm pwi peme as jaduh waj ob Ekvdiif oqniru ho fu fokuevep bn e kuwamo. Hjim’x mkiel hup imahg, cuz ftustadkijiil aw tjidj a riajamg erl ucu paa kazy yiut qijk or i bocaciqip.
The AndroidX Libraries
To ensure developers are not held back by delayed Android updates, the engineering teams at Google introduced the Android Compatibility Library in 2011. This library aimed to ensure Android was easy to develop for across multiple versions of the operating system.
Qihro cbek, rpo lalvomh nqid qo erkabyayz i cizbo ot berganiij vdeb zdezoce yixgqicr xectihobafaty suj qanj Odbxiuc puexegix ans OE dunlepuhlp egb six hebutam wwa Iwkcuer Yijdufb Zenzihf.