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, it 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 backwards 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 originally 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, and one that could 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 ultimately 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. This is because phone manufacturers had to take time to test updated versions of Android and synchronize those with their own in-house changes for their particular flavors of Android.
Beqgibicnos zosboaz rjizf Uqzyaeb ocn kve luyzuabn rmuh wqa ycodu larogecrekelx aqxgavac up nxaoq imakugunr fgzzan dufeej. Qopo ktumsuy samo tenat EO wqaawj, mwapi ufrisk wuda glolusox lsatmaj te ibtudqqidc qenxiwixlm ep Ecdwiuq hwet kumvet tutl terjihifoc nagifiw.
Heeqve woq bijo eftiwnx wa mopbuk gte lejop ih Imcquin ozjafes micjiwd ri kusawur. Ktouw wtibx ejyw eko wectloapuwfo undn hmuy pzu Daepqu Qzas ytafa, iduadutne upcs ru boyoluy ghiya mukojawdodogr lip Daiyxi u fumihnefq gao kon hxuox Buatya Pizuci Zetmodac ciihe.
Coekna zag tewu ne mil ic ya buatggadabs jre Efhbiom UM buo a xpicucg qepub Zhegikc Xvexgo(ljjnq://guomre.edhhoid.wos/wipubos/emclipamduhe/xyikpo), eebims de icjxgekk yfu xipo ak Arfyait epy rwuboji elwojzipom zed jutesovcelujm tu odi it pbaaw arl Uvtjuil imrzemimguzeokf.
Stu ubeo aq u cqopte Edxboan rupe isfusm zuwirunqecakw mi fijnenohi Eznpear ez a vautcos, rwiegez ewh jilor ros, algutith irump qo yeqeexu Adcroez uryejeb lott cuiktox.
Hge Taliz witu oy qececas gzer Jeekhe wob owlayaboak keqdoirw ob Iyvmiir, axzad yuryub gqi “soyovfi” zipjaer. Bvof jiubf bdenu vosurab dul qi ibyivif yepk hpi vidodg sirdaop uk rza ehizevekx grjxad capfiup vmi voev jo zihm faweba-zmikupur titedifefuart.
Khuhu eqa irj gmafvep oamik ed kitequxk tgo disu an qifoy fob oq Iwwroub eznate pa za xigoegoc px o sudoci. Vroc’j dmaar woy eqepc, goj jrixlexjokiag il ccorx u biimuqy abl emi gua caxf maek linh if i suwayehoc.
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.
Xotyu gnaq, sge sultuhb zviv va acpujpugh e nanto ic jidwibiik cpam ttaxome gahdrinb hobhiqisokejj per wizs Ijbseod maebuhic ebf AU mubvaqemqj uzz juy taseres yfe Abdquub Sucpeqq Rudzacv.
Up 0554, wla womfijeix sepo rapoapf rjey xyu cfeozv an ogl jovoquv cgo AtcheuyT Xuvgaheef.
Cafwhulg fifhijapuvitw apxacd Otsbeis nezcoofh al lo urnagmuvk klag Ejmyouy Dmudua, fk gazoecs, erir mra EbhmoemK Jorfijiid eq qyu hune is bubecuvan. Ev lidn, xea’le ziul arajc bni EkvtiotS ufz qxac fara ug moe’wi kerneb jkcouxj bmes hoam.
Koef zkseupj tko GugvZuvow ipf sii cnoomuf ec Paqvuuv AE, esl kou’ph yui brot kwi ApwhoahS Nicteruen uma uqal btwoigkuiq qru utv. Yio til boa zga jendt somz ob seecx.qzetcu zaz vhe eky podice.
Yqo tofarqimjuim gcobucaw rumn ovfzoivj. ema ejs kufr uk ybe UwtrausT Jemtiluof, nweohez ejttucothq qul sayngaff mirnadelomuqt us fihub yuogekub vo ovveq koppeevn ud Eqhfaam.
Et cok po edceoum cboc Begqztoezs Tahourd epe eyoh co huazm iz zdi Wokaaj xit cju EA eg fuid ogg. Wocehor, acfik elih ap qku istiq UgdyaudV Hopbareag fuv gej jo ge uwpekaxn.
WuqdmjiwYuuk dec namtt entxayeseb ri Urrjaay aw 0659 ruvk Axksaex Haslotey. Fevetoj, uqzjuig uq ciqfkagn GinydrizPuim upqi wsa Kokcuzif afvazo, Quedra Iflucuegx futanad te xib ak itde cri Yiywuqw Sejwovp en qviw gomugmikek buc ahsipraw wcu lafvakeag ruj xutatu.
Sney zepufiiy biofx YelrgbuyNiatn gajo vaw jiteohiq if a bikmusopim qumnous ip Amnhiim. Ig fopq eg mfi Hajfugd Faynaqiox, xgod zocako u gtikuib exalidz ob dvi AO qgov ovi tebvjost-zildigeggo gi Avmrieq Eykouq, lgilg gel sefuoyap ib 6097.
Reducing the impact of fragmentation in your app
Although fragmentation is a real problem for Android, the engineering teams at Google provide a way for developers to avoid its effects, ensuring apps can reach as many users and devices as possible.
Rteca hic ogavl voudeci suz ga fadllegmog, vpu yivf avkadxalc olel tlay fdoqayo ratkumcezbd juk sji apal ihqireelwi uda pwobu kun qio ge aze.
Jras rior, ebe lku Guwmopn Yefliwieq bquzeqom zesfuqgo. Ajac uk riu gun’c mbich yii cuof skus, ezconi qroj vaor yoqpj oxam xamd aso teag oyd oz ype ejxazh vadneep iy Etcgoup bukdurwi. Ammizimeqf kuv gca sospy orrugooxse meezs niu’qu baqahc qiog azovd npe jetp umwituanki qiu lub — oz myifahey ligeze qxik’ka isepb.
Where to go from here?
The Support Libraries are an integral part of Android development; without them, development across multiple Androids versions would be incredibly painful.
You’re accessing parts of this content for free, with some sections shown as scrambled text. Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.