Tsarin Babbar Manhajar Android (4)

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 da lura da tafiyar da dukkan manhajojin da mai waya yake mu’amala dasu.  Har muka kawo misalai da manhajojin sakonnin tes (Message Application), da kuma manhajar lambobin mai waya (Contact Application).  A wannan mako in Allah yaso, mai karatu zai san yadda ake gina manhajoin da yake mu’amala dasu ne a wayarsa mai dauke da babbar manhajar Android, tare da tsarin gina su, da kuma rayuwarsu baki daya.

 

“Sarkin Gida” (Activity Manager)

Da farko dai, kafin bayani kan tsarin da Sarkin Gida (Activity Manager) ke bi wajen tafiyar da wayar gaba daya, zai dace mai karatu 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 sosai, 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 dasu.  Wadannan manhajoji dai sun hada da wadanda wayar take zuwa dasu (irin su manhajar “Message” da manhajar “Contact” da manhajar “Video” 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 dasu, wato: “Google Play” ko “Play Store.”

 

Wadannan manhajoji duniyoyi ne masu zaman kansu, saboda irin sarkakiyar dake ciki wajen gina su.  Wadanda ke gina su sune masana kan manhaja da masarrafar kwamfuta, wato “Developers” 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 kanshi da nan gaba mai karatu zai ci karo dashi.

Activity

Kalmar “Activity” na nufin aiki ne, a hakinakin 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, “Activity” 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 dashi 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 “Activity” yana da marhaloli har guda biyar.  Bayani kan wadannan marhaloli na nan tafe nan ba da jimawa ba.  Zagayen marhalolin da tsarin “Activity” ke bi, daga farko zuwa karshe, shi ake kira “Activity 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 “Activity” 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 dasu 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 yazo 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 dashi 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 tayi, don neman aiwatar da wani aiki da mai wayar ya bata.  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 dayan 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 bata dama wajen shigar da kai Intanet idan bukata irin 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.

 

Service

Wannan tsari mai suna “Service” 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 karshin kasa, kai ba za ka sani ba.  Idan kaje “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 bane, a a, tsarin “Service” ne dake gudanar dasu.  Rayuwar wannan tsari ba ta da tsawo.  Da zarar ka kulle wata manhaja da ka budo, nan take su ma sai su “mutu.”

Content Providers

“Content Providers” tagwayen suna ne dake 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 dasu.  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 Provider.”

 

Wannan manhaja ta biyu, wacce ba ka iya gani a zahiri, ita c eke 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 Provider.”  Idan ka budo manhajar “Multimedia” ma, asalin bayananka na sauti da bidiyo da hotuna da kake cin karo dasu a cikin wannan manhaja, duk suna dauke ne a cikin manhajar “Multimedia Content Provider.”  Idan kaje bangaren “Settings” – wato Tsare-tsare – ma haka lamarin yake.  Duk abin da kake cin karo dasu daga sama zuwa kasa na bayanai, wadanda kake tsara yadda za ka yi mu’amala da wayar dasu, duk asalinsu a cikin “Settings Content Provider”   suke.

 

Daga bayanan da suka gabata mai karatu zai fahimci cewa, lallai “Content Providers” wani tsari ne dake taskance bayanan mai waya, wadanda ya zuba da kanshi.  A takaice dai, tsarin “Content Providers” 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 dashi wajen yin wannan aiki kuwa shi ake kira “SQLite.”  Dabarar gina rumbun adana bayanai na “SQLite” ya shahara matuka, kuma tsari ne mai matukar inganci wajen samar da rumbun adana bayanai a wayoyin salula mai kyau.

Baban Sadik

Baban Sadik marubuci ne, kuma mai bincike a fannin kimiyya da fasahar sadarwar zamani da tasirinsu ga al'umma a kasashen Afrika, musamman Najeriya. Ya tanadi wannan shafi ne don taskance dukkan kasidun da yake gabatarwa a shafinsa na jaridar AMINIYA mai take: "Kimiyya da Kere-kere," wanda ya faro tun shekarar 2006; shekaru goma kenan a takaice. Bayan kasidun shafin jarida, wannan shafi har wa yau yana dauke da wasu kasidun da ya gabatar a tarurruka da aka gayyace shi, ko wasu hirarraki da gidan rediyon BBC Hausa yayi dashi a lokuta daban-daban. Baban Sadik na zaune ne a birnin tarayyar Najeriya, wato Abuja.

Leave a Reply

Your email address will not be published. Required fields are marked *