Sihlela ukubonakala kwakho! Ukusebenza okuhle nge-ONMA scout ukuthuthukiswa kohlelo lokusebenza lwe-android kuqinisekisiwe.
Oxhumana naye
Uma umusha ekuthuthukisweni kwe-Android, kunezinketho ezimbalwa ezihlukile zokuthuthukiswa kohlelo lokusebenza lwe-Android. Lezi zinketho zifaka i-Android Studio, Ephelelwe ithemba, I-Makerpad, kanye nomsunguli wohlelo lokusebenza lwe-Android. Ngayinye inikeza izinzuzo zayo eziyingqayizivele, futhi ngizoxoxa kafushane umehluko phakathi kwabo. Uma usunqume ukuthi iyiphi inketho ekulungele, nazi izisekelo. Kodwa ngaphambi kokuthi uqale, qiniseka ukuthi ulanda ithuluzi elifanele lomsebenzi.
Uma usebenzisa i-Android Studio ukuze udale izinhlelo zokusebenza ze-Android, uzokwazi ukwenza ngokushesha isofthiwe yakho yangokwezifiso yamadivayisi akho eselula. Uhlelo lokusebenza lweselula luqukethe izingxenye ezimbili ezibalulekile: Umsebenzi kanye Buka. Umsebenzi ingxenye yohlelo lokusebenza echaza ukubukeka kwesithombe se-flache ephezulu kanye nokusebenza. Yakhiwe ikhodi ye-Java, echaza ukuthi yiziphi izenzo okufanele zenzeke uma inkinobho icindezelwa. Uhlelo lokusebenza ngokwalo lungasebenza kunoma iyiphi idivayisi ehambisana ne-Android.
Ukuze uqale ukudala uhlelo lwakho lokusebenza, vula i-Project Explorer. Izobonisa i-Android Zielplattform, I-Master-Formula, kanye nefolda Yezinsiza. Kukhona futhi a “Iwindi lokubuka kuqala lamadivayisi ahlukene”, okuzokuvumela ukuthi ubone uhlelo lokusebenza kumadivayisi amaningi. Uma usukhethile ukubuka, ungayenza ngendlela oyifisayo ngokuchofoza inkinobho yayo ehambisanayo. Uma udinga ukudala izinhlelo zokusebenza ezingaphezu kwesisodwa, ungakha ukubuka ngokwezifiso kwakho ngakunye.
Olandelayo, xhuma idivayisi ye-Android kukhompuyutha yakho. Uzodinga ukukhetha idivayisi esebenzisa i-Android Studio. Ungakwazi ukuxhuma kudivayisi ye-Android usebenzisa i-USB. Ngale ndlela, ungahlola uhlelo lokusebenza kuyo futhi wenze izinguquko ezidingekayo. Ungaphinda uhlole uhlelo lokusebenza kule divayisi ngaphambi kokuthi uyakhele ingxenyekazi yakho oyiqondisayo. Vele ubekezele! Uma ungaqiniseki ukuthi ungakwenza kanjani lokhu, funda Iforamu Yonjiniyela we-Android. Banemiyalelo enemininingwane yokuthi ungawenza kanjani amadivayisi abe yi-Android Studio.
Ukuthuthukisa izinhlelo zokusebenza zeselula kudinga ukutshalwa kwezimali okuningi, kokubili kusuka kubathuthukisi nasendaweni yokuthuthukiswa. Umsunguli wohlelo lokusebenza lwe-Google uyisibonelo Sendawo Yokuthuthukisa Edidiyelwe (I-IDE) okuhlanganisa wonke amathuluzi esofthiwe adingekayo ukuze udale uhlelo lokusebenza lwe-Android. Nokho, isebenza ngaphakathi kwesiphequluli sewebhu futhi ayisekelwe yi-Internet Explorer. Nokho, uma umusha ekuhlelweni futhi ungenaso isizinda sokuthuthukiswa kwesofthiwe, I-App Inventor ingaba yisixazululo esiphelele.
Uma usungenile kuwebhusayithi ye-App Inventor, ungaqala ukusebenza kuphrojekthi yakho. Chofoza inkinobho ethi Qala iphrojekthi entsha kubha yemenyu bese uyiqamba. Umsunguli wohlelo lokusebenza uzovula ekubukeni komklami. Kusukela kubha yesihloko, ungakwazi ukwengeza izikrini futhi ushintshe phakathi kwazo. Ibha yesihloko futhi ikuvumela ukuthi uguqule phakathi kwe-Blocks kanye nokubukwa komklami. Uma usulungele ukuqala, ungakhetha igama lephrojekthi.
Enye enye indlela yoMsunguli wohlelo lokusebenza lwe-Android i-MIT App Inventor. Le ndawo yokuthuthukiswa okusekelwe kuwebhu ivumela abaqalayo ukuthi bakhe futhi benze ngendlela oyifisayo izinhlelo zokusebenza ze-Android ngaphandle kokubhala umugqa owodwa wekhodi. I-MIT App Inventor inakekelwa ngenkuthalo Ilebhu Yokufunda Yeselula ye-MIT. Yadalwa ekuqaleni i-Google kodwa manje isisetshenziswa othisha nabafundi abaningi. I-MIT App Inventor iyisofthiwe yamahhala futhi itholakala ngaphansi kwelayisensi ye-Apache 2.0 kanye ne-Creative Commons Attribution ShareAlike 3.0 Akuthunyelwanga.
Ithuluzi lokuthuthukisa uhlelo lwe-Kivy Android liwumthombo ovulekile, ithuluzi elisheshayo lokuthuthukisa izinhlelo zokusebenza, kanye ne-prototyping. Nokho, kubalulekile ukuqaphela ukuthi izinhlelo zokusebenza ze-Kivy azizona izinkundla zomdabu, ngakho-ke bazoba nosayizi abaphezulu be-APK futhi baqale kancane kunezinhlelo zokusebenza zomdabu. Lokhu kuwukudonsela emuva uma kubhekwa ukusebenza kwe-leistungsfahige kwamafoni we-Android kulezi zinsuku. Ngaleso sizathu, abasebenzisi abaningi bagwema ukwenza izinhlelo zabo zokusebenza nge-Kivy.
Ukuze udale uhlelo lokusebenza lwe-Android, uzodinga ukungeza izinkinobho nezinye izici ze-UI. Lezi zenzo zaziwa njengekhodi eqhutshwa umcimbi, futhi iKivy yakhelwe ukuphatha le micimbi. Ngokwesibonelo, iwijethi yelebula ingaba nezimfanelo ezintathu: umbhalo, ukusikisela_kosayizi, futhi pos_hint. Lawa manani abalulekile ekwenzeni ilebula ivele esikrinini. Iwijethi Yelebula izodinga ububanzi nombhalo, kanye nosayizi-ukusikisela.
Uma usuwakhe uhlelo lwakho lokusebenza ku-Kivy, sekuyisikhathi sokuyipakisha. Ukupakisha uhlelo lokusebenza ngefomethi ye-APK, udinga ukufaka uhlelo lokusebenza kusigcinalwazi sangaphandle. Uhla lwemibhalo ngokuvamile luyi/sdcard. Ngemva kwalokho, ungakhetha idemo futhi ukhulule izinguqulo zohlelo lokusebenza. Uhlelo lokusebenza lwe-Android lwe-Kivy bese lulungele ukufakwa ku-Google Play. Ungaphinda udale uhlelo lwe-Android ku-Raspberry Pi usebenzisa ukufakwa okwenziwa ngesandla noma usebenzisa umphathi wephakheji we-KivyPie.
I-Makerpad iyinkundla yokudala izinhlelo zokusebenza ze-Android, kanye nezifundo zayo ezibanzi nezifundiswa zingakusiza ukuthi uqalise ngokubhala amakhodi. Ngezinqubo okulula ukuzilandela, ungakha imiklamo yakho nezinhlelo zokusebenza zokuxhuma nokuhlela idatha. Ngaphezu kwalokho, inkundla ikuvumela ukuthi uqhathanise amathuluzi ahlukene ukuze unqume ukuthi yikuphi okukulungele. Kuyithuluzi elihle kakhulu kubo bobabili abaqalayo nabathuthukisi abanolwazi. Sizobheka ezinye zezizathu ezenza i-Makerpad isebenze kangaka.
Esinye sezici ezinhle kakhulu ze-Makerpad ukuthi ihlanganyele namathuluzi amaningi avela kubathengisi abahlukahlukene. Ngokukhetha ithuluzi lozakwethu, uzokwazi ukusizakala ngezici zayo ezithuthukile. Lawa mathuluzi ahlanganisa i-Boundless, UCarrd, I-Sheet2Site, futhi Zoom. Ungasebenzisa i-Makerpad ukudala uhlelo lokusebenza lwebhizinisi lakho noma umsebenzi wokuzilibazisa. Futhi, nomphakathi wayo ophelele, ungabuza imibuzo futhi uthole usizo noma nini.
I-Makerpad ayishibhile, nokho. Izindleko zokubhaliselwe kwanyanga zonke $16 futhi iqondiswe kwabaqalayo abafuna ukuhlola umhlaba wokuthuthukiswa okungenakhodi. Kodwa uma uzimisele ngokubhala amakhodi kanye namathuluzi wokwakha, ungabhalisela uhlelo lomakhi, okuyizindleko $41 inyanga. Uhlelo lwe-Builder lunezindleko eziphezulu kodwa lufanelekile kulabo abafuna ukukhiqiza futhi baqale ukuqashwa. Uma ungenawo ulwazi ngokuthuthukiswa kwe-no-code, I-Makerpad iyisinqumo esihle.
Uma uzama ukulingisa umuzwa wokusebenzisa idivayisi ye-Android yangempela, ungasebenzisa Isiphathi Sokwenza Ukusheshisa se-Android. Leli thuluzi lisebenzisa ubuchwepheshe bokubona okusizwa ngezingxenyekazi zekhompuyutha ukukhulisa isivinini sezilingisi ze-Android. Isebenza kuphela kumaphrosesa ane-Intel chips. Uma isifakiwe, Isiphathi se-AVD sizoqala ngokuzenzakalelayo ukulingisa izinhlelo zokusebenza ze-Android. Ukusebenzisa leli thuluzi kulula. Ungayifaka nge-Android Studio noma ngokusebenzisa isifaki esizinikele.
Ama-AVD angamafayela ama-emulators e-Android awasebenzisayo ukulingisa izingxenye ze-flash zamadivayisi wangempela. Zenziwe ngezinhlobo ezintathu zamafayela: i-kernel, idatha yomsebenzisi, kanye nekhadi le-SD. Lezi zithombe zidalwa ngokuzenzakalelayo uma ungazihlinzeki. Uma uqala i-emulator, i-AVD izodala isithombe esisha sedatha yomsebenzisi uma ungayinikezi. Kungenjalo, ungacacisa indawo entsha usebenzisa inketho -system-dir.
Ukucushwa kwe-AVD kwesifanisi se-Android kuchaza izici zehadiwe zocingo olulingiswayo. Ngokumisa ukucushwa kwe-AVD, ungahlola ukusebenza kwezinhlelo zokusebenza ze-Android kuzinhlanganisela ezihlukahlukene zehadiwe. Ngokwesibonelo, uhlelo lokusebenza lwe-Android lungasebenzisa inethiwekhi, dlala okulalelwayo noma ividiyo, gcina idatha, futhi wazise umsebenzisi. Ungasebenzisa ngisho i-emulator ukuhlola ukusebenza kwekhamera yedivayisi ne-accelerometer.
Ngenkathi udala uhlelo lokusebenza lwe-Android, kufanele ucabangele I-Android Activity Lifecycles. Lesi sici sikuvumela ukuthi ulawule umjikelezo wempilo womsebenzi owodwa, njengalapho iqala kabusha noma imisa okwesikhashana. Isimo sokumiswa somsebenzi isikhathi esingcono kakhulu sokugcina isimo kuhlelo lwakho lokusebenza futhi uyeke ukusebenzisa izinsiza. Iphinde inikeze ithuba elihle lokumisa ukugqwayiza, okungenzeka kungabonakali kumsebenzi omisiwe. Kungakhathaliseki ukuthi umsebenzi uyaqhubeka yini, kusafanele uqiniseke ukuthi usebenzisa ukumiswa okwesikhashana() indlela.
Umjikelezo wempilo womsebenzi uqala nge-onCreate() indlela. Le ndlela ibizwa lapho umsebenzisi echofoza okokuqala kusithonjana sohlelo lokusebenza. Ngale ndlela, usetha isakhiwo futhi uqalise ukubuka. Isinyathelo esilandelayo kumjikelezo wempilo ukushayela i-onStart() indlela, okwenza umsebenzi ubonakale futhi ivumela umsebenzisi ukuthi ahlanganyele nawo. I-OnStart() ibizwa nangokuthi uma umsebenzi uqalwa futhi uvaliwe. Kungenjalo, i-OnPause() indlela ingaqalwa uma umsebenzi ucekelwa phansi.
I-Android Activity Lifecycle ichaza izigaba umsebenzi odlula kuzo. Isithonjana sohlelo lokusebenza asiveli kuhlu lwesikrini sasekhaya, kodwa izokhiqiza imilayezo yemicimbi ngokushesha nje lapho umsebenzisi echofoza inkinobho yokubuyela emuva. Njengoba udala uhlelo lwakho lokusebenza, qaphela I-Android Activity Lifecycles. Uma uthuthukisa uhlelo lokusebenza lwe-Android, kufanele ufunde mayelana nale mijikelezo yokuphila ukuze ugweme ukuphahlazeka kohlelo lokusebenza nezinye izinkinga.
Ngicela uqaphele, ukuthi sisebenzisa amakhukhi, ukuthuthukisa ukusetshenziswa kwale webhusayithi. Ngokuvakashela isayithi
ukusetshenziswa okwengeziwe, yamukela lawa makhukhi
Ungathola ulwazi olwengeziwe mayelana namakhukhi esimemezelweni sethu sokuvikela idatha