Yangi formatda davom etish uchun: https://uzfor.net/view.php?act=post&id=63509
Postga havola
NetLizard [1846] [ban]
Hammaga salom!
Demak davom etamiz.#1 postdagi kamchiliklarni togirlab yozaman.
Quyida bizga kerakli savollar:
1) Android nima ozi?
2) .apk va uning tarkibi qanday?
3) AndroidManifest.xml?
4) Librarylar nega va qanday ulayman?
5) Google xml batafsil?
Android- bu mobil, smartwatch, tablet, android auto va tvlar uchun operatsion sistema.Androidga Palo Alto, Californiada 2003 yilda Andy Rubin, Rich Miner, Nick Sears va Chris White tomonidan asos solingan.2005 yil iyul oyida Google bu kompaniyani 50 mln $ ga sotib oldi, 2003 yilda Android Inc. bahosi atiga 10,000$ pul ortidan rivojlangandi.
Android Versiyalari:
1) Android 1.0,2008(nomsiz prosta android, kopchilik android a dan boshlangani uchun unga nom qoyilmagan deydi)
2) Android 1.5,2009(Cupcake)
3) Android 1.6,2009(Donut)
4) Android 2.0-2.1,2009(Eclair)
5) Android 2.2,2010(Froyo)
6) Android 2.3,2011(Gingerbread)
7) Android 3.0,2011(HoneyComb)
8) Android 4.0,2011(ICS)
9) Android 4.1-4.3,2012(Jelly Bean)
10) Android 4.4,2013(Kitkat)
11) Android 5.0-5.1,2014(Lollipop)
12) Android 6.0,2015(Marshmallow)
13) Android 7.0-7.1,2016(Nougat)
14) Android 8.0-8.1,2017(Oreo)
15) Android 9,(Android P)
Android bu Linux 2.6 kernel moslashtirilib yaratilgan osdir, xuddi gnome, ubuntu, tizen va hokazo.
***********
Android .apk tuzilmasi va android arxitekturasi.
Android arxitekturasi: SYSTEM APPS=>E-MAIL,CAMERA,DIALER,CALENDAR
|=JAVA API FRAMEWORK[color=violet[
|=NATIVE C/C++=>WEBKIT=>OPENGL ES[/color]
|=ANDROID RUNTIME=>DALVIK VM=>ART=>CORE LIBRARIES
|=HARDWARE ABSTRACTION LAYER(HAL,ruscha jeleza)
|=BLUETOOTH,WIFI,SENSOR,AUDIO
|=LINUX KETNEL
|=DRIVERS=>BLUETOOTH,AUDIO,KEYPAD,WIFI,DISPLAY,USB,SHARED MEMORY
[color=red]
|=POWER MANAGEMENT
***********
Android paketlari haqida batafsil.
Android ozining .apk formatini qollaydi.
Apk tarkibida: .dex, .dex2, .arsc, AndroidManifest.xml, META-INF, res, assets, third_party, lib kabi papka va fayllar boladi.
.Dex- bu dalvik executable format, yani yuqorida yozganim DALVIK VM android uchun maxsus mashina u mazkur .dex faylni oqiydi.
.arsc- bu fayl ichida dasturimizdagi matnlar, va boshqa sozlar saqlanadi.Masalan, biror dastur menyusida "Sozlamalar" sozi ushbu .arsc ichida boladi.
AndroidManifest.xml- bu android ilovasining pasporti desak boladi, chunki kodlar bolgani bilan, ushbu kodga ruhsat har doim AndroidManifest.xml tomonidan beriladi.Xuddi siz forumda navzu ochasiz, ammo admin aktivlamasa befoyda bolgani kabi.Bu yerda siz .java kodsiz, admin bu AndroidManifest.
res- bu papka unda .xml, grafik va ovozli(raw papka) fayllar saqlanadi.Masalan, #1 dagi dasturda strings, values, menu kabi .xml fayllar bor, yoinki drawable papkadagi .png fayllar.
assets- bu yerda biror proyektdagi qoshimcha fayllar saqlanadi.
lib- bu yerda .so formatdagi library fayllar saqlanadi, ular c/c++ da yozilgan.
META-INF- bu papkada sertifikat va MANIFEST.MF bor, bu orqali paket ichidagi barcha fayllar ketma-ket qatorlab yozikadi(avto) va SHA-1 orqali encryp qilinadi.Masalan:
*************
Librarylar(*.jar, *.aar)
Bular dasturlardagi funksiya, dizayn va ui uchun oldindan tayyorlangan modullar.
Masalan, biror dastur bor uni ishlashi uchun "import" orqali kerakli libni import qilish kerak.Masalan: [code=html[package com.uzfor;
import android.webview.webkit.*;
//webkit dan song * qoydim yani kerakli activityni bir birdan qoshmasdan hammasini birdan qoshsim(massivga oxshash)
import android.os.*;
import android.support.support.v4.*;
public class MainActivity extends Activity(){
//tushunarli boldimi? Bu yerda MainActivity class fayli aktivity sifatida yaratildi.
}[/code]
*************
Google Xml- bu oddiy xmldan farqlanmaydi, lekin oziga yarasha teglari bor.U ham xmlga oxshab <?xml version="1.0" encoding="utf-8"?> kabi boshlanadi, ammo oziga yarasha teglari bor.Bu haqda keyinroq toxtalib otamiz.
*- Kechqurun yangi funksiyalar qoshilgan #1 ilovani korib chiqamiz, aytganimday har haftada 2 ta maqola qoshiladi, bu degani bitta ilovani 0 dan takomillashtirib boramiz va undagi resurslarni organamiz.
*- uzr men ozim tushuncham boyicha yozyapman, bazi birovlarga bular umuman tushunarsiz bolishi mumkin.Etibor bermanv, men ham boshida bularni juda qiyin, qandaydir galati tasavvur qilgandim.Keyin organib chiqsam oddiy javascriptdan uncha farq qilmaydi.
Demak davom etamiz.#1 postdagi kamchiliklarni togirlab yozaman.
Quyida bizga kerakli savollar:
1) Android nima ozi?
2) .apk va uning tarkibi qanday?
3) AndroidManifest.xml?
4) Librarylar nega va qanday ulayman?
5) Google xml batafsil?
Android- bu mobil, smartwatch, tablet, android auto va tvlar uchun operatsion sistema.Androidga Palo Alto, Californiada 2003 yilda Andy Rubin, Rich Miner, Nick Sears va Chris White tomonidan asos solingan.2005 yil iyul oyida Google bu kompaniyani 50 mln $ ga sotib oldi, 2003 yilda Android Inc. bahosi atiga 10,000$ pul ortidan rivojlangandi.
Android Versiyalari:
1) Android 1.0,2008(nomsiz prosta android, kopchilik android a dan boshlangani uchun unga nom qoyilmagan deydi)
2) Android 1.5,2009(Cupcake)
3) Android 1.6,2009(Donut)
4) Android 2.0-2.1,2009(Eclair)
5) Android 2.2,2010(Froyo)
6) Android 2.3,2011(Gingerbread)
7) Android 3.0,2011(HoneyComb)
8) Android 4.0,2011(ICS)
9) Android 4.1-4.3,2012(Jelly Bean)
10) Android 4.4,2013(Kitkat)
11) Android 5.0-5.1,2014(Lollipop)
12) Android 6.0,2015(Marshmallow)
13) Android 7.0-7.1,2016(Nougat)
14) Android 8.0-8.1,2017(Oreo)
15) Android 9,(Android P)
Android bu Linux 2.6 kernel moslashtirilib yaratilgan osdir, xuddi gnome, ubuntu, tizen va hokazo.
***********
Android .apk tuzilmasi va android arxitekturasi.
Android arxitekturasi: SYSTEM APPS=>E-MAIL,CAMERA,DIALER,CALENDAR
|=JAVA API FRAMEWORK[color=violet[
|=NATIVE C/C++=>WEBKIT=>OPENGL ES[/color]
|=ANDROID RUNTIME=>DALVIK VM=>ART=>CORE LIBRARIES
|=HARDWARE ABSTRACTION LAYER(HAL,ruscha jeleza)
|=BLUETOOTH,WIFI,SENSOR,AUDIO
|=LINUX KETNEL
|=DRIVERS=>BLUETOOTH,AUDIO,KEYPAD,WIFI,DISPLAY,USB,SHARED MEMORY
[color=red]
|=POWER MANAGEMENT
***********
Android paketlari haqida batafsil.
Android ozining .apk formatini qollaydi.
Apk tarkibida: .dex, .dex2, .arsc, AndroidManifest.xml, META-INF, res, assets, third_party, lib kabi papka va fayllar boladi.
.Dex- bu dalvik executable format, yani yuqorida yozganim DALVIK VM android uchun maxsus mashina u mazkur .dex faylni oqiydi.
.arsc- bu fayl ichida dasturimizdagi matnlar, va boshqa sozlar saqlanadi.Masalan, biror dastur menyusida "Sozlamalar" sozi ushbu .arsc ichida boladi.
AndroidManifest.xml- bu android ilovasining pasporti desak boladi, chunki kodlar bolgani bilan, ushbu kodga ruhsat har doim AndroidManifest.xml tomonidan beriladi.Xuddi siz forumda navzu ochasiz, ammo admin aktivlamasa befoyda bolgani kabi.Bu yerda siz .java kodsiz, admin bu AndroidManifest.
res- bu papka unda .xml, grafik va ovozli(raw papka) fayllar saqlanadi.Masalan, #1 dagi dasturda strings, values, menu kabi .xml fayllar bor, yoinki drawable papkadagi .png fayllar.
assets- bu yerda biror proyektdagi qoshimcha fayllar saqlanadi.
lib- bu yerda .so formatdagi library fayllar saqlanadi, ular c/c++ da yozilgan.
META-INF- bu papkada sertifikat va MANIFEST.MF bor, bu orqali paket ichidagi barcha fayllar ketma-ket qatorlab yozikadi(avto) va SHA-1 orqali encryp qilinadi.Masalan:
Manifest-Version: 1.0 Created-By: 1.0 (Xamarin) Name: res/menu/menu.xml SHA1-Digest: sPSGVTFAIwcDAmI8djl0pvTnbKI=
*************
Librarylar(*.jar, *.aar)
Bular dasturlardagi funksiya, dizayn va ui uchun oldindan tayyorlangan modullar.
Masalan, biror dastur bor uni ishlashi uchun "import" orqali kerakli libni import qilish kerak.Masalan: [code=html[package com.uzfor;
import android.webview.webkit.*;
//webkit dan song * qoydim yani kerakli activityni bir birdan qoshmasdan hammasini birdan qoshsim(massivga oxshash)
import android.os.*;
import android.support.support.v4.*;
public class MainActivity extends Activity(){
//tushunarli boldimi? Bu yerda MainActivity class fayli aktivity sifatida yaratildi.
}[/code]
*************
Google Xml- bu oddiy xmldan farqlanmaydi, lekin oziga yarasha teglari bor.U ham xmlga oxshab <?xml version="1.0" encoding="utf-8"?> kabi boshlanadi, ammo oziga yarasha teglari bor.Bu haqda keyinroq toxtalib otamiz.
*- Kechqurun yangi funksiyalar qoshilgan #1 ilovani korib chiqamiz, aytganimday har haftada 2 ta maqola qoshiladi, bu degani bitta ilovani 0 dan takomillashtirib boramiz va undagi resurslarni organamiz.
*- uzr men ozim tushuncham boyicha yozyapman, bazi birovlarga bular umuman tushunarsiz bolishi mumkin.Etibor bermanv, men ham boshida bularni juda qiyin, qandaydir galati tasavvur qilgandim.Keyin organib chiqsam oddiy javascriptdan uncha farq qilmaydi.