I-Android Studio: izinyathelo zokuqala zokudala izinhlelo zakho zokusebenza

I-Android Studio

I-Android isiphenduke isistimu yokusebenza esetshenziswa kakhulu emhlabeni. Cishe inabasebenzisi abayizigidi eziyizinkulungwane ezi-4.000 emhlabeni jikelele, okuyinto emangalisayo ngempela. Ngaphezu kwalokho, isistimu yokusebenza yamadivayisi eselula athuthukiswe yi-Google futhi esekelwe ku-Linux kernel nayo ihehe inqwaba yonjiniyela. Uma ufuna ukuba omunye futhi, lapha Sikwethulela ku-Android Studio.

Ngalolu hlelo lokusebenza lonjiniyela uzokwazi dala izinhlelo zakho zokusebenza zokuqala iyahambisana nesistimu futhi ihlole ukusebenza kwayo, noma ngabe umdlalo wevidiyo, insiza, kanye nohlelo lokusebenza lweklayenti lwamaphrojekthi akho e-IoT, njll. Into enhle ukuthi i-Android Studio iyatholakala naku-Linux, ngakho-ke ungasebenza ku-distro yakho ngaphandle kwenkinga.

Iyini i-AndroidStudio?

Ilogo ye-Android Studio

I-Android Studio iyindawo yokuthuthukisa edidiyelwe (IDE) okusemthethweni ukudala izinhlelo zokusebenza zamadivayisi we-Android. Kuyithuluzi elibalulekile lanoma yimuphi unjiniyela ofuna ukudala izinhlelo zokusebenza zama-smartphone, amathebulethi, izinto ezigqokwayo namanye amadivaysi asebenzisa isistimu yokusebenza ye-Android.

Ngokusekelwe ku-IntelliJ IDEA, i-Android Studio inikeza isethi ephelele yamathuluzi asiza inqubo yokuthuthukisa uhlelo lokusebenza, kusukela ekudaleni ukusebenzelana komsebenzisi kuya ekwakheni nasekuphakeleni uhlelo lokusebenza kudivayisi ephathekayo noma i-emulator. Phakathi kwakhe Imisebenzi eyinhloko Yilezi:

  • Umhleli Wekhodi Ehlakaniphile: ngokuqedela ngokuzenzakalela, ukwenza kabusha, nokuhlaziya ikhodi emile ukuze kuthuthukiswe ukukhiqiza.
  • Ukusekelwa kwezilimi eziningi zokuhlela- Ngokungeziwe ku-Java ne-Kotlin, ungasebenzisa i-C++ ukuze uthuthukise izingxenye ezithile zohlelo lwakho lokusebenza.
  • umklami obonakalayo- Ukwakha i-interfaces yomsebenzisi (GUI) ngokushesha futhi kalula.
  • I-emulator ye-Android: ukuhlola izinhlelo zakho zokusebenza kumadivayisi ahlukile abonakalayo phakathi kwezaziwa kakhulu nezinguqulo ezihlukile ze-Android ukuhlola ukuhambisana.
  • Ukuhlanganiswa ne-Gradle- Uhlelo lokwakha oluguquguqukayo lokuphatha ukuncika nokumisa izinketho zokwakha.
  • Ububanzi obubanzi bezifanekiso namasampuli: okuthakazelisayo ikakhulukazi kwabaqalayo noma kulabo abafuna ukudala uhlelo lokusebenza ngokushesha ngalolu sizo.
  • Ukuhlanganiswa ne-Google Play Console: ukuphatha ukushicilelwa nokusatshalaliswa kwezinhlelo zakho zokusebenza.

Yini ongayenza nge-Android Studio?

Manje njengoba usuyazi ukuthi iyini, nokuthi ihlinzeka ngamiphi imisebenzi kubathuthukisi, kufanele futhi wazi yini ongayenza nge-Android Studio, noma ukuthi ungayisebenzisela ini, kahle, lapha ngifaka uhlu lwamathuba:

  • Dala izixhumanisi zomsebenzisi: ikuvumela ukuthi udizayine i-GUI yohlelo lokusebenza ngendlela elula nebonakalayo, noma ngekhodi ye-XML. Ungenza ukubukeka ngendlela oyifisayo ngenqwaba yamatimu nezitayela, uzikale ukuze zivumelane nosayizi abahlukene besikrini, njll.
  • Bhala ikhodi esebenzayo: ikuvumela ukuthi usebenzise izilimi zokuhlela ze-Java ne-Kotlin ukuze uthuthukise ingqondo yohlelo lwakho lokusebenza, okungukuthi, udale insiza yokwenza umsebenzi X noma igeyimu yevidiyo. Ngenxa yamathuluzi ayo, izokuvumela ukuthi usebenzise kalula imitapo yolwazi etholakala ku-Android, ngaphezu kokunikeza ukufinyelela ekuphathweni kwezinsiza zehadiwe, njengokufinyelela kwenethiwekhi, ukugcinwa, ukusebenzisana nezinzwa, isikrini sokuthinta, njll.
  • Susa iphutha futhi uhlole uhlelo lwakho lokusebenza: ngenxa ye-debugger ehlanganisiwe, kuyenzeka ukuhlonza nokulungisa amaphutha kukhodi yakho, ngaleyo ndlela ugweme iziphazamisi ezingaba khona noma ubungozi obuthinta uhlelo lwakho lokusebenza lwesikhathi esizayo ngaphambi kokuluqalisa ku-Google Play noma ngaphandle kwesitolo esisemthethweni. Ngakolunye uhlangothi, ama-emulators wamadivayisi ahlukene, izilungiso, nezinguqulo zikuvumela ukuthi uhlole uhlelo lwakho lokusebenza kuzimo ezihlukahlukene.
  • Lungiselela ukusebenza: Eminye imisebenzi futhi ikuvumela ukuthi ubone izinkinga ezingaba khona ezibambezela uhlelo lokusebenza futhi zithuthukise izindawo ezithinta ukusebenza. Futhi hhayi lokho kuphela, unamathuluzi okwenza iphrofayela onawo ukuze unciphise ukusetshenziswa kwememori nokusetshenziswa kwebhethri.
  • Thola uhlelo lwakho lokusebenza: uma usuqedele inqubo, ikuvumela ukuthi udale iphakheji ye-APK ukuze usabalalise futhi ufake uhlelo lwakho lokusebenza, ngaphezu kokuvumela ukuphathwa kwezinguqulo ezihlukahlukene nezibuyekezo ongazikhulula ngokuzayo. Futhi, kunjalo, futhi ikuvumela ukuthi ushicilele uhlelo lwakho lokusebenza ngokuqondile ku-Google Play ukuze lutholakale kuwo wonke umuntu.

Ungayifaka kanjani i-Android Studio ku-Linux

Ukufakwa ku-MacOS, i-ChromeOS ne-Windows kulula, yingakho ngizogxila ekufakweni ku-Linux, okungenzeka ukuthi yiyona eyenza ukungabaza okukhulu. Kodwa ngaphambi kokuqala ngezinyathelo, kufanele wazi ukuthi ziyini. izidingo zehadiwe Kunconywa ukuthi ukwazi ukufaka le IDE:

  • CPU: x86-64 AMD noma i-Intel esekela ubuchwepheshe be-Intel VT kanye ne-AMD-V virtualization kanye nezandiso ze-SSSE3.
  • Imemori ye-RAM- Ubuncane obungu-8 GB, kodwa i-16 GB noma ngaphezulu iyanconywa.
  • Isitoreji: Kumelwe ube nesikhala samahhala ku-HDD/SSD hard drive okungenani engu-8GB noma ngaphezulu.
  • Isikrini: iyahambisana nesinqumo 1280x800 px noma 1920x1080 px okungenani.
*Qaphela: Ungase uthole i-Android Studio kumakhosombe akho okusabalalisa, noma esitolo sohlelo lokusebenza se-distro yakho, kodwa ingase ingabi inguqulo yakamuva etholakalayo. Ngakho-ke, ngincoma ukuthi ulandele izinyathelo engizichaza lapha.

Uma ungenayo imitapo yolwazi ethile efakiwe, ungase udinge ukufaka eminye yayo 32-bit imitapo yolwazi, isibonelo:

sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386 sudo yum ukufaka zlib.i686 ncurses-libs.i686 bzip2-libs.i686

Uma uhlangabezana nalezi zidingo, kufanele wazi ukuthi i-Android Studio ihambisana nama-64-bit GNU/Linux distros amaningi, futhi isebenza kahle kukho kokubili i-KDE Plasma ne-GNOME. Manje, i izinyathelo zokufaka i-Android Studio Yilezi:

  1. Finyelela kuwebhusayithi esemthethweni ye Okulandwayo kwe-Android Studio.
  2. Cindezela inkinobho yokukhipha ukuze uqale ukulanda.
  3. Ngemva kwalokho, kufanele ube nefayela le-.tar.gz endaweni lapho olilande khona.
  4. Kopisha lelo fayela ku-/usr/local/ uma uzolisebenzisa kuphela, noma ungene ku-/opt/ uma ufuna ukuthi litholakale kubasebenzisi abaningana ohlelweni.
  5. Uma sekukopishwe lapho, ungakwazi ukukhipha okuqukethwe kwe-tarball.
  6. Manje, kusukela kutheminali, hamba kumhlahlandlela lapho uyikhiphe khona.
  7. Ukusuka lapho, iya ku-android-studio/bin/.
  8. Bese ugijima iskripthi ngaphakathi ukuze usifake ngomyalo othi “sudo ./studio.sh” ngaphandle kwamacaphuno.
  9. Bese kuyindaba yokulandela isilekeleli sokufaka nokulanda izingxenye Zeseluleki Sokusetha, esizophinda sifake i-Android SDK, phakathi kokunye.

Yilokho kuphela, kufanele ube nesithonjana esitholakalayo phakathi kwezinhlelo zakho zokusebenza ukuze uchofoze kabili kuso futhi usiqalise...

Izinyathelo zokuqala zokudala uhlelo lwakho lokusebenza

uhlelo lokusebenza lokuqala

Manje njengoba usufake i-Android Studio kusistimu yakho, into elandelayo izoba yilungiselele futhi uthathe izinyathelo zokuqala njengoba ngikubonisa lapha:

  1. Sebenzisa i-Android Studio.
  2. Esikrinini sokwamukela khetha Izilungiselelo.
  3. Ngaphakathi kwemenyu yezilungiselelo chofoza Iphrojekthi Ezenzakalelayo.
  4. Futhi ngaphakathi kwalesi sikrini esisha, khetha Isakhiwo Sephrojekthi.
  5. Uma usufikile, kufanele ukhethe ama-SDK kuphaneli engakwesokunxele bese uchofoza kokuthi +.
  6. Ngalokhu ungakhetha ukucushwa okufunayo esimweni sakho, okufana ne-JDK (Java SDK) ye-Java kanye nenkundla ye-Android noma inguqulo ofuna ukuthuthukisela yona uhlelo lwakho lokusebenza. Lokhu kuzosebenzisa lezi zilungiselelo ezizenzakalelayo kumaphrojekthi akho esikhathi esizayo, kodwa ungawashintsha noma kunini.
  7. Uma lokhu sekwenziwe, buyela esikrinini sokwamukela se-Android Studio, bese uchofoza Iphrojekthi Entsha.
  8. Lokhu kuzoqala isilekeleli noma isilekeleli sephrojekthi esisha.
  9. Izokucela ukuthi ugcwalise uchungechunge lolwazi mayelana nohlelo lwakho lokusebenza, njengegama elizoba nalo, igama elizoba nalo ku-Google Play, igama lephakheji, i-ID, indawo yephrojekthi (uhlu lwemibhalo lapho ufuna lube khona), i-SDK , njll. Lokhu kuzoncika ecaleni ngalinye. Uma usuqedile, chofoza Okulandelayo.
  10. Esikrinini esilandelayo sewizadi kufanele wenze ngendlela oyifisayo isithonjana uhlelo lwakho lokusebenza oluzoba naso. Uma uqeda, chofoza Okulandelayo.
  11. Isibonelo, manje usungakwazi ukukhetha uhla lwemibhalo lomsebenzi oluthandayo, olufana Nomsebenzi Ongenalutho, oluzokhiqiza isibonelo esilula sohlelo lokusebenza lwe-"Hello World". Cindezela okulandelayo.
  12. Uma usuqedele imingcele yokumisa yephrojekthi yakho yokuqala, ungachofoza okuthi Qeda. Bese i-Android izodala isakhiwo sephrojekthi yakho. Qaphela ukuthi kuzothatha isikhathi eside okokuqala ngoba kufanele ilande i-Gradle (ikwenza lokhu okokuqala kuphela).
  13. Khona-ke iphrojekthi izovuleka futhi uzokwazi ukubona ukuthi ibukeka kanjani. Ngokuyisisekelo unemenyu yokuzula kwesokunxele (ungasabi inani elikhulu lamafayela, ngeke kudingeke ukuthi uwahlele wonke, lawo amakwe ngokubomvu), ikhodi yomthombo we-Java phakathi nendawo, futhi kwesokudla isikrini sedivayisi ye-Android esibonisa umphumela.
  14. Kuleli qophelo, ungaqala ukwengeza noma ukulungisa ikhodi yomthombo futhi wengeze yonke into oyidingayo ku-GUI, sebenzisa amathuluzi ahlukene ewanikezayo, zama ukuyiqhuba ukuze ubone ukuthi ingabe iyasebenza kuma-emulators, dala i-.apk, njll.

Engeza ama-plugin

Ngendlela, i-Android Studio nayo iyakuvumela engeza ama-plugin ezingakhulisa amakhono abo noma zenze umsebenzi wakho ube lula. Ukusuka kokunye okukuvumela ukuthi wenze ngendlela oyifisayo ukubukeka komhleli, kwabanye ukuze uzulazule ngekhodi kalula, engeza imiyalo ye-ADB, funda izinqamuleli zekhibhodi, ukhiqize ngokuzenzakalelayo amakilasi e-Java kusuka ku-JSON, njll. Uma ufuna ukuhlola nokusebenzisa lawa ma-plugin asuka endaweni yokugcina esemthethweni ye-JetBrains Marketplace, landela lezi zinyathelo:

  1. Vula i-Android Studio.
  2. Iya kokuthi Ifayela > Izilungiselelo > Ama-plugin.
  3. Chofoza inkinobho ethi Phequlula Amakhosombe.
  4. Thola i-plugin ofuna ukuyifaka.
  5. Chofoza Faka.

Ngethemba ukuthi kube usizo kuwe nokuthi uqala ukudala izinhlelo zokusebenza ezinhle ze-Android. Kamuva sizophinde sishicilele izindatshana zendlela yokuhlela, ngakho-ke hlala ubhekile ibhulogi…


Yiba ngowokuqala ukuphawula

Shiya umbono wakho

Ikheli lakho le ngeke ishicilelwe. Ezidingekayo ibhalwe nge *

*

*

  1. Ubhekele imininingwane: Miguel Ángel Gatón
  2. Inhloso yedatha: Lawula Ugaxekile, ukuphathwa kwamazwana.
  3. Ukusemthethweni: Imvume yakho
  4. Ukuxhumana kwemininingwane: Imininingwane ngeke idluliselwe kubantu besithathu ngaphandle kwesibopho esisemthethweni.
  5. Isitoreji sedatha: Idatabase ebanjwe yi-Occentus Networks (EU)
  6. Amalungelo: Nganoma yisiphi isikhathi ungakhawulela, uthole futhi ususe imininingwane yakho.