5-
qadam: Android virtual mashinasi (AVD) ni o`rnatish
Android SDK o`z ichiga quyidagilarni oladi
Debugger
Libraries
an emulator
Documentation
sample code
tutorials.
http://developer.android.com/sdk/index.html dan Android SDK yuklab olinadi va dastur
o`rnatilgandan keyin Android SDK Manager ishga tushiriladi. Buning uchun quyidagi ketma-
ketlikni amalga oshirish lozim: All Programs > Android SDK Tools > SDK Manager
1.4-rasm. Android SDKni yuklab olish oynasi
Agar joriy kompyuterda Java (JDK) o`rnatilmagan bo`lsa, u holda Android SDK Manager
ishga tushirilganda quyidagicha xatolik chiqadi. (1.5-rasm
)
1.5-rasm. Android SDK Manager ishga tushurishdagi xatolik
Agar kompyuterda Java (JDK) o`rnatilgan bo`lsa, u holda Android SDK Manager
muvoffaqiyatli ishga tushadi va quyidagicha Android SDK Manager ni sozlash oynasi paydo
bo`ladi (1.6-rasm).
1.6-rasm. Android SDK Manager ni sozlash oynasi
1.6-rasm. Android SDK Manager ni sozlash oynasi
Har bir API level uchun asosan ikkita platforma mavjud. SDK Platform, Google APIs by
Google Inc. (Google maps uchun mo`ljallangan ilovalar yaratishda foydalaniladi)
Ilovani yaratish uchun kerakli kutubxonalar o`rnatilgandan keyin ilova kodini yozish va uni ishga
tushirib ko`rish uchun instrumental dasturiy vositalar kerak bo`ladi. Ushbu dasturdan bittasi
Eclipse bo`lib, android ilovalar yaratishda qulay interfeysi bilan ajralib turadi. Bundan tashqari
Netbeans, IntelliJ IDEA, Android Studio kabi dasturlar mavjud bo`lib, bo’lar ham ilovalar ishlab
chiqishda samarali foydalaniladi. Berilgan ssilka (http://www.eclipse.org/downloads/) orqali biz
Eclipse dasturining kerakli versiyasini yuklab olishimiz mumkin. Yuklab olingan dasturni
arxivdan chiqarib olib ishga tushiramiz.
Misol uchun (C:\eclipse\eclipse.exe):
1.7-rasm. Eclipse dasturi dastlabki ishchi oynasi
Android Development Tools (ADT) Plugin ni o`rnatish
Eclipse uchun Android Development Tool plugin ni sozlash quyidagicha
Eclipse ishga tushiriladi
Help > Software Updates > Install New Software.
Name: ADT Plugin
Location: https://dl-ssl.google.com/android/eclipse/
Press OK ->Next->Finish
1.8-rasm. ADT Plugin ni o`rnatish
Android dastlabki ilova yaratish. “hello world” misolida. Android tizimida ilova yaratish
jarayonida to`g`ridan – to`g`ri ADT dan foydalanish qulaylik yaratadi. Ya’ni ushbu vosita android
muhitida ilova yaratish uchun kerakli bo`lgan barcha instrumental dasturiy vositalarni o`z ichiga
oladi. Albatta AVD (Android virtual device) alohida o`rnatiladi.
“http://developer.android.com/sdk/index.html?hl=sk#download” link orqali ADT bundle ni
yuklab olamiz.
Yuklab
olingan
arxiv
faylni
arxivdan
chiqaramiz
adt-bundle-windows-x86_64 papkasi asosan quyidagilardan iborat
sdk
eclipse
Asosiy dastur ishchi oynasini ishga tushirish uchun eclipse papkasidan eclipse.exe faylini
ishga tushiramiz.
1.9-rasm. Eclipse (ADT) dasturini ishga tushurish jarayoni
ADT ning dastlabki oynasi. Ushbu oynadan “New Android Application” tugmasi bosiladi
va keyinga rasmlarda ko`rsatilganidek ketma-ket amallar bajariladi.
1.10-rasm. ADT ning dastlabki oynasi
1.10-a) b) s) – rasm. Yangi loyiha yaratish oynasi
1.10-d) g) – rasm. Yangi loyiha yaratish oynasi
1.11-rasm. Yaratilgan ilovaning mavjud papka va fayllar tasnifi
1.12-
rasm.
Ilovaning
dizayn
ko`rinishi
(avtivity_main.xml)
Android da tezkor emulator. Genymotion virtual mashinasidan foydalanish. Android da ko`pchilik
foydalanuvchilarimiz kompilyatsiyani AVD (Android Virtual Device) emulator orqali amalga
oshiradi va bunda natija chiqishini kutish kerak bo`ladi. Ushbu kamchilikni sezilarli darajada
bartaraf etish uchun Genymotion virtual mashinasidan foydalanishimiz mumkin.
Do'stlaringiz bilan baham: