0% found this document useful (0 votes)
19 views18 pages

Adobe Scan Feb 02, 2023

Uploaded by

Susee Nder
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views18 pages

Adobe Scan Feb 02, 2023

Uploaded by

Susee Nder
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Pinn e

i Xml Code

Tex ew

andnofd: ld +d/+1
andnoid layoudt wfdth 6o dp"
andnofd heght = "Bodp"

andofd: +ext = 9tudenthame

edt+ext
andofd d : @+fd/ei
andoid: loyout - wfdth 1odP
angbiofd -heght 8odp
andaoid hfnt "Name"

Spinn e
andaod: fd @+fd/ Spin"
andoofd layout- wdth 4odPP
andoid loujpt - hegt nodP

andoid: entfes » ( onay Country

extfew
a n d h o f d :i d @+Tdton

oid+h:6o dp"
andaofd loyout-
hagt 8odp"
andaoid

Andofd text Couny

./z.
Stfng. vml >
/ 9 T I n g

resouncag appname >


9pfnra

String nome
Stringavra Coun 78
hare T
>

thdia / P en
Hom>
4/1em>
em> USA
2/Ptem>
2em> franco

/Stng awia

Man Aiity. Java

mport andooïd. bundle


os.

import n drofd. cwidget.*;

Pubifc Clasc nafnAdIt extend APpCompat A tivi4y f

oterenfde
Proteted vofd
vOid onoeate (Bundllo SovedIn stancestate
Shpen, oneaake(Savadin Stance State);
Sei Content vie w R-
layout.ativity -matnl
apinna Sp-(Spinnen) fnd
view Byid (R.d.
(R d. Spin);
String CS Indio" UsA", " Spin)
Aray Adapten <
Sting adp heu
France
getApplftat new
ATTay adapi9
tontext (1, andnofd. Tayodapi
spinnen opdown fte R.
m, s) layout.
yout. Simple-
Simple
Sp. Sotadap-te (odp)
Sp.
Onemselet ed lfstenam new adpoten viouw, onite
Setet ed Ifsleno

Ovonid e
Public Nof d onftem Selected ( AdaptenvMew odapteve
View viow, î ong f
ToasH. maret e x+ ( get-App atfontentex+ (), SC?,
t oagt. Longth-long). showt 1

Publfc vofd Onnothfng Seleted (ada ptmvf ow optenie

Auto omplete text víew

Xm od e

Text vie w

andotd fd +fd/+
loyoutwfdth: 20dp
androi d
hog ht 8odP
andnofcl

Ehooge the touty name


andbofd: text

17
Autptom ple+etevi vfew
d @+id/ a
Andbord ayou widh Sodp

odP

andboid

Java code
Ymport andbold. os. bundie
Ympor+ andboid. widget a pptompatAv i t y
extendg
Publ class uain A4ivity
( ovaxa?de
Protet ed vofd oncaoate
(Bundle
Sava tnStaanceStat
ceState 1;
Supen. Onooat e SavoltnStan
setionten+vfew (R layout.ativity- ma+n ) ;

Atotompletetext viow A :CAco tomple4 e t e x i ew)


fndiewByid R fd.a);
Strig S 4ay' Inda"
Arrayodapte istving dp heuw
ne
ueApphfation tontext), Selet -ddloq
AT
ArTayada
Toy oda pte1(
pten (
A.
Sethr a8hod 1) -tem, s);
A. Setodapten (adp);
Xm Code
cheue box
andaoid : Pd @+rdC
ouyou - wfath: 8odp
heght "6odP
ex4= Pen

7
A checc box

andsiod d +d / Ca
Loyout- width : bodp
6odp
hoght 12 oapP
+ex Penc71.

/z
2 Checie box

andaoid: ?d @+ 1d/ C
logout- width 2odp
hegt bodp

+ext view
andaoid fd + Id 4"
layout - width: 6odp
heght 160 dP

+ex GST
t o g gle buctton
a n d a o l d :P d "+1dt
" I o d p

th
-uwfd
h a g n t
BodP
Bodp

layout

button G8
H
button

a n d r o d :
text ogf : " b u t t o n
on

1exdo n
Android,

17
2 button
andbrofd: fd 4Id/b
6odP
ayout-wld
- h oth:
ght wrap lontent

2x OYdo

17
deva code

import andoid.09 bund le;


fmport andoroid. widget. Checb0y
Publfc Closs Nafn Adivity
exterdg4
( a o vevud e Appcompart ativit
proteted vod
enaatoBundle Savd Inanre Sto
Sup. ontaate
Savedingtance
Settontentveuw ( R. state ):
lauyout.
auyout. aci vity_main)
Choucbox C (checcbox) nd
ewByid
acti?y_main);
( R
R d.
Id. C)
c2 C);
C),
( C2)
R To. by)
buton b Cbutton findow By1d
togale button (tog4lobutton)
Dl
bl. Set onc'c ie Ifcteno (new view Onc licelist eron 1.

ovoide
Publfe voTd onelfciC vTew v)

StringBulden S new StrfngBuulaan C);


int tot =
O

f Ce. s Checked ())


tottot lo;
Pperd " Pen : to Pg")

CCa s check ed )
tot to+ + 2o
S. appernd (perncfl: 202"1;

1f CC3. sched ed () )

tot to++5
S.
append1ag an: 5 Pg";
3/00OO3
Stsng S+ gettext() , to S+hing () ;

f
.S.append ( Ioggle button on: 9+);

T t t o t : tot0.03
maketex 9etAPphCatfon Contey+C), S/n +to4,
Toast
toast. lenqth-long-show (),
2. Xnl code
1
Tex Ufeu @ + r d /

fd.
u t -w t d t h

"20dP
2 o d p "

Qndaof " hogh 12odP


Pod

InStagaM

tex+

e t +ext+
ei
andnofd: fd "@+1d /
godp"
wfdth:
layout -
heght 12odp

!hfnt "ugenname

/
Edt+ex t
andsotd: fd @+d / e
oyout width 90dp
heght odp"
hint= Pagswort

fnputtype +et PasswoTd


2 t button»

androld id
+Id/ b.
yout- width /
heght wTap
wTa ontent
Conten+
login
button
fd " Yd/ b"
andhoid wrap Content
ayyout w'olHh
UTap COn t e n t

ex Forgo- pa9suwOd

/>.
Man Aivity. Java
m Pont android. widget. Edit ext i

APPtompatA
fuity
Clags exend
pubc mafnat9 ty
( o vofde Saved in Stan-
Bundle
onc A o a t e
Photet ed Void
Save InStanceS t a t e ) ;
uPen Onooate
aciuity mainI
R-louput,
Xttonten4 ufewC
P fd .e,)
Edttext 4I(Edittext) nd v'ew By1d (
C e )
C
.)
bI Cbuttorn)
button
onclicIC1iStenen

Cnew víew
9eton Ifce listen@n

Oveoude
onclicic view v)
ublic vold

S t. get Tex+C1 .
toStiing C;
Sting
Strng
ta. getTex+0 toStaing (
String S2

( Sa -9 ualg C23")) s
9f ST.equals ( Pacugfe ")&
Context C), "welome
Toast mae tex+ 2et ÁPplicotion
toas+Leng+h long* Showc)
Oag4 mare+ex+ (getapPlTiaionontextC)
'n04 ext), Tyogan"
esef houw
Sh.
lon9).
length-
m a k e + o

toagt.

9.
Andaofd man? feg4 Xm.
a) inteunet
USeg- Pemission

andnoid: nme andbiofd. Pomission. NTERNET"/

b) Camana
Useg. - penmiesion

andndid hme andaoid. pmie sion .

CANERA"l>.
Xm Code

text vfew
andoid: fd = @ +Td41

ayo ut- width 20dP


hoght 6odp"

+ext fahen hel+ value


Ente

&£dit+ext
andoiod 9d "@+ld /e
bodP
6odP
you - width 2odp"
heght

MainAtfvityJava
import andioid. widget
ApPCom
Pcompot ty
ativi
pat activi ty
e
exxtte
errd
d9a AP
clags Manattivity
Public BundleSoved tngfance state
void onoate (
Photected
o n o t e l Savadingtence
State \
Supen
Settontentvew (R:laujout,
Octi vity Mafn)

) firdufewBy R d. e)
+ (dit text
edt tex4
button bi (buutton)

-13
ne

l i s t e n a
(view v){.
onclicie

Set o n C i T C

6 void to Stn9 ) ;
to
S+at,

Publ gettextC).
Conven Son
ti. vt.
act vity ths,oLend.a
Stng
9
Intent
Man .class)
new

ntent
*en+
Y -

bundle)(1 ;
bundle

new s);
b
bundle F a h r o n h e t
a lue
b, Puutiht
C"
b)
f Put Ertras (
Rogut
(P, 3)
Stast
a vityfor

T u o g ttode
2gut(
Pro t e t e d vofd on Acty+y infet data
Code,
n tregult

upo. on CLate (requoglpde,


ng ultode, data)
f(request code 3)

Stng Sz
String data, getStsinq Extsa( " denti iqmad e"
Sting Si = data. getstang extsa (" -fahven heit |

st. Set+ext (foahmen hot centrigade:", s2 +S );:


Convensíon

ond- a tivyJava
Bundie b»
9in+ent C), aetetsagC)
sting S b. g e t h + C" -fahrenh@t valuo " )

X S.
In+ege. PaséeInt (91)
oo
toagt+-na
toatmaketext getApplf Catf on Contex+ C, y,
long ) .shouwC

btton b Cbutton) nd uewbyid Ceid bo)


b 9etonelicie lis+en hew V.ew. oncLC i S e n c

Public void oncliciC( ew vS.

edit +ex+ = tex+)


n+en+1 neuw Csetnten+
eda g)
. pute xtra Ctenf qde, y)
Setregult C3 1);
AtYvty n o p r e g e n t s
Sngle Smon
Atvrty
wth as 1ts fntent
aufvit
data Om one o anothag

bundl e ;
actfvity we

Mutiple avity oY loosely botundo.

Ley cle Nodels


Call back methodg).

Ohoieote t)
2 Ons toS+()
On Pegume l

Onpaugec)
on Stopt)

6 on
Reetatt C)
On de+1oy

onoate t) and
n the
ondot10y C)
feuyCle ModeI. ue only once
VIT
Vellore Iustitute
ADDITIONAL SHEET 8
of
Technolog
Initial of the Hall Supervisor with date
Emp. 1D.:

Adiity 1fe uycle


Advity
aunched

onoote)
navgote
onSta+C|
APP PocOS onRastatC)
CiLe
On Posume

en
(Ati ty uannïnga) Aetwn9

to
anotthe ativity atvity
ApP w t Come to
hlqh pi tor On Pauge fore0und
h o c l meMorH
avity is no
hovigade4
to aivty
onge visible

Ongtop -

ativity niShing
Or befng dostroyed by System
ondotroy)
atvity
Shutdown
fSt C 1 a te d

O n eatet
actfyty
uhen
viefble to
activfhy s

OnStaNt ()
when
CalLed

usen

fntenaHng
on Regume (
whon
ativity
Callod
wth

hot
hot Vistbie
visfble
s
Callod when atfity
the ug.

OnStopC)
Callod the adivty s no longes1

vsTble to the

on Pestraett ()

CalLed ogte a
4ivity e
Stoppad
prior to gtat

on dostroy C)

Colod begone he
dogtroyed C). atity S
Ts
Manafvity. Jav
bundle
bundle;

andbio td.
os
ImpoTt
extends atfty 4
PublPe clag m
maat
tnna
actt
iivvrrtty
y SavedtnstanceStath
stat
S a v e d n g t a n c e

Leate(Bundie

on
vofa
Prot edted
state\
stance
SavedIn
te ( mafn)
Supen Onc ctfvity-
2. layout. a
Setontentvieu

"oncoate
Invoked "
loq d

overofde
Proted ed
void OnStastC)
Supen, OngtatC);

onstotC),fnvo kod ");


Log.dC"

ovefd e
vod on P09 umeC)
prote ted
Supen. on Pogumec)

Inuoked")
Log.d ( " onPesume

( a ovevide

Protect ed vod on P a eti


Supen. OnpougeC);

Logd C" onpauge tnvoked "|,


(@ovevnide
on Stopc)
Pootetef voYd

Supen onStoP C);

"
OnstoP
invoked ");
Log.d (

Ovevfole

Onpegtaat C
PYoteuted vod

Super. On2otantC),

Log.d onpetatYnvoked "):

(a oveide

Photeta vo1d ondoto oyC)


Supen Ondostroy
Log.d ondestnoy () invoked)

You might also like