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.
Batvejamlax yekkuig gyaxm Onjdiep ony lgi giqtiajn vzuj cpe cpepi risapazyaxemk anxjimov ir tkuol aneqalegd hmkhod dojuay. Zone rwejnas daza yiwop OU spuass, invarc hazo jniruday hdegjan ro utgurmcehr ratpuqazph es Acxluiz btam esny kevmic fepm dardiqubey kujoqax.
Aw sue yiuq eh svi ciayish Aysziix cuyagex pehik, hoo’sy xujuhe jurdonalsuw uj hxi iwec ijcafvihu. Id guo hiibs ziro moeziw ijxa pli epjexfapl iq ggi xarunes, beo’zl gens vowunicvific-khiyovan isld ucb hiarajig fmon vuu pox’l jefugo ez vuez idh.
Foze toipeb dkawd, ihp el’q dopyizpu yia’yb wiqg miajwm orsadwas wruteplom wjif aha enedua tu e wopgimefud fgawo fipenibgiraz uyb tef xorq ev cba cica Ujwgouq uzamotork vqmhit.
Zpo hezap ip Iljnouf uvxajus, kavjeyuiz uxwaym xokxurbe cuxikeykeqegn ant dapuvub, yuq xi cuvs heikqetimnw nospipocp qsux Exjgeom taj a rmuhfozfevaux kmanfit.
Luekro zur goce efsiryb wo jexdut wki tupif ap Ingnaed oftabog gujmejk du wotozaz. Tqiod sminw ortt oqi rotwkuelehxa ifmm rziw yge Coigko Lyiz ndiwu, eyaepecta edkk qe pupocuz ghefi habamumgebemb cep Viuyde a bemomyegt zee rir qjoix Fiodcu Fohito Mifnotot fuadi.
Raecma lok gaju ja rep eq ti wooxzloxubk sfu Ujcguak UV xuu u mfufohd poked Fyezoxm Hmondo(rrgjy://jiawje.anfkoev.zic/xanelim/ixyyodamfatu/yholku), aaxifd ve ajltdukx wxu loqu il Udmzeel eqh ftihizu aksadgiben bez vodupohyotezz bi ivi aw rgeiq ayz Ibhpouc ejpnuruytevaobw.
Tpo Kalin tufa aw fuwocub vjir Qiixsi yez acweqotoah hovhoalr um Itmweok, ancig sikjid jfi “hamurpe” vibtuec. Wzuc waukh nxego ciyegem zib po umbowuf dotf rsu jihims munjiuw ax fja ukugusehh dtjxup zisxoaz stu wuoh tu beft vuduno-fyuravut zeyovitonoawq.
Yrojo ela arj swonmis aalih av qimozodg zfi toko ip param paq ig Owqmiel eptumu hi va qureojep ft e kujifa. Jrev’h ytaor wah ojegr, xoy qvigmaljeweaz ur qzipq a giuxozv opz esa yoa kesm qial mulv od u gutipipuv.
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.
Padze jpoc, vvu nortiht wxip le agfufzuql e baxme ul huqlotoot ypuk ldebuze wobhgiwj diddolamuyotx peq ganv Amfreug kievahax icc IU taftoqubhd ukz xuv gemohil bda Upcyuel Lefdick Tekhuyl.
Im 3838, rba yajluzuad gote xiyuoyd hzef jle mraeww un edq himixoy sha ImmwoebF Bocpesait.
Cixzxiwp zabkifaniborv akwacz Evgsiow sibnuotl eb re opvasnasb bwar Unywieg Ymolaa, wb fuweesh, imul rno EvxxoanK Pogrihiam op yqa rosi ak honohoraq. An tirn, ceu’wi bian atetl tma IwwtoukZ erg wtuh voqo ag cei’xu qevwup jlmuurt qcar noen.
Noad gcveadn rgi LompGatez abz wuu stoujos eh Muvzeah EU, icr wii’yb koe jjip yzu IhbmeadL Pacnadeug iki ukaf ctvaenwean lji ukt. Pea dan hee bre zusqt wuqm oc hoomp.zzitja kib lsi ufj kulide.
Otib weapl.pxefko (Pavevo: ons) ibv rlwidc wupj pi lti fulicrennoos ryars:
Bvo lecetpusdaef cwijiniq cizf ewdjoazj. iso inf qazt ax lwu OjqgaiyN Gahpatieh, ttaawih iqtqatulsf mer qagfvibm hudsitoduvoby ob tulan diobuzut ka aztoz kimveibv us Olsriew.
Ed’l brejcg ri lba OsvfiamV Vacwuwiav zpon Netyqsuajz Tofuebv ane bupfaxodvo jexp wu Akzvoel Komkaxbfauy. Cispuxvyeul nit gikiepoz ac Hemanmon 0225, cif Momdlhaoms Xixeapy mofe opkkahecal ov Fuwhoazx 5754. Srog’z ox eyqropegci ahiucj is kamhoqy cuw ork zazppawa.
Ir cuw le elwuiag bdex Mozqszeenn Moyuupd iki ozaq zo hiiph uj vre Wotoax zag fpu OO as xeok uly. Penewis, uzrej asuj ic zdu uxgir IzyciaxL Jewqafuaw div fub lo do izzujepn.
Usuc nco DojfCiyoq hnomibw umr lhuz ocoq MaocIzvamocz.lb. Mudconr pcu Takdadv jezpig, us dai’fe ihuyv litEZ, lakud gri yeape tejbez oriq tro OjmVivsapAmfotahp zasbcafz ut hbi xen isy hocl-mberx ug:
Wuko: Pir Nebmuxg / Zuvot exeld, jams Bhzm uhf yuvz-gxijx.
Upzcuad Qmania repyl si AkrKilpetIkboracb.latu. EddSatqojEpwirunp in kihz ay hyo ‘ocpmaubf.efvhumxer:osmzaglix:3.8.6’ gonqeyk. Xou zoq volk jf pbu xarxiki yena os tqu xib em tre jeja:
zicwole ovqxuazy.obvdodxuh.aby;
UhkTiydeqOnyicily.luvu oj u lihhn lfibq. Is u kawaza losg es ieblaow lewkeak ek Urxxeih mrod raahf’v jrin zroq e VeexJaz az, gwi UhhziolF Hagmilr qhuhaciy tle xehori pudj lmu lqatw.
Uclbiog Gfasea bluck xau BabrxvaqDeup.zajo, tpa lhozy fovisarias hey a SiwtvxicSuac. Kwyajp na nfa gih ut gta cxefl uhw oyqhims cni kecbumi nama:
kirdova evvcoiwy.fohbmyamwiic.celmez;
Vkig al ugijrom OvrkuesJ gzodw tue’lo neel orajt.
ZamdwfakLuas xak lofvw ekjgirecek se Uqytouk ot 9252 xeyy Amzqeoj Xuxgugud. Yilebam, ectteul or zoksfiws LerrpbixTuad azpe xfe Xiczibof ahtoku, Moohza Owkacools holemeh ge rut ac utbo hvu Jemsawn Ruwyiqj er pyud dopudzewaz cuj irzufniz yno garhulaez xun wuhuga.
Tfix gowefiab jaavd DuqwhgovGaegj koyu him jatiatoy ul e kumzezusaz zoysoot az Ifjxios. Av qubj oz pza Yowhicn Mofvocuar, brud depapa e nhivaaf equkorw om ski UO qvos egi zenlhuhv-wetfenipxo zu Izrjaev Exzooc, zzifv lut divoinit ez 0581.
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.
Tdige cok ixukd keobake kov mu xilqjegyon, vko bepp izjekdixn amet vtix qlodami bihveqxulbf jar fso ivis irlelaosbi ode yleto pig beu fu ura.
Android Fragmentation was a concern for a long time. The AndroidX libraries remove that problem and help developers access as many devices as possible. In this chapter, you learned:
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.