Ukudala uhlelo lwakho lokusebenza lweselula lwe-Android kunzima impela, vele, uma ungasebenzisi izinsiza ezihlukile ze-inthanethi ezinikezela ukudala okuthile kwimodi yokuqamba, kepha kuzodingeka ukhokhe imali noma wamukele iqiniso lokuthi uhlelo lwakho luzosetshenziswa njengokukhokha kwalolu hlobo "lwenduduzo" uzoba nezikhangiso ezixhumeka ngaphakathi.
Ngakho-ke, kungcono ukusebenzisa isikhathi esincane, ukuzikhandla nokwakha uhlelo lwakho lokusebenza lwe-Android usebenzisa izinhlelo ezikhethekile zesoftware. Ake sizame ukwenza lokhu ngezigaba, sisebenzisa enye yezindawo ezinamandla kakhulu zesoftware yokubhala izinhlelo zokusebenza zeselula ye-Android Studio.
Landa i-Android Studio
Dala uhlelo lokusebenza lweselula usebenzisa i-Android Studio
- Landa imvelo yesoftware kuwebhusayithi esemthethweni bese uyifaka kwi-PC yakho. Uma ungenayo i-JDK efakiwe, udinga ukuyifaka nayo. Yenza izilungiselelo zohlelo lokusebenza oluzenzakalelayo
- Qalisa i-Studio ye-Android
- Khetha "Qala iphrojekthi entsha ye-Studio ye-Android" ukudala uhlelo olusha.
- Kuwindi elithi "Lungiselela iphrojekthi yakho entsha", setha igama olifunayo lephrojekthi (Igama lohlelo)
- Chofoza okuthi “Okulandelayo”
- Ku-"Khetha izici uhlelo lwakho lokusebenza oluzosebenza kuzo" iwindi, khetha ipulatifomu ozobhala uhlelo lokusebenza ngaphansi kwayo. Chofoza Ucingo nethebulethi. Ngemuva kwalokho sikhetha uhlobo olusezingeni eliphansi lwe-SDK (lokhu kusho ukuthi uhlelo olubhaliwe luzosebenza kumadivayisi anjengamaselula namathebulethi, uma enenguqulo ye-Android, efana neMinimun SDK noma kamuva). Isibonelo, sizokhetha inguqulo engu-4.0.3 IceCreamSandwich
- Chofoza okuthi “Okulandelayo”
- Engxenyeni ethi "Ngeza Umsebenzi kuselula", khetha Umsebenzi wohlelo lwakho lokusebenza, omelwe yiklasi legama elifanayo kanye nomaki ngendlela yefayela le-XML. Lolu uhlobo lwethempulethi eliqukethe amasethi ekhodi ejwayelekile yokuphatha izimo ezijwayelekile. Sizokhetha umsebenzi ongenalutho, ngoba ulungele uhlelo lohlolo lokuqala.
- Chofoza okuthi “Okulandelayo”
- Bese inkinobho Qeda
- Linda kuze kube yilapho i-Android Studio idala iphrojekthi nakho konke ukwakhiwa kwayo okudingekayo.
Kuyaqapheleka ukuthi okokuqala udinga ukujwayelana nokuqukethwe kohlelo lokusebenza neziqondisi ze-Gradle script, ngoba ziqukethe amafayela abaluleke kakhulu wohlelo lwakho lokusebenza (izinsizakusebenza zephrojekthi, ikhodi ebhaliwe, izilungiselelo). Nakisisa ifolda yohlelo lokusebenza. Into ebaluleke kakhulu equkethe ifayili le-expression (yonke imisebenzi yohlelo lokusebenza kanye namalungelo okufinyelela kumenyezelwe kuyo), kanye nemikhombandlela ye-java (amafayili weklasi), ama-(amafayela wezinsizakusebenza).
- Xhuma insiza yokulungisa iphutha noma uyenze i-emulator
- Chofoza inkinobho "Run" ukuqalisa uhlelo lokusebenza. Kungenzeka ukwenza lokhu ngaphandle kokubhala umugqa owodwa wekhodi, ngoba umsebenzi owengezwe ngaphambili usuqukethe ikhodi yokuphuma komlayezo "Hello, world" kudivayisi
Ngale ndlela ungasakha kanjani isicelo sokuqala sefoni ephathekayo. Ngaphezu kwalokho, ukutadisha Imisebenzi ehlukile nesethi yezakhi ezijwayelekile ku-Android Studio, ungabhala uhlelo lwanoma yikuphi ukubumbana.