Tsarin babbar manhajar Android (5)
Tsarin Gina Manhajojin Android A baya mai karatu ya fahimci yadda aka gina babbar manhajar Android, daga kasa zuwa sama. Tare da bayani kan bangarorin da wannan babbar manhaja ta Android ta kunsa. A karshe, muka ce a bangare na kusa da na karshe ake da tsarin dake lura da tafiyar da dukkan manhajojin da […]
Tsarin Gina Manhajojin Android
A baya mai karatu ya fahimci yadda aka gina babbar manhajar Android, daga kasa zuwa sama. Tare da bayani kan bangarorin da wannan babbar manhaja ta Android ta kunsa. A karshe, muka ce a bangare na kusa da na karshe ake da tsarin dake lura da tafiyar da dukkan manhajojin da mai waya yake mu’amala da su. Har muka kawo misalai da manhajojin sakonnin tes (Message Application), da kuma manhajar lambobin mai waya (Contact Application). A wannan mako in Allah Ya so, mai karatu zai san yadda ake gina manhajoin da yake mu’amala da su ne a wayarsa mai dauke da babbar manhajar Android, tare da tsarin gina su, da kuma rayuwarsu baki daya.
“Sarkin Gida” (Actibity Manager)
Da farko dai, kafin bayani kan tsarin da Sarkin Gida (Actibity Manager) ke bi wajen tafiyar da wayar gaba daya, zai dace mai karatu ya koyi wani sabon karatu daga wasu kalmomi na turanci da ya sansu, amma ma’anarsu ta sha bamban da yadda ya sansu. Wannan ne kadai zai taimaka masa wajen fahimtar tsarin da wannan Sarkin Gida yake bi wajen aiwatar da ayyukansu. A nan ne kuma, idan mai karatu ya natsu, zai gane dalilin da ya sa na kira wannan tsari da suna: “Sarkin Gida.” Ga kalmomin nan:
Applications
Kalmar “Application” kamar yadda watakila mai karatu ya sani, na ishara ne ga manhaja ko masarrafar da mai waya ke amfani ko mu’amala da su. Wadannan manhajoji dai sun hada da wadanda wayar take zuwa da su (irin su manhajar “Message” da manhajar “Contact” da manhajar “bideo” da dai sauransu), da kuma wadanda mai karatu ke iya saukarwa kyauta ko ta hanyar saya, daga Cibiyar Manhajoji na kamfanin Google da wayar ke zuwa da su, wato: “Google Play” ko “Play Store.”
Wadannan manhajoji duniyoyi ne masu zaman kansu, saboda irin sarkakiyar da ke ciki wajen gina su. Wadanda ke gina su su ne masana kan manhaja da masarrafar kwamfuta, wato “Debelopers” ko “Computer Programmers.” Duk da dayan sunan na ishara ne ga “gina manhajar kwamfuta,” sai dai suna ne kawai; su ne dai masu gina manhajar wayoyin salula har wa yau. Bayani kan tsari da kintsi da hakilon da suke shiga ko yi wajen gina wadannan manhajoji ko masarrafai kuma, wannan wani karatu ne mai zaman kansa da nan gaba mai karatu zai ci karo da shi.
Actibity
Kalmar “Actibity” na nufin aiki ne, a hakikanin ma’anarta a luggar turanci. Amma a ilimin gina manhajar Android (Android Programming), kalmar na ishara ne ga dukkan wani nau’in mu’amala da za ka iya yi da manhajar wayar salula. Misali, daga lokacin da ka budo manhajar aika sakon tes, shafin da ya budo mai dauke da jerin sakonninka, “Actibity” ne, idan ka sake latsa wani bangare a cikin manhajar (kamar tsarin rubuta sakonnin tes, wato Compose, misali), sai a dakatar da asalin shafin da kake a baya, a budo maka wanda ka bukata. Idan k agama rubuta sakonka, sai ka latsa alamar “Send,” nan ma sai a sake dakatar da wancan shafi da kake ciki (duk da kai za ga shafin ya bace) a tsallaka da kai zuwa shafin da jerin sakonninka suke. Wannan shafi da aka dawo da kai (idan daga gare shi ka fita a baya), an farkar da shi ne don ci gaba da aikinsa. Da zarar ka rufe manhajar baki dayanta, sai “Sarkin Gida” ya kashe rayuwar manhajar baki daya. Kada mai karatu ya rikice da wadannan kalmomi; nan gaba zai fahimce su sosai, cikin sauki.
Wannan tsari na “Actibity” yana da marhaloli har guda biyar. Bayani kan wadannan marhaloli na nan tafe nan ba da jimawa ba. Zagayen marhalolin da tsarin “Actibity” ke bi, daga farko zuwa karshe, shi ake kira “Actibity Lifecycle.” Marhalar farko ita ce marhalar “Rayuwa.” Marhala ta biyu ita ce marhalar “Gudanuwa.” Marhala ta uku ita ce marhalar “Dakatarwa.” Marhala ta uku ita ce marhalar “Farkarwa.” Marhala ta hudu ita ce marhalar “Tsayarwa.” Sai marhala ta karshe, wato marhalar “Kashewa.”
Wadannan tsare-tsare da marhaloli da tsarin “Actibity” ke bi sun samo asali ne tun daga wajen gina manhajar. Maginin manhajar ne ya tsara su haka, domin ka’ida ce dake cikin tsarin gina manhaja ko masarrafai da ake iya mu’amala da su a kan babbar manhajar Android. Don haka dole ne maginin masarrafar ya shigar da wannan tsari da kowace manhaja ke bi a rayuwarta, a yayin da ya zo gina manhajar da yake kan ginawa.
Intent
A harshen Turanci idan aka ce “Intent” ana nufin manufa ce, ko nufi, ko wani abu da mutum ke da shi a ransa yake son aikatawa ko aiwatarwa. Amma idan ka kutsa cikin fannin gina manhajar wayoyin salula na babbar manhajar Android, ma’anar kalmar ta canza, nesa ba kusa ba. Kalmar Intent na nufin wani yunkuri da wani bangaren masarrafa ko manhaja ta yi, don neman aiwatar da wani aiki da mai wayar ya ba ta. Misali, idan aka turo maka sakon Imel ko tes mai dauke da adireshin gidan yanar sadarwa da ake son ka shiga, da zarar ka matsa ko latsa adireshin, nan take wayarka za ta tambayeka: “Da wacce manhajar shiga Intanet kake son aiwatar da wannan aiki?,” tare da kawo maka hotunan nau’ukan masarrafar shiga Intanet dake cikin wayar, ka zabi wanda kake so. A gefen dama za ka ga “Just Once” a daya bangaren kuma za ga “Always.” Idan ka latsa “Just Once,” to, a duk sadda ka nemi aiwatar da aiki irin wannan sai an sake gabatar maka da wannan hoto. Amma idan ka latsa “Always” ne, to, manhajar da ka zaba ita ce za a rika ba ta dama wajen shigar da kai Intanet idan bukata irinta ta sake tasowa.
Tsarin da ya zaburar da wannan hoto da ake tambayarka a kai, shi ake kira “Intent.” Kuma dole ne, zan maimaita, dole ne ga mai gina manhajar Android ya shigar da wannan tsari a manhajar da yake ginawa don amfani da ita a kan babbar manhajar Android.
Serbice
Wannan tsari mai suna “Serbice” a harshen Turanci wani irin tsari ne dake gudanuwa a karkashin kasa. Ba ya mu’amala da kai kai-tsaye. Misali, idan ka budo manhajar sauraron sauti (“Music” ko “Sound,” misali), nan take wannan tsari ya fara gudanuwa a karkashin kasa, kai ba za ka sani ba. Idan ka je “Application Monitor” (idan har kana da wannan tsari a wayarka), za ka ga sunayen manhajojin da suke gudanuwa a wayarka; da wadanda suke bude kana ganinsu da wadanda ba ka iya ganinsu a zahiri. Wannan suna da kake gani, ba hakikanin manhajojin ba ne, a’a, tsarin “Serbice” ne da ke gudanar da su. Rayuwar wannan tsari ba ta da tsawo. Da zarar ka kulle wata manhaja da ka budo, nan take su ma sai su “mutu.”
Content Probiders
“Content Probiders” tagwayen suna ne da ke nufin “Tsarin musayar bayanai a tsakanin manhajojin wayar salula mai dauke da babbar manhajar Android.” A ka’ida, duk manhajar da ka budo, tana budowa ne tare da bayanan da take dauke da su. Misali, idan ka budo manhajar “Contacts” wacce ke bayyana maka lambobin abokanka da ka adana a waya, nan take za ka ga sunayensu tare da lambobin; iya gwargwadon yadda ka tsara manhajar. Duk da cewa manhaja daya ce ka budo, amma manhajoji biyu ne suka budo. Ta farko ita ce manhajar da ka latsa alamarta a shafin wayarka, wato alamar “Contacts” kenan. Manhajar ta budo, wacce idonka ba ya iya gani, ita ce manhajar “Contact Content Probider.”
Wannan manhaja ta biyu, wacce ba ka iya gani a zahiri, ita ce ke dauke da dukkan lambobin, wato hakikanin lambobin nake nufi. Ita manhajar farko da ka latsa kuma, hanya ce, wacce ke dauke da wasu hanyoyi (kamar tsarin shigar da lamba – Add Contact – da tsarin goge lamba – Delete Contact – da tsarin sanya hoton mai lambar waya – Contact Image/Pic, da dai sauransu). Amma hakikanin lambobin fa? Suna can cikin wancan manhaja da ba ka iya gani a zahiri.
Haka lamarin yake idan ka budo manhajar “Message,” asalin sakonnin suna dauke ne a cikin “Message Content Probider.” Idan ka budo manhajar “Multimedia” ma, asalin bayananka na sauti da bidiyo da hotuna da kake cin karo da su a cikin wannan manhaja, duk suna dauke ne a cikin manhajar “Multimedia Content Probider.” Idan ka je bangaren “Settings” – wato Tsare-tsare – ma haka lamarin yake. Duk abin da kake cin karo da su daga sama zuwa kasa na bayanai, wadanda kake tsara yadda za ka yi mu’amala da wayar da su, duk asalinsu a cikin “Settings Content Probider” suke.
Daga bayanan da suka gabata mai karatu zai fahimci cewa, lallai “Content Probiders” wani tsari ne da ke taskance bayanan mai waya, wadanda ya zuba da kanshi. A takaice dai, tsarin “Content Probiders” rumbun adana bayanai ne. Kowace wayar salula na da wannan tsari, amma na Android ya sha bamban, saboda kwarewar maginansa. Asalin dabarun gina rumbun adana bayanai (Database Programming) da babbar manhajar Android ke amfani da shi wajen yin wannan aiki kuwa shi ake kira “SkLite.” Dabarar gina rumbun adana bayanai na “SkLite” ya shahara matuka, kuma tsari ne mai matukar inganci wajen samar da rumbun adana bayanai a wayoyin salula mai kyau.