Professional Documents
Culture Documents
X. Exercise
(Use blank space provide for answers or attached more pages if needed)
I. ~rite a program to create a HelloWorld Activity using all lifecycles methods to
display messages using Log.d.
c:.
f._
········································································································································ ·················
(_
·········· ···············································································································································
······· ······ ····· ·· ······ ···· ·· ············ ······· ······· ··· ····· ······ ······ ···· -······· ···················· ···· ·· ·····- ·········· ········· ·· ······· ···
::~::::::~:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
....::G\t:-.e.n.c. ... l.... ::......f\er.w...X.n±.e..0:t................................................................. .
···········································c ·~ ·Tn.t.eot. ......0.-.c...T.ta.N ..-.V\.. ~ -·w· ··1······· ·····
.............................U.rl ..-Of.p .0e.'.l(.$C ..... C\.tci ..:...S\.'}.:l..4..4.~.~-o.& ..Q..~~-J.J;,..........
~Ct~.) ..~kb~Q.}..\i:l........................................................................................................
...L~.....o.. ...f).cJrr:,.e:is::k:••..~.o.l.u.~....~ ..is...~..o)he.n ....tb.e?r;e.,is
.r.e.e..cl.. t..~.....o..cc..ess .... q ....00,~Hc.Y.la.~ ....:,r.-.ec..o:¥cl,..................................
t:;~~~~~~~ ~ :e~;~1h~•~ii~~~ ·
~ .CA ·-· ··········· ····· ······· ········ ··· ···· ···· ··· ······· ···· ······ ·······.. ···· ·· ····· .. ... .............. 0............................... .
.C.:~:~J)...\~f,~F~eri.t...:ib.e ... §V'S ohc,:\:irar ½: t:"elli~~-~ --..~ .f'.\-r..Q.t\.\... .. .
~-J',Je.is cl~.......................................................................................................... .
.. C,:,r J ~8;~ tt,e. foot.en\: ~o vde.id IL
·.:~ ·c~;g~~·d.1;"\ai.\1.k.o .t:..~.~...?..i..le....lM~;J. ···~ ' 4 ~>.~;j····· 1
················
··············· ··············· ······················································································
···· ······ ······ ····· ················
.... ..............
· •· ·· ·· · · ··• '"" "·······• •"' """
.... ....... ············· ·· ·· ·· ·· · ·· ·· ·•·· ·· ···• " ' ' '''' ' ' '' '' '' ············· •"'
102
·I St· tC Board of Technical Education
Maharas 11ra a
Mobile Application Development (22617)
'.,ot.a.a~:::·. :: ::: : : : :
······· ············ ·· ·· ······ ·········· ········· ··· ··f"'T ""-~ ----..
CnlS>..Sh?.P
..... a!Xf.P.e.~ ' ......................................... .......... ...'.\!/J ' ...... ............................. .
u '.........
... . o. ..C c.¥-~... .............................................
r%········0W.......... ..........}.............................................[cnlli6m;- .tJ7 .: :::::::··········
-
· · ··
· · · · ·······
()
................................................................. ···································· ·············
df.) ~~
'2)~ M,
.i::.:s.~:~~·.~.~;~·,.>·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·:.·.-.·::::::::::::::::::::.
•••. !'c •. •.~.i.c.e... ..t.s. .... G..to.1s:-xe.d. ....~.h~.o. ... o.. n_ ...a.e_p\.i.<:...W:i..~.n ......... .
Cl MamAcliv,ty
Stop Service
AMIWdi
->
·······~··········=r~································ ······:· .. ······················................. ............................................
...............~ .... :.D.a.u.~.. ... . . . .....\D. . ... . .....Wl,,Cl,J...,1-,U,.& ........ ..
.t.o.~ .o .. .. :s........o .....;.n.te.r.a.c..c: ......Ll~.. th ..1£:..t½e.... ...5.e1r...1J.t:t.e...!,
..0 ......... :................. ..................................................................................................................... .
....~....~.....bo.ffid ..... G.Q~.',.cg ......o.~k-.-..s .....ei. .....c..\.;.en~ ....s .e.r.Jer..
.\.~ e e . ..~ .....olk~.... ta~D .e.n.t.~......+.o. . .JOta.n.u
wi~ ...f.n.~......~J~.e.'/....~a.. ..~~..u.e.sr.~..(j.e t.~u.1.u
aoc\. ....eu.e.l\.. .d..o...60......0..C..¥.css........ pro.ce.~..........6.J.1.~..................
W-\.t..el57y~c.g.~ ·····Co.. ~m ..cJD;.c.c.h..~C\.....CTP..~.J............................
········································································•············ ····································································
.. '\ . .
. ....lln'ro.iJ.n.c\. ...G..~?r\l..tJ:.~.S. ............ ...~ .uf\d_... ...s .g]r~.H.. ~~ .............. .
... .C.i).Ll~.e .cl.±:o .. f e?r~ ~ ............ :.u. 0.$..~.cl..±o.~b ..~. bQcJt·.. .
... Ja0.~ '.lrereki.H~e.- :m""1L §lrl;'ut,d,· '1:961?. i~ hol!.f.ld .
... ············................................. ····························. w, . fu...M~~e.r.........f'JfOO.el.'I'.\.•... .
••Di 2~;;;~ 1; ;;;fit Gi;5;~;;~ by ~ ~
.......S.~1d::S~.t'.ce...c.1......................... h,..n.c\~.v.£ce.. .CJ................. ........ .
•
... ·································· ··········· ··························· ················· ·························································· .
... ~\i.iJ.8:tt'.Of.Q...d ....n.~ .. de.s.t~::. Cti.~·J ..u.n.b.i.nd..o.~..d~s.t.~.ed.
-~-- ' b b -I
...··rrf··~·~···~ f·l.i.CJ.:tl-y-.... 1-... . ........ ···; ··r-..~auJ I :
...Q,_J....... ~................................. ·
'
I
Mobile Application Development (22617)
Bfoadcnt l!Unt
0 .:-:
...c;;
..<::
..C.
...(
.S
················ ··· ·············· ····························· ········· ··•" ················· ······· ···············•·"········· ·······--················
... ...... ...... .. .
·············• ·······•·················· ··•······ ···•····················· ··········
·· ··············· ········ ·····•····················
··· ····· ······· ··················· ··················· ···················· ······· ···················· ··· ········································ ··········
······································ ···················· ···················· ···········································································
X. Exercise
Note: Faculty must ensure that every group of students use different input value.
(Use blank space for answers or attach more pages if needed)
1. Write a program to changes the background color when device is shuffled.
2. Write a program to display the list of sensors supported by the mobile device.
·.l,.i,l
i)·....·.(\~i\~~·~·.ii;.:~&.
\l.
i.~:: :ce.~~:~:
~ :~:
::s.:8:u~:
:: ::
:: :: ::
: :
~T.\.ON..- .. .1 ..0.c.C .. = ..~9.(?.TD..~.&.: ........................................................ .
.(\j:,J ...&.)(}.~~·--····bk~.~.€:..N ..- .... O..A-l£:.NT0:T.K:'.lN ................................... .
.. __(j_~J ...E'-.x.TB-0:-...F.u.LL...S .c:.~~f:.N.................................................................... .
Once yo u en ab le the Bl
ge lB on
uc too lh. yo u an gc
t
de dD ev ice s() me tho d.
1t retumS a set of Bl ue
11 list of paired de vic
es ~y calling . \
vm. Re so ur as re qu in d
(Additional)
,
Sr .
Instrument
No . Specification Quantity Re m ar ks
/O bi ed
An dr oid en ab led
.
1 sm art ph on e / An dr oid
ve rsi on su pp or tin g em
2 GB RA M \ Da ta ca bl e is
ma nd ato ry -
IX . Practical related Qu
ula tor
for em ula tor s \
-
Not~: Bdow go~" •r
r fn , SaJllpl~ quf!Slio,u
estions
-
"' a~ su dt 911l!Slio1ts to
l . Na me the me tho ds
~nsur~ tlr~ achiniemrn
wh ich are
fo r nf en nc e. Ta id ta
t ofid~1ttifi~d CO.
us ed to en ab le an d dis
s ..us t dm gn
ab le Bl ue too th ad ap ter
-
2. Ex pl ain the pu rp .
os e of AC TI ON _RE QU
ES T_ DI SC OV ER AB LE Co ns tan
}
3. Li st th e us es of se
tN am e(S tri ng na me)m
eth od .
t.
-
r
r
. . ---} ..... ·····•··· .. ················
... ················
(Space for answers)
········Blue:~.O.tb~~r·t: ··············································-···-···············-·-·
e.~..~.cti.SDh.l.e.{. J....................
...................................
-
t
'\
·AsyncTaskclass.
J. List the basic methods used 10 an (Use '
2. Differentiate between Asyn cTas dSer vices . . ?
k an kes a long tirne to do its
3. Nam e the method used , ifa proce ss ta work .
1 \. V
L) . '.Sp~~•f~~~--'.~~~·i. ".\ ~
. ······· ... .. . . ., >
'I
:: :~:~~~~~~~ :::::
... C)i .) ..GeY.Y..i.c.~.k......a.o ..e. ......dfiStj/!':\~.
d.. :.~....~· ······· ······· ························ ..
=~~"'~~~~ ~~~~~:~
·· ········ ·· ····· ··· ·· ·· ·· ······· ····· ····-· ···· ·· ·· ·······
····· ·· ······· · ·· ····· ·· ···· ······· ······ ·· ··· ··· ···· ·······
·· ····· ······ ······· · ······· ··· ·· ·
··· ······· ··· ·················.. ···· .. ··· ······· ····· ······· ···
···· ······· ···· ······· ······· ······· ······· ····· ·· .........
...... .... ... ... ... .. .... . ... .. .. .
······ ········· ······ ·· ··· ···· ·· ······· ······· ·· ··· ····· ····· ··· ······· · ····
.. ···· ·· ···· ··· ···· ····· · ·· ······· ····-·· ····· ·······
·· · ·
.... ····· ········ ...... .... .... ....... . ... .. ... .. ...... .. .... .. .......
.. ....... . ... ..... ....... .. .. .. ....... ..... .. ...... ....... ...
....... .. . .
.... ....................... .............................. . ... ..... ........
....... ....... .................................. ... ........ ........ .
... ........ ..... ... ..... ........ . .... .... ... ....... . .... ........ .. .........
...... ......................... .............. ... .. .... ...... ...... ...
. . ... ... .... ... ... .... ..
........ ....... ....... ....... ....... ... ........... .. . ........... .......
.... ... ......... ..... ..... ....... ..... .... .. ..... ....... .. ........... .
...... .... ....... . .... ....... .......
....... ..... ... .... ... . ........ . .... ... ...... ... ..... ........ .....
.... ...... .. .. .... ..... ...... .... . ... ....... . ....... . ... ........
... .. ........ . . .. ... .....
using get'J'cxt() and toStrlng() method and match it with the text using equals()
function.
The last thing you need to do is to provide a security mechanism, so that unwanted
attempts should be avoided. For this initialize a variable and on each false attempt,
decrement it. And when it reaches to 0, disable the login button.
·· ·· ••······· ·· ·············· ······ ····· ········· ················· ·· ·· ··· ·· ··· ····· ··················· ···· ····· ····· ·· ·· ···· ······················ ··· ····
:::::;::::~:Ji:~r~~::::::,~::::::::~~J.:::~·.~:·.·,~.;.~·.~·.·.·i.·.~.~·.~·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.
...~ .......J..~:t:\~;.e.t.J.....,.!?.....osed......:\:-.G.... d.J.sf ru;••·~b ... o.ncl ....Ls ..........
..0o~k ...... edl.t;:...ab.!e....'b 1 .....#.\.e. .. o.~e1(;.............................................................. .
......-: ... r~.t;.v,~C. .. W...... C..af'.\. ..))-Eil, ... .. ·O<tte~.... ···Vf F.Ocl~IT,t.~.c.cJ).7
··~·····oo7. ...i.fme. ............................................................................................................. .
(f
\t ~
To receive SMS messages, the besl practice is to use the on Receive() method of the
Broadcast Receiver class. The Android framework sends oul syslem broadcasts of
events such as receiving an SMS message, containing intents thal are meanl to be
received using a Broadcasl Receiver. Your app receives SMS messages by listening
for the SMS RECEIVED ACTION broadcast.
Methods: - -
I ArrayList<S tring> divideMessa ge(Slring texl) :-This method divides a message
text into severaJ fragments, none bigger than the maximum SMS message size.
2 slatic SmsManage r getDefauh() :- This method is used to get the default instance
of the Sms Manager
3 void sendDataMe ssage(String destination Address, String scAddress, short
destinalionP ort, byteQ data, Pendinglnte nl senllntent, Pendinglnte nt
deliverylnle nt):- This method is used to send a dala based SMS to a specific
application port.
4 void sendTextMessage( String dcstinationA ddress, String scAddress, String text,
Pendinglnte nt sentlntent, Pendinglnte nt deliverylnre nt) :-Send a text based SMS.
//fi I
I I
I I lit
I
I ~ 1
11 I