Applicatio
Fu
dame
tals
A
droidapplicatio
sarewritte
i
theJavaprogrammi
gla
guageThecompiledJavacodealo
gwitha
ydataa
dresourcefilesrequiredbytheapplicatio
isbu
dledbytheaapttooli
toa
A
droidpackagea
archivefilemarkedbya
apksuffixThisfileisthevehiclefordistributi
gtheapplicatio
a
di
stalli
gito
mobiledevicesitsthefileusersdow
loadtotheirdevicesAllthecodei
asi
gleapkfileisco
sideredtobeo
eapplicatio
A
droid应用基础:A
droid应用程序是通过java语言开发的,通过绑定一些应用所需要的东西,例如:编译的Java代码,加上数据和一些资源文件,使用一个apt的工具将所有的东西封装成一个a
droid包,这个文件的文件后缀是apk。这个文件是分发并安装应用程序到移动设备的载体,是用户获得该应用程序所需要的下载的文件。
Applicatio
Compo
e
tsAce
tralfeatureofA
droidisthato
eapplicatio
ca
makeuseofeleme
tsofotherapplicatio
sprovidedthoseapplicatio
spermititForexampleifyourapplicatio
eedstodisplayascrolli
glistofimagesa
da
otherapplicatio
hasdevelopedasuitablescrollera
dmadeitavailabletoothersyouca
callupo
thatscrollertodotheworkrathertha
developyourow
Yourapplicatio
does
ti
corporatethecodeoftheotherapplicatio
orli
ktoitRatheritsimplystartsupthatpieceoftheotherapplicatio
whe
the
eedarisesForthistoworkthesystemmustbeabletostarta
applicatio
processwhe
a
ypartofitis
eededa
di
sta
tiatetheJavaobjectsforthatpartThereforeu
likeapplicatio
so
mostothersystemsA
droidapplicatio
sdo
thaveasi
glee
trypoi
tforeverythi
gi
theapplicatio
omai
fu
ctio
forexampleRathertheyhaveesse
tialcompo
e
tsthatthesystemca
i
sta
tiatea
dru
as
eededTherearefourtypesofcompo
e
ts
ActivitiesA
activityprese
tsavisualuseri
terfaceforo
efocusede
deavortheuserca
u
dertakeForexamplea
activitymightprese
talistofme
uitemsusersca
choosefromoritmightdisplayphotographsalo
gwiththeircaptio
sAtextmessagi
gapplicatio
mighthaveo
eactivitythatshowsalistofco
tactstose
dmessagestoaseco
dactivitytowritethemessagetothechose
co
tacta
dotheractivitiestoreviewoldmessagesorcha
ge
fsetti
gsThoughtheyworktogethertoformacohesiveuseri
terfaceeachactivityisi
depe
de
toftheothersEacho
eisimpleme
tedasasubclassoftheActivitybaseclassA
applicatio
mightco
sistofjusto
eactivityorlikethetextmessagi
gapplicatio
justme
tio
editmayco
tai
severalWhattheactivitiesarea
dhowma
ytherearedepe
dsofcourseo
theapplicatio
a
ditsdesig
Typicallyo
eoftheactivitiesismarkedasthefirsto
ethatshouldbeprese
tedtotheuserwhe
theapplicatio
islau
chedMovi
gfromo
er