Sihlela ukubonakala kwakho! Ukusebenza okuhle nge-ONMA scout ukuthuthukiswa kohlelo lokusebenza lwe-android kuqinisekisiwe.
Oxhumana naye
Uma ungaqiniseki ukuthi yiluphi ulimi lohlelo ongalusebenzisela ukuthuthukiswa kwe-Android, ungase uthande ukufunda lesi sihloko. Kuzokusiza uqonde lokho Kotlin, I-Swift, Inhloso-C, kanye ne-Java kukhona nokuthi zisetshenziswa kanjani ukwakha uhlelo lokusebenza oluhle. Khona-ke, ungakhetha engcono kakhulu yephrojekthi yakho. Ngemva kwakho konke, uma uhlelo lwakho lokusebenza lunezici eziningi, uzofuna ukwenza isiqiniseko sokuthi kulula ukuyisebenzisa ngangokunokwenzeka.
Uma uthuthukisa uhlelo lokusebenza lwe-Android, ungase uthande ukucabangela ukufunda i-Kotlin. Lolu limi olusha lokuhlela lusekela i-Java Virtual Machine (I-JVM), okwenza kube ukukhetha okuhle kakhulu ekuthuthukisweni kwe-Android. Naphezu kokuduma okusha kolimi, I-Java iseyinketho ephezulu yokuthuthukiswa kohlelo lokusebenza lwe-Android. Ngenhlanhla, ulimi lunezinzuzo eziningi kuneJava. Qhubeka ufunda ukuze uthole ukuthi kungani i-Kotlin iyinketho engcono yokuthuthukiswa kohlelo lokusebenza lwe-Android.
Lapho udala into e-Kotlin, ungamemezela amalungu ayo ngokuqondile. Ungakwazi ngisho nokudala izinto phezu kwempukane usebenzisa izinkulumo. Lezi zakhiwo zingafinyelelwa ngezindlela. Futhi ngoba kuyinto, awudingi ukugoqa ngalinye kubakaki. Uma wakha uhlelo lokusebenza oluyinkimbinkimbi, ungahlanganisa amakilasi amaningana ekilasini elilodwa. I-Kotlin iphinde isekele ifa.
Uma udala ikilasi, ungasebenzisa amakilasi edatha achazwe ngaphambilini e-Kotlin. Lawa makilasi awazwakali kakhulu kunamakilasi azinikele. Okokuqala, udinga ukuchaza ama-enum akho. Ahlukanise nge-semicolon. Khona-ke, ungamemezela izindlela ofuna ukuzisebenzisa. Ungasebenzisa futhi ukuqaliswa okuzenzakalelayo kwezakhiwo. Futhi ekugcineni, ungasebenzisa indawo efundwayo kuphela ngokuyiqamba ngokuthi ilungisiwe futhi okokugcina.
I-Java iwulimi lokuhlela lwenhloso evamile olusetshenziswa kabanzi. Ithuthukiswe yi-Sun Microsystems futhi manje ephethwe yi-Oracle, isekela kokubili izinhlobo zedatha yakudala negxile entweni. I-syntax yayo iyafana ne-C/C++ kodwa ihlukile ngokuthi ayinikezi ukusebenza kwezinhlelo ezisezingeni eliphansi.. Kunalokho, Ikhodi ye-Java ihlale ibhalwa ngendlela yamakilasi noma izinto. I-Java iwulimi lokuhlela oludume kakhulu ekuthuthukisweni kwe-Android futhi kulula ukuyifunda ngisho nakulabo abanezizinda zezinhlelo zendabuko.
Ngenkathi i-Java ingasetshenziselwa ukuthuthukiswa kwezinhlelo zokusebenza ze-Android, kunezidingo ezibalulekile okufanele zihlangatshezwe ngaphambi kokuqala. I-Android SDK ne-Android Studio angamathuluzi amabili ozowadinga ukuze uqalise. Lawa mathuluzi akuvumela ukuthi udale izinhlelo zokusebenza ze-Android futhi usebenzise ulimi lokuhlela lwe-Java ukuze uzibhale. Lawa mathuluzi amabili abalulekile ekuthuthukisweni okuyimpumelelo. Ukuba namathuluzi e-software afanele kanye nezinsiza nakho kubalulekile kuphrojekthi eyimpumelelo. Ukusebenzisa i-Java kuzokusiza ukuthi uqalise ekuthuthukisweni kohlelo lokusebenza lwe-Android ngokushesha nangempumelelo.
Esinye isizathu esibalulekile sokukhetha i-Java yiqiniso lokuthi izimele. Ingolunye lwezilimi ezimbalwa zokuthuthukisa ezingasetshenziswa kumadivayisi eselula. Onjiniyela bangafinyelela idatha ebalulekile nolwazi basebenzisa i-Java. Kuyinketho enhle yonjiniyela abadinga ukuthuthukisa izinhlelo zokusebenza zamapulatifomu amaningi. Izinhlelo zokusebenza eziwumphumela zizosebenza kahle kakhulu, kuyasebenziseka, futhi isebenza kakhulu. Uma ufuna inkundla yokuthuthukisa uhlelo lokusebenza lweselula, kufanele ubheke unjiniyela oqonda i-Java. Uma ungakwenzi, uzoba nenkinga yokubhala ikhodi endaweni yesikhulumi.
Ngaphandle kweJava, I-Android futhi isekela ezinye izilimi ezimbili ezidumile zokuhlela: I-Objective-C ne-Swift. I-Objective-C isetshenziswa kakhulu ekudaleni izinhlelo zokusebenza ze-iPhone, kuyilapho i-Swift ifinyeleleka kalula kwabangewona abenzi bezinhlelo. Nokho, I-Swift iyashesha futhi kulula ukuyifunda kune-Objective-C. Ngakho, iyiphi engcono? Ake sixoxe ngazo zombili izilimi nokuthi unganquma kanjani ukuthi yikuphi okungcono kakhulu kuphrojekthi yakho. Mayelana ne-Swift, kulula ukufunda, kuyilapho i-Objective-C inamandla kakhulu.
I-Java bekuwulimi olukhethwayo ekuthuthukisweni kohlelo lokusebenza lwe-Android kuze kube 2008, ngenkathi kwethulwa inkundla ye-Android. Yasungulwa ngabakwaSun Microsystems, manje ephethwe yi-Oracle. Ulimi olunamandla oludumile phakathi konjiniyela. Nokho, Izinhlelo zokusebenza ezisuselwe ku-Java ziyinkimbinkimbi kakhulu futhi kunzima ukuzinakekela kunozakwabo ababhalwe ngezinye izilimi. Ngenxa yalokho, Onjiniyela be-Java bangafuna ukucabanga ukusebenzisa i-Objective-C yokuthuthukiswa kohlelo lokusebenza lwe-Android.
Ngenxa yalokho, ulimi luthambekele ekubeni nezwi futhi kube nzima ukususa iphutha. Ngaphezu kwalokho, ijika lokufunda leJava lingumqansa. Yingakho abathuthukisi abaningi bethuthele ku-Swift, ulimi lomthombo ovulekile olusebenza ku-Java Virtual Machine. I-Swift iwulimi lokuhlela olusetshenziswa kakhulu ku-iOS, kodwa futhi iyahambisana nokuthuthukiswa kwe-Android. Empeleni, i-LLVM compiler esekelwa yi-Swift iyinhlanganisela eqinisekile uma kuziwa ekuthuthukisweni kwe-Android.
Uma ucabanga ukuthuthukisa uhlelo lokusebenza lwe-Android, kufanele ucabange ukusebenzisa i-Swift njengolimi lokuhlela. I-syntax yayo ifana neye-C/C++, ukuze ukwazi ukuyisebenzisela ukuthuthukisa uhlelo lwakho lokusebenza ngaphandle kokuhlupheka. Iphinde isekele i-Autolayout, isici esenza ukuthuthukisa ama-UI kube lula kuzo zombili izinkundla. Ngaphezu kwalokho, isekela izinhlaka zezinkampani zangaphandle, njenge-C++, I-SQLite, kanye ne-CryptoSwift. Lolu limi olusha luvula imakethe entsha ngokuphelele yonjiniyela futhi luvumela abathuthukisi be-iOS ukuthi bangene emakethe ye-Android.
Ngaphambi kokufika kwe-Swift, Izinhlelo zokusebenza ze-iOS zabhalwa ku-Objective-C, okwakuwulimi lokuhlela lobunikazi. Noma kunjalo, lolu limi olusha lokuhlela luzibonakalise njengolimi lokuhlela oluwusizo noluphephile. Ngenxa yokuqina kwayo, ukuzinza, kanye ne-syntax eqondisiwe, sekuwulimi olukhethwayo lokudala izinhlelo zokusebenza ze-Android. Ngaphezu kokuba umthombo ovulekile, I-Swift nayo ithola umfutho phakathi konjiniyela nonjiniyela bezinhlelo zokusebenza. Lezi yizindaba ezinhle kubo bonke onjiniyela abafuna ukudala izinhlelo zokusebenza zekhwalithi futhi bagcine abasebenzisi bakho banelisekile.
Ukufunda ukuhlela nge-Swift ye-Android kuzokhulisa amathuba akho okuphumelela ngohlelo lwakho lokusebenza. Naphezu kwezindleko eziphakeme, izinhlelo zomdabu kuseyinkosi yokuthuthukiswa kohlelo lokusebenza. Nakuba kudinga ulwazi olwengeziwe nobungcweti, idumile phakathi kwabahleli bezinhlelo abanolwazi abafuna ukwakha uhlelo lokusebenza olwenziwe ngezifiso kakhulu. Ngaphezu kwalokho, uzoba nenkululeko yokwenza ngokwezifiso uhlelo lwakho lokusebenza, kuhlanganise esibonakalayo esiyingqayizivele, ihluzo, nemisindo. Kungaba inselele ukufunda izilimi ezintsha zokuhlela, kodwa kuwufanele kahle utshalomali.
Uma ubhala ikhodi yohlelo lwakho lokusebenza lweselula, ukwenza kabusha kuyisinyathelo esibalulekile sokuqinisekisa ukuthi ikhodi yakho ihlelwe kahle futhi iyafundeka. Ngokuvamile, i-refactoring yenziwa njengengxenye yesibuyekezo sesofthiwe, kodwa kwezinye izimo, kungenziwa ngokwehlukana. Ngale ndlela, ungagcina isikhathi nemali ngokuhamba kwesikhathi ngokugwema ukuphindaphinda okungadingekile kanye nokuphindaphinda. Ngenkathi abasebenzisi bokugcina bangase bangakuboni lokhu, abathuthukisi bangonga imali ngokugwema isikweletu sobuchwepheshe esizayo.
Ukwenza kabusha uhlelo lwakho lokusebenza kuyindlela enhle kakhulu yokuthuthukisa ikhwalithi yekhodi yohlelo lwakho lokusebenza kuyilapho wehlisa inani lomsebenzi wokubhala amakhodi. Ngokuhlela kabusha ikhodi yakho ekhona, ungathuthukisa ukufundeka kwayo, ukuphatheka, kanye nokusebenza ngaphandle kokufaka engozini umsebenzi ohlosiwe wohlelo lokusebenza. Ukwenza kabusha futhi kwenza ikhodi ibe lula ukuyigcina. Amamojula ohlelo lokusebenza owakhayo angasetshenziswa futhi kwezinye izinhlelo zokusebenza, kanjalo benweba amakhono abo. Kukhona ukucatshangelwa okubalulekile lapho wenza kabusha uhlelo lokusebenza.
Ukusebenzisa i-Android Studio kulula futhi kuyasiza. Vele uchofoze kwesokudla kubhulokhi yekhodi bese ukhetha into ye-Refactor kumenyu yokuqukethwe. Leli windi le-popup linezinketho ezimbalwa zokwenza kabusha. Okusebenziseka kakhulu yiQamba kabusha…, ongayithola kumenyu yokuqukethwe. Ngokusebenzisa le nketho, ungashintsha ngokushesha igama lezinto eziguquguqukayo noma ushintshe ukwakheka kwemojuli yonke. Khona-ke, ungakhetha igama elisha lebhulokhi yekhodi.
Izinhlelo zokusebenza zomdabu ziyizinhlelo zokusebenza ezenzelwe amasistimu okusebenza eselula athile, njenge-iOS ne-Android. Izinhlelo zokusebenza zifinyeleleka ngezitolo zezinhlelo zokusebenza ezizinikele. Amathuluzi nezinkundla ezisetshenziselwa ukudala lezi zinhlelo zokusebenza ziqondene nenkundla, njenge-Objective-C, I-Swift, Java, Kotlin, futhi nokuningi. Lolu hlobo lokuthuthuka lubandakanya isethi ethile yamakhono, futhi kungaba umzamo obizayo. Ngenkathi onjiniyela abaningi benza isisekelo sekhodi eyodwa, futhi bangakha kokubili izinhlelo zokusebenza ze-iOS ne-Android.
Isibonelo esisodwa sohlelo lokusebenza lweselula lwe-AR umdlalo odumile we-Pokemon Go. Lolu hlelo lokusebenza lusebenzisa izindawo zomhlaba wangempela ukushintsha indawo ezungezile ibe umhlaba wegeyimu ebonakalayo. Umdlali empeleni uyisilawuli. Uhlelo lokusebenza luyatholakala kukho kokubili i-Google Play Store kanye ne-Apple App Store. Izinhlelo zokusebenza zomdabu zivikeleke kakhulu kunezinhlelo zokusebenza zewebhu ngoba zisebenzisa izici ezakhelwe ngaphakathi zesistimu yokusebenza ukwenza uhlelo lwakho lokusebenza lushelele futhi lube lula ngangokunokwenzeka.
Uma ucubungula ukuthuthukiswa kohlelo lokusebenza lwendabuko, izinkampani kufanele zilinganise izinketho zazo. Ukuthi usebenzise uhlelo lokusebenza olukhona noma udale olwangokwezifiso, kunezici eziningana okufanele zicatshangelwe. Esokuqala ubunkimbinkimbi bohlelo lokusebenza. Izinhlelo zokusebenza zomdabu zingaba yinkimbinkimbi, kodwa kungaba nzima ukwakha. Kunezingibe eziningi nama-nuances okufanele acatshangelwe. Unjiniyela omuhle angasiza ukuhlela inqubo futhi ehlise izindleko. Kodwa kubalulekile ukwenza isiqiniseko sokuthi wenza isinqumo esifanele sebhizinisi lakho.
Inguqulo yakamuva ye-Android, i 13 i-beta, iletha ukuthuthukiswa kwe-SDK ne-sandbox yokuthuthukiswa kohlelo lokusebenza lwe-Android. I-sandbox ihlukanisa amalabhulali ezinkampani zangaphandle kusuka kukhodi yohlelo lokusebenza, ukunikeza onjiniyela ukulawula okukhulu kumalabhulali. Ama-SDK athola amakholi asuka kukhodi kunqubo yohlelo lokusebenza. Ikhodi ixhumana nezixhumi ezibonakalayo ze-SDK, ezeqa umngcele wenqubo. Android 13 futhi yethula i-Privacy Sandbox, isici seplathifomu ye-Android esilingana ne-Apple's App Tracking Transparency.
I-sandbox ivumela onjiniyela ukuthi bahlukanise idatha yomuntu siqu. Uhlelo lokusebenza lwe-flashlight, Ngokwesibonelo, ingase icele izimvume nemisebenzi engadingekile. Ngokusebenzisa i-sandbox ye-Shelter, izinhlelo zokusebenza ze-flashlight zingafinyelela kuphela idatha yezinye izinhlelo zokusebenza ku-sandbox. Nokho, izinhlelo zokusebenza ezihlanganisiwe azikwazi ukuphatha izimvume futhi zingase zingasebenzi kahle kubasebenzisi abanakayo ngobumfihlo babo. Ukuze ugweme lokhu, abasebenzisi bangahlukanisa izinhlelo zokusebenza ezithenjwayo kwezinye izinhlelo zokusebenza ezisebenza ngaphakathi kwebhokisi lesihlabathi.
Ukusebenzisa i-sandbox ekuthuthukisweni kohlelo lokusebenza lwe-Android kuvikela ubumfihlo bomsebenzisi. Izinhlelo zokusebenza ze-Android zisebenza ngaphakathi kwezinqubo ezihlukene, ukubavimbela ekufinyeleleni idatha ebucayi. Lokhu kuvikela umsebenzisi kuhlelo olungayilungele ikhompuyutha nesofthiwe enonya. Ngenkathi isistimu yokusebenza ye-iOS ingalisebenzisi leli gama “ibhokisi lesihlabathi” okwebhokisi lesihlabathi, izinqubo ziyefana. Umehluko kuphela ukuthi i-Apple ayisebenzisi i-sandbox yamagama okuthuthukisa uhlelo lokusebenza lwe-android.
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