NAD UN-1
UNIT II
Android Applications and its Anatomy: Android programming model vs.
traditional programming models, Activities, Intents and Tasks. Other Android
Components. Component Life Cycles, Static Application Resources and
Context. Android Application Runtime Environment: Activity life cycle.
Manifest File. Layout XML Code, Strings, The R File.
LQult-.
ghodnoid dpplicatiou dud sa Chestouy
Cpplcatiout udroid
Oudoidts bill ou a eu inux kruel. dt Owoye
abstrortiou, daoid appltatouw Coob a lot uke seh aneabbn
dell dutqued ailiv y uspoumtble wouagudg a 1thgle
OI poge.& & eaeh hag
its uu taiw uOut.
ualöuy Qudaoid Appiealioue
Jhe auatouy qaudroa appicatiou h wothig but t elde
de t aundroid ojeet
Jhe vauicy Jolders ueluds
jovo souwe
files Che. Maidetioil java
andro3 Gbvar - tOau avdaoidjor
Catadu pva le
aset s aKeis wsed appealion sueh as +TAML
Resouas wsd aylitatou.
Modsl Vi ludoid
Jcodiboual ho9/guiug
oce
ppcation
atlaton pocCAS
mple un
orlel,
oam uing
bodlituoual
Ceraly, w tu
exe cution low qte
tssngle ere calion
ele t y poiut
), J u mairt) way pase ont Omuna n
Callu d
Callu od wa
Jn toutaast, audaord
paogvowfg wzittu
ovo Jova w on JV M :0 Ca
uslih qe aiy byte cad e
SVM Loads tubyte cort, fo wich it
ualy sauu
10 vo clases as tle e poo
the m
Phoe es
Jova TvM
Applteattoo
Thvad Thead
poces datied as a pogom [Link]
a povt a poceu paopom e pleu Cods, te ultug
ole perduty o olu heads.
Ohudhoid &tratuees a aictun appaoela by suppet6g uttibe
pplicatio a y [Link] poaus should epaet te
sfsliun to stat thor dt plaees , Aaptudis9
t we couing aom ad what t uyel oaut
to do u t
Ju b209 2aus cooperales a aglery toupoutut a t
woy be stated ou T outde t u tow your
antitatton.
ddolis, SaCuals &'s
detiviyz
a andeod, au otudy a oudos, Uat coulauiy lai os o
applica ww. Qlu oAAlialian oy baw o d u adioihe Ju hua2
octoctivity t mtrod wt t w
Caeaiou at
aetivtliez
Jo cuatu au aedioity,ase cuale a jovo clav, sTuat
egteud! tue Cetioity han clans
net. Jeasn2deve [Link],
poc po c kage
pt
adroid. o pp drlinoty
audeod. Buudle
os
fup
doan Moullivrl elevdsdtity
pubb
votd crCuau (uudlu. toud tatatot
ubl
Cuper
tuCveats (<owd lnalsuu Stat),
loyout oiu)
s tCoutsut Vie» (
w
R.
adities. Jt it a
lui tuust
uxd b uovigate blus
Jxteuts Ppieaton
appicathôn to w
octivities aow dilleut
cucolet dllereut be er d
e tas bs Cau
buat
Se autesal, esurtng
boqeter
beloug o asugle applicalien
a f u t u y al a
tuat eables t To peiy
lta t. t lte
t
called.
ouY
ociutes b
tepeuuts
totau tte olotoug
hu ited cbjeet cau
tbu
Dala
y
aclivilits coupaiiiug
tlat
spamspa ule tha
Iant chou
miot a proces
applicatudu & teu
A, A2,A3, Au ove
App 1
ApP3 lioties
Stant A
Othe Audvoid Coupouuut
JJA 3 otur cowpowiils droid tuat coilibute to
appkeatios are
Seaut es
Cont u t povtders
roadeast Reeeiver.
Beautu
lions ie but uol
Suppolu bakrotuud uu tuat moy be adive
vlsible Ou t Sereu.
Mtous appiea
atou to shove lions tvough Ouue tlioat.
Paovteers
uy Reeoneadid rooy to shau data avod pockogs.
3t i a bid data store
beloves uke a dolahase n can quy &, edit iu cotilent
Oulte dolohae, we caud r epereiat
a 0ay aove data ike
a ulo.
1Lisf Couleut Phovtdor Cperaliont (Methoo
Dnseat
Upola
-belile
So wful coulurt providen înclude
owser: stor data sueh as bookuoks, hü loy r ele
Call to sloves aised callt, Call detouly , ele
Conloc la P codot dilaile
[Link] udia
d io
sela as
audo, vieloo, uoges.
Grtugs
te deptic es cettings ennteS
- Cau Cwau ovs coulist povfdes.
ApP APP
b u s u loyer.
Couult ovide Data Aeee loy*r.
Ruo ite
att' S
Cite
le Dal lo
cea is ued o uPoiluud provider
<stoudod-pg x lzautunily>/<date. pots >/eid>
i outet /)
Stoudord * ocoituud
poye'der auoay
tne nam d tue cout u t provide
auttordy sDe eies
dola haltn spees te tu data Yeguesd
aeeod quegtd
tt speise
id es
Breodeast Rectiver -
ASuvice tau cowwwwicall oith au ocily új a
D(dear Tecefues. Zut doesue a ? eou .
Coupowt oe Cles +
nchocd appealion ave. auaged coupoueitt, wits
COuLysetfe i etog Coupeuwut t e g tolale gcie CLse
PAltcslin
Jhe Actiuityi Cyple
dhe detivty boe clas duue a sestes eveut uat oveaug
t u au atlivily. Jhe eresl ave.
on Create C called udusn aetivy is cvealed
oStot ) - called whu a cliuty betomes vble to
waer
Onkesu me ) - calud eoun aetivaty sfot teroctivg
ot
- enlauet )
catlud tohen te vtout aciuly i reuwed &
Cuvveut aetiviy is
poued.
Onstop ) catled e n activty u loqey ible to
-
OnRestoat( ) - callud wur the octiuity hos beth <topped
resla agau
nestoy c)- collud ove tus arlivity ts devouyod
Koueh
Restore e r e
Cte ()>gtavt Starlg
Staliq94
n Reye J
RuuutgS
ouesort()
"Pauxd
gare
onstap k Stopped-
LDesthoyeda
P e t i n g Salave to Auolroid ;
t Cudod, t u data
waut to pot ex'gtug s
kletaethe nodu ks & hronieg slot.d
[Link] be
uon
wodu, u waj
n t oudroid a ppltcelion
od o pleunented
deperduiq
luchod los
luohod Soe sinuloa?es to uodetu ppiea
aovogd ap hor
pica Cor
autme ev uutit , & lauguage sysems
Statie dppliealton tesoueet k Coulext
Th ves Coulas dinlio totiresoum e colov, coutaunt
sti ovot. ete tool pre process thu degiustions
. oludhod
fur tuu d katuy optiazed apreuuta tioug Ju tu jova
2eas to
tusu
owt thtougk aolie applfeatibu tods
aiwgeutud cae ft peit tüto
tle en direttory
oth etity Seice. etiud t tus Couti elass od
ativte Seuicex hone eu to iust ddla hous meilor
Hyyrt S
iyotivtyjov.
drauwade
tcon p
Sayout
activiy a un.*ul
tho u
values
Stving. x w .
loyot
cbutai udsoid uea iutulot ML
fles.
D
drouoble
Coutouy da alitoetu ( ohjeet)
O
old tles tuat way be eod ay Ata eaeus dutng T u execulo
au applicalion .
vau
toutois valuy luat tue applicaltoo Y vtod dutnq
exiio) stalit dala
au applieatbn koi ( ue jon Sutl
Junpo ses as uf stiegs
udapid dppltcatkow uul Cuvlaouwat
audrod utint poutdea a set g cote(ibroriy tuat
J
to i t audaotd apps us g tuu ova aum
uable deloprs
audaoid Aun tuune allo inedudeg -ua DV
onguag Th
oic euablee aueoiol appbcakrso
silth i6 ao stautt oDYM .
Houilust fiu
d a tuat wed by auuuug opplicetion,
n oddutiou Cs
eudanuuntl t
duceibe t
au oppleation alo nuds a ay
Jhi dete slod u
exets: h rom inlu, heamui« ou , .
ale Callud tue wauiat f y owed an Oudroid Mauijesl xl
xML Coole t
oayout
ho" eutodstg "ut-"?
wouilut ulus. audoid"hth:/ [Link]/1e
audsoid "
eo ielty-duuo pa> ebol tetapp"
pccboge
audod vuoCool"
audro d VeonNouN "1.0>
Kus pumiuon audeoid naue : *ardtod puuisi os .tAtL- PrbNE
oppDra to avdhoicl icon "@dawasle| icon"
auchoid : lalel "@rtaing /app- houe
audroid debuggable "hu >
Lactivi audnd: noe TutArtaurty"
avdrod Sobel est Arliky'
iteut iltr >
Loetroo audod:a audroid .in [Link] "
celegog audyond: o : auddd .[Link] AUNC tHee
iket -lt
lartivty >
KpoveluY audodua . TetProvide "
KSuict audroid uau . T o t Sezutcs
avdmid :lalpel Test Sadu
Keuvea
audo'id na
audnoid: label osSea vico "
adhoid houe
lopplire buon
sesSsdk audroid win dk Veasion ""
/wauad
oaetes -
Pobae
TLu deautt poebage uoue hodules tu appbcation caL b etd
wpuw ision amdroid uaune
P appbcatuso inteuds t u tuv o Adoid tuet vequire
o tN wura/ duice uuuig ti
rplict Von u
appiceop
Coww oy weel UisionN
Acc es- Fe -tocAnON - locaiwo tnoluuuatuoo
C . HONG Aous a puo ca
Access-MDC E-(OC AnON l lotniow Dfotunatuo
Atlous o opu
nfemmt couueetioy .
wCeNCT
t oppbealton
labe povides huwor odohle appieetuso lolel
fcon: lena 1á U o cur
tunut to we a itoh.
android uau oum of tt eloau hs atliuty
aundroldl label l e pprans ut bop o sc
intoili(te -
Jua teus wutu t atiu.G suoutd un
a ow Jel's how to louueh applitalto
cat gorj l o vthon qualay t u intert
CV ovidu
&nobles tw detlor ation Coutunt poudw
nobbes tthe a t» deelore tuat ?C Supposts a ven louiee
(U)Aecsiver
Proices a to
Ko eelore au
app BuppearK a
bomd aast
eeesel
AppU'catiðus aue esoueu tuun airee lõries oue
uoue
diveloy hierarupp e lbrod cDntxt get Resouvt es () adl t
cloot
foo Caly a direlõny callud gen tolueh Coutais a
calud uand ttu Jove [Link] pockagp. rOueol i ta
aolbod wawis
auohod .
Ju eeon hle Coumie tiells tet cnicuely
a l all ruautts t
applicailon poeboge stuele.
Deuelopes Call wetud! Call
Restureg okjett bo oklaun
eoues tte olyired ol Lous.
/cot inds au htu luad
Staig haltouwo ld : tus
. qet Kasoures ). gedSesiug ([Link] hetlosla)
nt au Lut tuis
-getKesounes(). aotdulaer [Link] au -il);
Staugr
Qu oppfetlon
Sigs au a sout Autifers
stytng owattiug. dhuue ose. 3 types o i n p
u v e . u a t povdes a sle ctig.
3t
X Yout tet ovidu ovaj
uutby sbirg: a pluval S t i
ttsnt "Hello' > tte/lo hdoord/stig
soun e>
Kresouee
tor >
la Sumelite
<de Mon l iteun >
eia-o1ray
epuree
2Tuornes
puve hawe pural-uo-
ilm quewtely "b"|""|'|o"|a"tn >
fet chnq [ileuu
puol
<ruour es>,
mauest eot element ele. elomeat Can oCc
atrbua Moula
once. mis aupocker
n elemeat
adnbe
QdnodVlata fada n e ntad vsain
weR.
epaed to
stuahbudan oudod. ssad Uselbhed,
mai> eloned no Centan
audod ddedhs Ld.
woee e applreahen lesl
«uses -sdk elemeot e uu
oclotd uyos.
swed geerese Qpltetton aonatibilrdy
ta
& a minimom Jeqped api-leuel
andRoid minSdkVAsion
qPplahin to un
tte tRgeted applieechen
le. t
Qucdod: tkqet Sdk bRien .
oil be
minSdkvRrn
ten
not
pec
e d a t uaue
decle h e applerztn. T elemask
appleton usod
ce. Tn element
aao
o de cle e tua applitcton Conponasbi kke aorce
bRoodcod Receivs, ackoie, etc.
npetat
Sone
andRod. allooBackup: Tus takes boclen wol tuel else
dkauada Qesokeea Uslue
Oughoid: iCon- Ttakea
a
avolu, [lan
[abel
adod: tak» 'st2ng em
aud woidt&emo. T kenResoacef taeme in O
an
e sye to be e c all tuo actip
plioatma.
activys decle Ack cunes
aa
shold
te applreachea
ackurthes d in
Autha
the wut Mo. ottr
doch elenat
Ckaup no
neu be useel a ue applheartren.
andRord: name- saold coroandqred na a
arttyr l a .
e uad
asdeerd lo bel -ottwbu ca loe mea dupo
Readade the actty
e d to neee te pe
o Rexperd.
intent auela aciu
achtn ole mo
e
ntet-lk& Ts Cestom achvn eleront .
adds achn tohe 'ntent-:4&.
Coutoine o io mau est. sn elemert n
s e s -påpiolen
ecb spee ay speetal plumibn
coiken
appl'cohen.
yte d b Ron
Ondo:d pXutn INTERNET- pam ack opehin Ae
t deurt e Coubla
CAMERA
adrod.
p&mstcn
MOesty ae. elenca t e l e . n elemeat can oceu
once. xmlos ac packogg attarbub ala moudot
intn elemeat
adodVelata fode nentdad vsen adnbe
tis
to
dod vecaNme Vno be cplayecd
sla tnbudar oudod. ead
Uelbhel,
Tmaai» elonet oy Contan
audod dked Uhs Ld.
Ouses -sdk elemeot wee b e appreshen ledd vsl
T
auclod vy.
svols seete apehattan [Link]'bldg
Tua
ta minimon eqpRedl api-leve }s
andioic m n SakYasion
Ppl'achn to un
te +ted applieectenleaus. ta
udo'd: tolqet Sdk b&sen oill be
not gpece uen nimgdkVRatn
as d e a u t ualue
Ced
elemaot
apl:cahen so deeloRete appliozton. [
Tan element ww d
o deele e ditua oppltdhton Canponnbs tke lotte,
bRoodcad lceis, atortes, etc..
Qone [Link]
andRoid allooBackup: Ts take beclen vola ueeloe
O a o i d : iCon -
Ttoke diauabla ecolaea a Usuur
voahu, on n
audo.[abel- taka sag Aealte a
Knauiea *mnsi audrod
ktp:lscheuas. audoid
pachoge Com soo demo CoalRoacoid"
adod velaoncoda " "
ondsd u&ateaNe "ko"y
33
us -
sdk
dnrd miaSdkVeRsten "&
a d Eaget Sak vasan -'")
appleeach
audho d icon" edvawoe le-
:
lae"
/oug-na
tewee4yi lApplheme'y
actuty lato Akvtz
omple. dems.
om-
ad d [Link]
undod label "4tk/to - áctu-
Intert-tas
Aaotrcn audo'dnae "[Link]-acten. MAN/y
CotegRy oudod:nase "acoid .[Link]. ALJAdeHEA"1>
applrewten)
/mahext
[Link]
?xml version="1.0" encoding="utf-8 "?>
cmanifest xmlns:android= "[Link] com/apk/res/andro id"
package="[Link] Loworld"
android: versionCode= "1"
android: versionName= "1.0"
<uses-sdk
android: minSdkVersion= "14"
android:targetsdkversion= "17" />
<application
android :allowBackup="true"
android: icon= "@drawable/ic_Launcher"
android:label= "@string/app_name"
android: theme= "@s tyle/App Theme"
<activity
android: name= "com. pvp. hel loworld. MainActivity"
android: label="@string/app_name"
<intent -filter>
<action android : name= "android. intent. [Link]" />
<category android:name= "android. [Link]. LAUNCHER" />
</intent- filter>
</activity>
</application>
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="[Link]
package="[Link]"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="[Link].ACCESS_FINE_LOCATION" />
<uses-permission android:name="[Link].CALL_PHONE"/>
<uses-permission android:name="[Link].ACCESS_MOCK_LOCATION" />
<uses-permission android:name="[Link]"/>
<application android:icon="@drawable/icon"
android:label="@string/app_name"
android:debuggable="true">
<activity android:name=".TestActivity"
android:label="Test Activity">
sintent-filter>
<action android:name="[Link]"/>
<category android:name="[Link]"/>
</intent-filter>
</activity>
provider android:name=".TestProvider"
android authorities= "[Link]"/>
<service android:name=".TestService"
android:label="Test Service"/>
<receiver
android:name=".TestBroadcast Receiver"
droid:label="Test Broadcast Receiver"/>
<aolication>
<usesdk android:minSdkVersion="7" />
</manilt>