Mobile Application Development 422617)
from Android's official website: hitp/developer.android.com’sdk/index html. If you
are installing SDK on Windows machine, then you will find ainstaller
windows.exe. so just download and run this exe which will launch Android SDK Tool
Setup wizard to suide you throughout the installation, so just follow the instructions
carefully. Finally. you will have Android SDK Tools installed on your machine. If you
are installing SDK cither on Mac OS or Linux. check the instructions provided along
with the downloaded andreid-sdk_rXX-macosx.zip file for Mac OS and android-
sdk_cXXAinwxtzz file for Linux. This tutorial will consider that you are w
setip Your environment on. Windows machine having Windows 7 operating system.
Step 3 ~ Setup Android Development Tools (ADT) Plugin This step will help you in
setting Android Development Tool plugin for Eclipse. Le's start with launching Eclipse
and tien, choose Help > Software Updates > Install New Software. This will display the
following dialogue bos.
Step 4- Create Android Virtual Device to test your Android applications you will
need a virtual Android device. So before we start writing our code. let us create an
Android virtual device. Launch Android AVD Manager using Eclipse menu options
Window > AVD Manager which will launch Android AVD Manager. Use New button
to ereate a new Android Virtual Device and enter the following information, before
clicking Create AVD button.
VIL Resources required (Additional)
Instrument Specifeation ‘Quantity | Remarks
Wbject
IX, Practical related Questions:
Note: Below given are few sanrple questions for reference, Teachers must design
more such questions ta ensare the achievement af identified CO,
1. Listall the steps to install android eperating system
2. List various IDEs that can be used to exccule android operating system,
(Space for answers)
STEP 1: Download Google Android OS.
STEP 2: Write ISO Image File to CD DVD or USB Drive.
STEP 3: Boot Your Computer Using CD DVD or USB Drive
STEP 4; Install or Test Run Google Android in Your Computer
Ans
Android studio Komodo
Eclips Contowo
Intel Idea
Netbeans
Visual Studio
Miharashira State Board of Technical Education 10Mobile Application Development{22617)
from Android's official website: hup://developer android. com’sdk index html, If you
are installing SDK on Windows machine, then you will find ainstaller #XX-
windows.exe. so just download and run this exe which will launch Android SDK Tool
Setup wizand to guide you throughout the installation, so just follow the instructions
carefully. Finally, you will have Android SDK Tools installed on your machine. If you
are installing SDK cither on Mac OS or Linux, check the insiructions provided along
with the downloaded android-sdk_rXN-macosy rip file for Mac OS and android-
sdk_rXXelinuctyz file for Linux. This tutorial will consider that you are going to
setup your environment on Windows machine having Windows 7 operating system.
Step 3 - Setup Android Development Tools (ADT) Plugin This step will help you in
selling Android Development Tool plugin for Eclipse. Let's start with launching Felipse
and then. choose Help> Software Updates > Install New Software, This will display the
following dialogue bo.
Step 4 = Create Android Virtual Device to test your Android applications you will
need a virtual Android device, So before we stat writing our cede. let us create an
Androit virtual device. Launch Android AVD Manager using Eclipse menu options
Window > AVD Manager which will launch Android AVD Manager, Use New button
to create a new Android Virtual Device and enter the following information, before
clicking Create AVD button,
VIL. Resources required (Additional)
Instrument Specification Quantity | Remarks
sObject
TX, Practteal related Questions
Note: Below given ere few sample questions for reference, Teachers must design
more such questions fo ensare the achievement of identified CO.
1. List all the steps to install android operating
2. List various IDEs that can be used io execute ancroid operating system
(Space for answers)
STEP |: Download Google Android OS.
STEP 2: Write ISO Image File ta CD'DVD or USB Drive.
STEP 3: Boot Your Computer Using CD‘DVD or USB Drive.
STEP 4: Install or Test Run Google Android in Your Computer
A
Angroid studio Komodo
Eclipse Contovo:
Intell) Idea
Netbeans
Visual Stadio
“Maharashtra State Board.of Technical EdocationMobile application Development (236
Ne Exercise
Note: Faculey must ensure that every group af students ase differen input value.
(Use blank space for answers or attach more pages if needed)
1, Differentiate between JVM and DVM.
2. What is IDE? Why Java development toolkit is essential to install an
sndroid operating system?
(Space for answers)
Anst
JVM is the virtual machine that runs java code on different platforms, It acts as an
abstract layer between the program and the platform on which the java code is
running, The portability of Java code is possible only because of the SVM. The Ja
comptier converts the source code file(Java Me) into. an intermediate Java
bytecode format which is machine’platform independent
DVM isa virtual machine to execute Android applications. The lava bytecodet.class
file) generated by javac compiler is converted into Dalvk bytecade to make the
applivation source files executable on the DVM. Since Android devises have a
definite processing capacity, memory, and battery life, the DVM design principle
in toad fasily and run smoothly ev
aims to optimize itself'so Ans it
memory powered devices
Ans 2
An IDE. or Integrated Development Environment. enables programmers to consolidate
the different aspects of writing a computer program. IDEs increase programmer
productivity by combining common activities of writing software into a si
application: editing souree code, building executables, and debugging
References / Suggestions far further Reading
1. betps:!'www-twtorialspoint convandroid
2, bttps://stuff.miteda
3, hups:!Avew rutorialspoint.com/android’android_savanced_tutorial pat
4. hhtips:édeveloper android com
XI Assessment Scheme
Performance indicators | Weigntage
Process related (10 Marks) 3%
“1. [ Logic Formation 10%
2 [ Debugging ability 15%
3. | Follow ethical practices Fe
_ Product related (93 Marks) 0%
4. [ntrastive GUL 20%
3_| Answer to Practical related questions 2%
6. | Expected Output 2
7._| Timely Submission 10%
Total (25 Marks) 100%
‘Maharashtra State Board of Technical Education TTANDROID
DEVELOPER
TOOLS
The ADT Bundle includes everything you need to begin developing apps:
1 Android studio + ADT plugin
1 Android SDK Toots Android Platform-toals
1 The latest Android platform
The latest Android system image for the emulator
VIEL. Resources required (Additional)
Sr. | Instrument Specification Quantity | Remarks
Na._| sObject
Practical related Questions
ie: Below given are few sample questions for reference. Teachers must
design more such questions to ensure the achievement of identified CO.
1. List basie requirements for configuring andruid operating system?
2, Why bytecode cannot run in Android?
(Space for answers)
Ans 1
Microsoft Windows 7/8/10 (32-bit or 64-bit)
3. GB RAM minimum, § GB RAM recommended (plus 1 GB for the Androtd Emulator)
2.GB of available disk space mlalmum, 4 GB recommended (500 MB for IDE plus 1.5 GB
for Android SDK and emulator system ima:
1280 x 800 minimum screen resolution,
Ans 2:
‘Android uses Dalvik Virtual Machine (DVM) which requires a special bytecode. We need
toconvert Java class files into Dalvik Executable files using an Android tool called “dx”
In normal eitcumstances. developers wall not be using this tool directly amd build tools will
cate for the generation of DVAI compatible files
Exerchse
Note: Faculty must ensure that every group of students use different input vetue.
(Use blank space for answers or attach more pages if needed)
1, What isa Build Type in Gradle?
2. Explain the build process in Android.
‘Maharashira State Boand of Technical Educ ion 1"Mobile Application Deyslopment {22617}
(Space for answers)
Ans
‘A build type determines how an app is packaged. By default the Android plug-in for Gradle
supports Iwo different types of builds: debug andl relesse, Build types define ceriain properties,
that Gradie uses when building and packaging your app. and sre typically configured for
different stages of your development lifecycle. For example, the debus build type enables
dchug options and signs the APK with the debug key, while the release build type may shrink,
obfuscate, and sign your APK wath a release key for distribution,
Ans 2
‘The build process for a typical Android app module. as shown in figure 1 follows these
sgoneral steps:
1. The compilers convert your source code imto DEX (Dalvik Executable) files
which include the bytecode that runs an Android devices. and everything else into
compiled resources
The APK Packager combines the DEX files and compiled resources into a
APK. Before your app can be installed and deployed ento an Android device,
however, the APE musi be signed.
3. The APK Packager signs your APK using either the debug or release keystore!
a Lf yoware building a debug version of your app. that is, an app you intend only for
testing and profiling. the pac! jens your app with the debug keystore.
Android Studio automatically configures now projects with a debus keystore
b. Ifyou are huilding a release version of your app that you inl
extemally. the packager signs your app with the Felease Key
release keystor ng Your app in android studio,
4. Before generating your final APK. the packazer uses the zipline taal too! te
optimize your app to use less memory When running on a device
ilo release
e. Tocteatea,
XI. References / Suggestions for further Reading
1. hutps:www.tutorialspoint.com android
2. Bitps://stuffmitedu
3. ilps:/www.tutorialspoint.convandk
andrvid_advanced_tutoria| pdf
4. hitps:rideveloper android com
Assessment Scheme
Performance indicators ‘Welghtage
Process related (10 Marks) 30%
gic Fomalion
bugging ability
~ rae ellucal prachces
Product related (I= Marks)
| Interactive GUI
Answer to Practical related questions 20%
$1 Expected Ourput 2 e
7. | Timely Submission TH
| Total (25 Marks) —_ 00% |
‘Maharashtra Stale Hoard of Techaisal EducationMobile Application Development (226 17)
IX. Practical related Questions
Notes Below given are few sample questions for reference. Teackers must
design more such questions fo ensure the achievement of identified CO.
1. Listthe files used to write Hello World progeam.
2. What is an activity in Android programming?
(Space for answers)
Ans
1. The Main Activity File
The main activity code is a Java file MainActivity java, This is the actual
application file which ultimately gets converted to-a Dalvik executable and runs
your application,
2. The Manifest File
Whatever component you develop as a part of your application, you must declare all
its components in a manifestxml which resides at the root of the application project
directory. This file works as an interface between Android OS and your application.
then it will not be considered by
so if you do not declare your component in this 1
the OS.
3. The Strings File
‘The strings.xmt file is located in the res'values folder and it contains all the text that
. the names of buttons, labels, default text, amd
textual
your application uses, For exam!
similar types of strings go into this file, This file is responsible foe U
content,
4. The Layout File
The activity_main.xmt is a layout file available in res‘layout directory, that is,
referenced by your application when building its interface. You will modify this file
very frequently to change the layaut af your application
Ans 2
An activity is the single screen in android, It is like window or frame of Java, By
ivity. you can place all your UL components or widgets in a single sereen
method of Activity describes how activity will behave at different states.
the help of a
The 7 lifee
Exercise
Note: Faculty must ensure that every group of students use different input wahec,
(Use blank space for answers or attach more pages if needed)
1. Write. program to display HelloWortd
2. Write a program to display student name and marks.
{Space for answers)
‘Ans |:
1.0" encoding="UIe-S">
>
TableLayout
IName: Heet ; Marks: 96
Name: Meet ; Marks: 97
Name: Pratik ; Marks: 99
Name: Shaun ; Marks: 91
Name: Naman ; Marks: 97
Name: Hisbaan ; Marks: 92
“Milarashira Siac Bose of Techaisal Educatoa‘Mobile Application Development4226 17)
Linear Layout: -
nex t2you
YIIL. Resources required (Additional)
Tustrument ‘Specification | Quantity Remarks
fObject
Android enabled 2GBRAM T Data eable is.
smartphone / Android mandatory for
! version supporting emulators
emulator
IX. Practical related Questions
Note: Befow given are few sample questions for reference. Teachers must
design more such questions to ensure the achievement of identified CO.
1. Name any three-layout manager?
2. What isCard View?
Ans. 1,
1. Linear Layout
LinearLayout is a view group that aligns all children in a single direction, vertieally or
horizontally.
2. Relative Layout
RelativeLayout is a view group that displays child views in relative positions.
3. Table Layout
TableLayout is a view that groups views into rows and columns.
Ans. 2
CardView isa new widget in Android that can be used to display any sort of data by
providing a rounded corner layout along with a specific elevation. CardView is the view
that san display views on top of each other. The main usage of CardView is tha it helps to
givearich feel andlook tothe UL design
‘Makarachira Slate Board of Techancal Education %Mobil Application Development422617b
x.
Exercise
Note: Faculty aust 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 place Name. Age and mobile number linearly
(Vertical) on the display screen using Linear layout
Write a program to place Name, Age and mobile number centrally on
the display sercen using Absolute layout
(Space for answers)
1.0” encoding="utf-8"2>
aintlayout widget. ConstraintLayout
xmlos:android="htip: schemss android cony/apk‘tes/android”
sxmlns:app="hutp:!/schemas android, com‘apkires-auto"
sxmnins:tools="bttp:/‘schens android, comlools"
android:layent_widh="match_ parent”
android:layout_height="match_parent
tools:context=" MainActivity">
tools
"28dp"
android tewt="Name"
android textColor="
android textSize
androidtextStyle="bold" >
TetView
android:id="\a tid text View2”
android: oyout_widhh="170dp"
android layout_height-"wrap_content™
android Jayout_column="2"
iarachra Sats Board of Techical Edvcation Fr‘Mobile Application Development (22617)
androdlskiyout_gravity="center™
andro panting Pop "2Sdp
aindroad paling Bottom="3Sdp"
androaltext-"AGE”
android:textCalor=" Te 3"
android:textSizo="30sp”
android:textStyle="bold” />
le!
senter™
"GtiebtentVie
andsoid layout_vvidth
android layout_heigh
android:lay
andzid te
android textColor="4 1936"
android textSize"305p"
android textSty le="bold” >
Slandroids.constiaintleyout widget ConstrsintLayout™
Saharachtra Stas Hoand of Technical EducationMobile Application Develapment{22617)
otra) |
BOOLEAN
XI. References / Suggestions for further Reading
1. hntps://www.tutorialspoint.com/android
2. hitps://stuff-miteda
3
Mlps:/-www.tutorialspoint.com/android android_advanced_tutorial pdf
4. hilps:{ideveloper.android.com
XID, Assessment Scheme
ang ability
Ferformance Indicators ‘Weightage
Process related (10 Marks) 30%
Togie Formation 10%
Debu:; 15%
Follow ethical practices
Waharhira State Hownd of Technvcal Education
wMobile Application Dev clopment (22617)
IN. — Pruetteal related Questions
Note: Betow given are few sample questions for reference. Teachers must
design more such questions to ensire the achievement of identified CO,
1. Which of these ts not defined as.a process state?
a. Nonsvisible
b. Visible
ce. Foreground
d, Background!
What is the name of the folder that contains the R.java file?
a ste
bes
©. bin
@. gen
Ans |
Non-visible is nol defined as a process state
Ans
the name of the Foldor that contains dhe R java file is Gen,
Exercise
Note: Faculty must ensure that every group ofstudeats use different input values
(Use blank space for answers or attach more pazes if needed)
1. Write a program to accept username and password from the end user using Text
View and Edit Text.
2. Write a program to accept and display personal information of the student.
Ang!
pk’ rewandoid™
rl oto"
(a~id toggle’
android:layoul_width="1 85dp”
android-layout_height"wrap_content
android: layout_centerlorizontal="tu
android layout_margin!orizontal="1
30dp”
android
android-drawables
elector”
android textOff="Bluetoolls OFF"
android textOn="TBluetoath ON" />
Java Code
package com example togglebutton;
import
androids appcompat app. AppCompatActiv
ity
import android os Bundle;
import android view. View,
import android widget ImageView;
import android widget. TogaleBulton:
Public class Main Activity extends
AppCompatActivity {
ToggleButton toggleButtan;
ImageView imageView:
@ Override
protected void enCreate(Bundle
sawedInstanceState) {
super.onCreate(savedinstanceState);
seiContentView (Rlayout activity_ma
ink:“Mobile Applicatinn Dey clopment (32617),
to; ndViewByldtRid tog
ley :
imiageWiew=find View ByldR td imag
eviews
image Vjew setImagePrawable(getRe
sources|}etDravabletFe drawable Bhuet0o ij
th_off)} e(getResourcesty
bluetooth _ off):
toggleButton setOnClickListenerinew
‘View OnClickListenert) | 1
‘a Override i
public void onClick(View W)t '
if (toggleButton isCheckedt)) '
Toegleguthen toggle buttons
Miahorsshita Sais Ioaad of Techaveal EdocatiaMobile Application Development (22617)
‘Ans 2,
ML cade
encoding "UPS">
android-layout_width="match_parent
android tayout_beight-"match_parent
horizontal">
idcbin_1”
android layeut_widkh="wrap_conte
att
android:layout_hei ght="wrap_ cont
ent”
android Tayout_atigaP arent eft="tr
we
android:layout_alignParertStart="t
androwd tayoul_below=" +id ed Te
android Layout_marginTop="60Xp"
andraid:text="1"
android:textSize="18q
‘d:btn_4”
oul_width="wrap_conte
at”
android:layout_height="wrap_cont
ent”
android:layout_atignLefl="fajrid bt
ar
android:layout_alignStart="(a+id'b
mir
androidayout_below="rid bin_
\n
android:text="4"
android:textSize=" 18sp" (>
“Maharashtra Stale Board of Techaical Education
~Butwoa
android: 2
android layout_width-*wrap_ conte
al"
android:layout_height="wrap_cont
nt"
android: layout_alignBasstine="a+
Addie"
android layout_alignBoitom="@+i
bint”
android: layout toEndOF="{ai~id'bt
ae
© android layout_toRightOf= "Ga! Hid!
bin"
android:text="2"
androiditextSize="I 8sp" >
>
@android:colo
mr
android: layout_height="wrap._cont
vent”
android-hayout_below="@:tid'bin_
android:layout_toRightOf
android back groundTint
d:eolortholo_green light"
android:text="="
ribackground,
android:textSize="I sp" >
Mul" «Button
android ayout_alignStart= android:id="@+id'bin_des”
tm Mul" android layout_width"wrap conte
android:layout_below= a
” android:layout_height="wrap_cont
android:backs ent”
éccolor darker g android:tayout_below="@-id bin_
androndtex"" 7
android.textColor="@ android:colo android-layout_toLefiOf="(a+id'bt
ribackground_light” as"
androi:textSize="1Xsp" f> android:layout toStanOF"@ +idbt
ns"
android layout_widih—"wrap_conte
a
Java Code
package com. example exp 2;
import
androide appeompat.apip.AppCompatActiv
ity
import android.os Bundle;
jmport android view, View:
import android wid get. Bution:
import android, widset EditTevt;
public class Main Activity extends
AppCompatctivity {
Button
bin_I.bin_2Jbin_3.bin_d.bta_S.bin_6.bin
Fhin_S.bin_9,bin_Obin_Add-bin_Sub.bia
_Mul-bta_Diy,btn_c:
EuitTest edl;
float Value, Val
boolean m.Addition, mSub tract,
mMultiplication, mDivision ;
(a Override
protected void onCreater Bundle
savedinstanceSiate) {
superonCreatet savedlnstanceState };
seiContentView(
Rulayout activity_main i
bin_O= (Button)
findView Byld Rid. btn_Oy;
bin [= (Button)
findViewylR id btn_1),
bin 2 (Button)
fin ow yA id btn 2
(Button)
fndViosBy Gnd Be 3);
bin 4 = (Butlon)
find View BylRad btn 4}:
bin_$ = (Button)
Find View By Tdi btn_S
bin_6= (Button)
find ViewByldl cd btn_8
bin 7 (Button)
findViewBs MR id btn_7);
bin 8” (Button)
find Vien By di Rad bin 8)
ban 0 (Button)
findViewByhliR.l.btn_9):
bin Add ution
findView yl di Rid. ben_Add),
bin_Div = (Burton
Find View BsLaeR id bin Div},
bia Sip ~ (Butiony
FindViewBiy fii ad btn_ Sub}:
bta_Mal=(Buttom
findViewBylal Riu btn_Mul}:
bin ale ~ (Button)
FindViowBylaiR id btn_calers
bin_ dec = (Buon)
fFindViewByldiR id Btn_ dee};
bin_clear= (Button)
findView Hy {iR id. btn_clear);
dl = (EditTexty
findViewBVLIR al edTextd)
bin_0 setOnClickListenes{new
View.OnClickListener() |
i@Override
Public veid onClick View ¥) {
ed setTextiod | gotText}"0");
bin_l.sctOnClickListener(new
View OnClickListenen() {
@Override
public void onClick( View ¥) {
ed] setText(ed].getText(}+"1"):
btn_2.setOnClickListenerinew
View OnClickListenes() |
@Override
Public void onClick View ¥) |
edL.sotTont(ed | getTent(}+"2"):
ny
bin_3 setOnClickListenerinew
View.OnClickListenen() {
@ Override
public void onClick( View v) {
edl setText(ed].geText(}}"3");
aMobile Application Development (226178
bin_4.setOnClickListenerinew
View OnClichListenert)
fw Override
public void on€heki View v) {
ed] setTert(ed | getText(}+"4"),
btn_S.setOnClickL istenar(new
View.OnClickListenert 1
@ Override
public void ont lick(View v) |
ed] sotTextied _getText(}+"5");
bin_6 setOnClickListenerinew
‘View. OnClickListenert) {
@ Override
public void onClick(View v) {
ed | setText(ed |_getText(}+"6"):
nm
bin_T.setOnClickListener(new
View.OnClickListener() {
@ Override
public void ontlick(View v) {
ed | seiText(ed |.getText()+"7"):
bin_8.setOnClickListener(new
View. OnClickListenert) |
@Overide
public void on€ lick{View v) |
ed | seiText(ed I_getText{}+"8");
bta_A.setOnClickListener(new
View OnChekL istener() |
f@ Override
public void an lick(Wiew v) {
ed | seiText(od |-getTextt)+"9"),
}
bin_dee.selOnClickListenee! new
View OnClickListoner() |
(a Override
Maharashtra Stale Boord of Technical Education
public void onClick( View ¥ {
‘edd setTextiedl getTest(}#+"-
bin_Add setOaClickListeneninew
jew OnClickListenent
@Overnde
public void onClick View ¥) |
if(ed! =nullyy
edi setText(
false |
Valuel =
Float parseFloat(ed | getText() +
mAddition = true;
edl setText(mull)
bin_SubsetOnClickListenertnew
View. OnClickListener{) {
4 Override
public void enClick{ View ¥) {
Valuel
Float parseFlostiedl.getTextt)
mSubtract = true
ed | secTextinullt
bin_Mul setOnClickListenennew
View. OaClickListener() {
@ Override
public void onClick( View v) {
Valuel =
Float parseFlaat( ed |_getText() +"
mMultiplication = tru
ed] sotText(nul
bin Div.seiOnClick
iew.OnClickListenest) |
fa Override
public void onClick View v) §
Valuel
Float parseFlant( ed geiTewit)*
mDivision = true 5
ed setTextinull)
ner(newMobile Application Development (22817)
Bin_cale setOnClckListencr new
‘View, OnClichE istenen() {
(Override
public Void oaCck(View 9) |
Vatue2
Float parsefloa
cul gelText) +"
if (mAddition = true)}
ed .sotTexy{ Valuel + Value? }
any,
mAddition=false:
i bin_clearsetOnClickL istener( new
View OnClickListerey() |
@Overnde
nied} public void onClick(View w) {
atuel = Value? el sotT
if(mSubtract
edl.setTev
mSubtraet=False: YD:
if (mMultiplication — true) !
ed setTeet(Vatuel * Value?
Maharastra Stale Board of Technical Education 65‘Mobile Application Development(22617)
‘VIL. Resources required (Additional)
1.
2
1
package com.example.exp10_1;
Sr. Instrument Specification Quantity Remarks
No. ‘Object
Android — enabled 2GBRAM 1 ‘Data cable is
smartphone / Android mandatory for
‘version supporting emulators
emulator
Practical related Questions
Note: Betow given are few sample questions for reference. Teachers must
design more such questions to ensure the achievement of identified CO.
1. Name the file in which respective XML components ean be added.
2. Listall the Ul components which can be used to develop login window.
{Space for answers)
xml file in android. The AndroidManifest. xml file contains information.
of your package, including components of the application such as
activities, services, broadcast receivers, content providers ete.
Ul components used to develop login window are as follows:
i. TextView
ii, EditText.
iii, Button.
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 create a fogin form for a social networking site
2. Write a program to create a login form for student registration system
(Space for answers)
import android.view.Views
import android.widget.Button:
import android.widget.EditTex
import import android.widget. Toast;
andre
mpatActivit
\x-appcompat.app.AppCo import
android.widget. Toggle Button:
import android.content.Intent;
import android.os. Bundle: import android.os.Bundle;
‘Maharashtra Stale Board of Techaieal Education 6y extends
public class MainActi
AppCompatActivity {
EditText username;
String Username;
Button login;
@ Override
protected void onCreate(Bundle
savedinstanceState) {
super.onCreate(savedInstanceStat
eh
setContentView (R.layout.a
main);
username=findView Byld(Rild.Use
rame_ ET);
login=findView Byld(R.id.Login);
login.setOnClickListener(new
View. OnClickListener()
{
@Override
public vaid onClick(View
yt
Username=username.getText().toS
tring():
Toast.amakeText(MainActivity.this
Welcome
"+Username.Toast.LENGTH_SH
ORT} show);
Intent intent=new
Intent(MainActivity.this,Empty_A
etivityselass):
"
intent.putExtra("username",User
name);
startActivity(imtent);
d
De
yout_height="match_p
sTeatView
android:layout_width="wrap_con
tent"
Jayout_height="wrap_co
android:text="Name"
android:layout_marginTop=" 40d
Pp"
android tayout_centerHorizontal=
“true”
android:textSize="20dp"
bp
pas
ast
We
ita” ate
andre" 4d Nee*
nbd pcheen
i" snip
‘aliasStuoite Appussti ev euuponent (22041)
tent”
android:layout_height="wwrap_co
mtent™
androiditext="Name"
android:layout_marginTop="40d
p"
android:layout_centerHorizontal=
“true”
android:textSize="20dp"
Pb
Java File:
package com.example.exp10_2;
import
androidx.appcompat.app-AppCo
mpatActivity;
import android.eontent.Intent;
import android.os.Bundle:
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android. widget,Toast;
import
android.widget, ToggleButton;
import android.os.Bundle;
public class Main Activity extends
AppCompat.Activity {
EditText
name_ctaage_ct.branch_etscm_et
String
Username, Age, Branch Semester;
Button login:
@ Override
protected void onCreate(Bundle
savedInstanceState) {
super.onCreate(savedinstanceStat
©
setContentView( Rlayout.activity_
main);
name_et™findViewByld(R.id.Nam
ce ET)
age_ct=findViewByld(R.id.Age_E
T):
=findViewByld(R.id.Login):
login.sctOnClickListener(new
View.OnClickListener()
{
(@Override
public void onClick(View
wt
Username=name_et.getText().toSt
ring0)s
Age=age_et.getText().toString():
Branch=branch_et.getText().toStr
ing();
Semester=sem_et.getText().toStrin
203
Toast.makeText(MainActivity. this
"Welcome "+Username
Toast. LENGTH_SHORT).show()
Toast.makeText(MainActivity.this
Age "4
oast. LENGTH_SHORT).show(),
‘Muharashira State Buanl of Tecbnival Education
76Mobile Application Development (22017)
Toast.makeText(MainActivitythis
."Branch "+Branch
sToast. LENGTH_SHORT).show()
Toast.makeText(MainActivity.this
»"Semester "+Semester
TH_SHORT).show()
Intent intent=new
Student Login
Name
Semester
I Fdacation
Maharashtra State Board of Techni
Intent(Main Activity.thisxEmpty_A
ctivity.class);
w
Intent.putExtra("nsername" User
start Activity (intent);Mobile Apptication Development (226171
IW.
vi
VIL
Practical No, 1:
: Develop a program to implement Radio Button and
Radio Group.
Practical Significance
Radio Buttons are used when we need to selzet only one item fram a list of
Presented items, If Radio Buttons arein Radio Group. when ane Radio Button
within a group is selected, all others are automatically deselected!
Relevant Program Outcomes (POs)
PO2. Discipline knowledge
PO 3. Experiments and practice
PO 4. Engi
ing tools
Competency and Practical Skills
‘Create simple Android applications.”
This practical is expected to develop the following skills
1. Able to develop an application using Radio Button and Radio Group controls.
Relevant Course Outcame(s)
1. Develop rich user Interfaces by using layouts and controls.
2, Use User Interface components for android applica
on development
Practical Outcomes (PrOs)
Use Develop a program to implement Radio Button and Radio Group.
Relevant Affective Domain Related Outeomets)
1. Work collaboratively in team
Follow ethical practices
Minimum Theoretical Background
Radio Button is generally used with Radio Group. Radio Group is a set of radio buttons,
marking one radio button as checked makes all ather radio buttans as unchecked, A
adio button consists of two states — checked and unchecked. Clickingan unchecked
button changes its state to “checked” state and “unchecked” for the previously selected
radio button, To toggle a checked state to unchecked slate, weneed to choose another
item,
Following are the important attributes related to Radio Group control
|. androld:checked Button : This is the id of child radio button that should be
checked by default within this radio group.
2. androtd:ortentation ; This property om the Radio group defines the orientation to
Position its child view consisting of Radio Buttons
Following are the few methods of radia button:
1. eheck(dy This sets the selection to the radio button whose identifier is passed in
parameter, -I is used as the selection identifier to clear the selection,
2. learCheck() : It clears the selection, When the selection is cleared, ne taco
bution in this group is selected and getCheckedRadioButtonld() retums mull
3. getCheckedRadtoButtontd() : It rcturns the identifier of the selected ratio button
in this group. If its empty selection, the returned value is-1.
Maharashira Stale Boardof Technical Education 7Mobile Application Development (220171
AL setOnCheckedChangeistener() = This registers a callback to be invoked when the
checked radio button changes in this group. We must supply instance of Radio Group,
OnCheckedChangeL istener to set OnCheckedhangeListenen method
Gone RadioButton
= Fong ston
Bi tmepetumen
Dinageien
Pregeter Reg)
= Propet Meal
VILL Resources used (Additional)
Sr Tostrument ‘Specification | Quantity Remarks
rObject
Andro enable 2 GB RAM T Data cables
mandatory for
emulators
smartphone / Android
1 version supporting
emulator
AX. Practical related Questions
Note: Below given are fen sample questions for reference. Teachers mustdesign
such questions to ensure the achievement of identified CO.
Write xml tag to create a Radio button,
Write the purpose of Radio Button
List different methods of Radio Button
(Space for answers)
@+id/radio_pirates™
\wrap_content”
android:text
android:onClick:
2. Radio buttons allow the user to select one option from a set. You should use radio
buttons for optional sets that are mutually exclusiye if you think that the user needs
to see all available options si
‘Maharashtra State Board of Technical Education: 0Mobile Applic
Development {22617}
3. Methods of Radio Button
i.isCheekedt)
ii, setChecked()
iil. getText()
iv. setText()
Exercise
Note: Faculty must ensure that every group of sindcats use different examptes
(Use blank space for answers or attach more pages ifneeded?
1. Write a program to show the Following output. First two radio butions are without
Using tadio group and next (wo radio buttons are using radio group. Note
at
Cte roe
(Omeo enon
© te
‘Mabarashica Stats Bound of TesBnich] Fdueation aMobile Application Develop ment (22617
(Space for answers)
Ans 1.
XML Code:
‘
-
va Code:
androld:tay out_marginTop="
28dp" package com.exampleexph3s
o
«RadioButton Import
androlds.sppeompatapp.App
androld:td="@ Hd/male"™ Compat Activity:
androld:layout_widt Import andrald.os.Bundk
content” Import androld.stew News
7 Import
andrald.idget.Button;
content” Import
~ androta:tex andrald.wldget Radloltattons
import
andrald.widget.RadloGroup;
Import androtdavidpet.Tanst;
rnilooks"
androidi:layout_width="match_parent®
android:tayout_height="match_parent™
toofs content=" Mann Aetisity">
Button
android id=" +id’binDownloadFile™
android tayoul_wadth="wrap_content
android:layout_height="wrap_content
android:text="Download File"
android:layout_centerlaParent="truc"
<
Maharanhtew State Rosrdof Techateal Education
JAVA CODE
package com example progrogress
import
androidy.appeompat app AppCompatActiv
ity:
import androidapp ProgressDial
import android os Bundle
import android siew: View,
import android widget. Butlon;
import andrond os Bundle:
public class Main Activity extends
AppCompatActivity {
Button binDowaloadFile:
ProgressDialog progressDialog:
Override
protected void onCreate( Bundle
savedlnstanceSiate) {
super onCreatetsavedlnstanceState)
@Motite Anplicainn Development ¢22607)
serContentView(R layout activty_ma
ing
binDowaloadFile =
fndVicwBy Miri il binDownloadFile);
tinDiownlaadFile setOnClickListener
{now View. OnChiekListenert) {
G@ Override
public sord onCich¢View ¥) {
ProgressPialog = new
ProgressDisfog (MainActivity this)
penigressDialog setProgressStylo(
Progressialog STYLE, HORIZONTAL.
Pr
Downloading’
progressDialog setProgress(100)
‘Thread t= new Threadinew
Runnable) {
a Override
public void run() {
int progres
OUTPUT
Fite Downieeaing
DOoe2hBV GAS E
‘while (progress <=100),
uy
ressDialog.setPro
fs
srs progress
thea sleep 200)
yeatch (Exception eu)t
J oan Buy ARIA
‘Maharashica State Board of Fechaical EducationMobile Apptication Development
W.
vL
Practical No. 1
: Develop a program to implement List View, Grid
View, Image View and Scroll View.
Practical Significance
A View occupies a rectangular area on the screen and is responsible for drawing
event handling. View is the base class for widgets, which are used to ereate intera
Ul components (buttons text fields, etc.), The View Group subclass is the base class for
layouts. which are invisible containers that hold other Views {or other ViewGroups) and.
define their Layout properties.
Relevant Program Outcomes (POs)
PG 1. Basic knowledge
PO 2. Discipline knowledge
PO 3. Experiments and pesetice
PO 4. Engincorin
Competency and Skills
“Create simple Android applications.”
This practical is expected to develop the following skills
Able to develop an application using list view
Able to develop an application using grid view
Able ta davelop an application using image view
Able to develop an application using scroll view
Relevant Course Outcome(s)
1. Develop rich user Interfaces by usin
2. Use User Interface components for android application development.
Practical Outcome (PrOs)
Develop a program to implement List View, Grid View, Image View and Seroll View,
Relevant Affective Domain Related Outcomes)
1. Work collaboratively in team.
2. Follow ethical practices
Minimum Theoretleal Background
List View
List of scrotlable items ean be displayed in Android using List View. It helps you to
Gisplaying the data in the form of a scrollable list, Users can then select any list item by
clicking on il. List View is default scrollable so we do not need to use scroll View or
se with List V
ow is widely used in android applications. A very commen example of List View
is your phone contact book. where you have a list of your contasts displayed in aList
‘View and if you click on it then user information is displayed,
ashita State Board of Technical Fducation| e