SlideShare a Scribd company logo
Mobile Application Development
1
Course teacher: Mr Kiran Khandarkar,
Assistant Professor in CSE Department.
2
Course Outcomes
ESC155: Mobile Application Development
ESC255: Lab-III: Mobile Application Development
 CO1: Explain Android Ecosystem and features of android operating system (II Understand)
 CO2: Configure Android environment and development tools. (III Apply)
 CO3: Use different layouts and control flow for designing User interface. (III Apply)
 CO4: Design user interface using different UI Components of Android. (III Apply)
 CO5: Demonstrate different lifecycles in Android. (III Apply)
 CO6: Illustrate process of publishing an android app on google play store. (III Apply)
• UNIT-IV: Text View, Edit Text, Button, Image Button, Radio Button and
Radio Group, Progress Bar, Image View
Textbooks/ Reference Books :
1. Composing Mobile Apps , by Anubhav Pradhan, Anil V Deshpande, Wiley
Publication.
2. Android App Development for Dummies , Michael Burton , Wiley
Publication.
3. Android Programming for Beginners , John Horton , Packt Publishing.
3
4
• The Basic building block for user interface is a View object which is created
from the View class and occupies a rectangular area on the screen.
• View referes to Android.view class , which is the super class for all the GUI
Components like Textview, ImageView, Button etc.
Views are divided into following categories,
Basic Views: it contain Commonly used view such as Textview,EditText, Button
views
Picker Views: It has views which enable users to select from list like Datepicker,
Timepicker.
ListView : It has views like ListView and Spinner Views.
5
6
Most Commonly Used Android View classes:
These views can be used to create a useful input and output fields.
•Text View
•EditText
•Button
•ImageView
•ImageButton
•CheckBox
•Radio button
•RadioGroup
•ListView
•Spinner
•AutoCompleteTextView
7
Image view:
Image view helps to display images in an android application.
Any image can be selected, we just have to paste our image in a
drawable folder from where we can access it.
For example: In below Code “@drawable/ic_laucher” has been
taken.
8
XML coding of Image view:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="center_horizontal" >
<ImageView
android:id="@+id/myimageview"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="20dp"
android:gravity="center"
android:padding="10dp"
android:src="@drawable/ic_launcher" />
9
Check Box:
Checkbox is used in that applications where we have to select
one option from multiple provided. Checkbox is mainly used
when 2 or more options are present.
10
XML coding of checkbox:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<CheckBox
android:id="@+id/checkBox1"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:text="Formget."
android:checked="true" />
<CheckBox
android:id="@+id/checkBox2"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:text="Mailget." />
</LinearLayout>
11
Radio Button:
Radio button is like checkbox, but there is slight difference between them.
Radio button is a two-states button that can be either checked or
unchecked.
12
XML coding of Radio Button:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="center_horizontal" >
<RadioButton
android:id="@+id/radioButton1"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:text="Formget"
android:checked="true" />
<RadioButton
android:id="@+id/radioButton1"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:text="Mailget" />
</LinearLayout>
13
14
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RadioGroup android:id="@+id/radioSex"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<RadioButton android:id="@+id/radioMale"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/radio_male"
android:checked="true" />
<RadioButton android:id="@+id/radioFemale"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="@string/radio_female" />
</RadioGroup>
<Button android:id="@+id/btnDisplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/btn_display" />
</LinearLayout>
15
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Toast;
public class MyAndroidAppActivity extends Activity { private RadioGroup
radioSexGroup;
private RadioButton radioSexButton;
private Button btnDisplay;
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
addListenerOnButton(); }
public void addListenerOnButton() {
radioSexGroup = (RadioGroup) findViewById(R.id.radioSex);
btnDisplay = (Button) findViewById(R.id.btnDisplay);
16
btnDisplay.setOnClickListener(new OnClickListener( )
{ @Override public void onClick(View v)
{ // get selected radio button from radioGroup
int selectedId = radioSexGroup.getCheckedRadioButtonId();
// find the radiobutton by returned id
radioSexButton = (RadioButton) findViewById(selectedId);
Toast.makeText(MyAndroidAppActivity.this, radioSexButton.getText(),
Toast.LENGTH_SHORT).show();
}
});
}
}
17
18
19
Image Button View:
Image button is a button but it carries an image on it. We can put
an image or a certain text on it and when we click it provides the
operations assigned to it.
20
Syntax For Image Button In XML Coding Is:
XML coding of Image button:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/ic_launcher" />
</LinearLayout>
21
Attribute Description
android:text Used to specify the text to be
displayed in the TextView
android:textSize Using this attribute we can control
the size of the text.
android:textColor Using this attribute we can specify
the color of our text.
android:textAllCaps If set True, this will make the text
appear in upper case.
android:letterSpacing Using this attribute we can set the
spacing between
TextView is the most widely used view used to show pre-defined text on display screen.
22
Code for Progress Bar
23
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
<ProgressBar
android:id="@+id/simpleProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_centerHorizontal="true"/>
<Button
android:id="@+id/startButton"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:text="Start"
android:textSize="20sp"
android:textStyle="bold"
android:layout_centerHorizontal="true"
android:layout_marginTop="100dp"
android:padding="10dp"
android:background="#0f0"
android:textColor="#fff"/>
</RelativeLayout>
24
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// initiate progress bar and start button
final ProgressBar simpleProgressBar = (ProgressBar) findViewById(R.id.simpleProgressBar);
Button startButton = (Button) findViewById(R.id.startButton);
// perform click event on button
startButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// visible the progress bar
simpleProgressBar.setVisibility(View.VISIBLE);
}
});
}
}
25

More Related Content

Similar to Notes Unit4.pptx

Mobile Application Development-Designing User Interface With View
Mobile Application Development-Designing User Interface With ViewMobile Application Development-Designing User Interface With View
Mobile Application Development-Designing User Interface With View
Chandrakant Divate
 
CS6611 Mobile Application Development Lab Manual-2018-19
CS6611 Mobile Application Development Lab Manual-2018-19CS6611 Mobile Application Development Lab Manual-2018-19
CS6611 Mobile Application Development Lab Manual-2018-19
Gobinath Subramaniam
 
Ap quiz app
Ap quiz appAp quiz app
Ap quiz app
angelicaurio
 
Android app development
Android app developmentAndroid app development
Android app development
Vara Prasad Kanakam
 
Chapter 10 - Views Part 2
Chapter 10 - Views Part 2Chapter 10 - Views Part 2
Chapter 10 - Views Part 2
Sittiphol Phanvilai
 
COIT20270 Application Development for Mobile PlatformsWeek 4.docx
COIT20270 Application Development for Mobile PlatformsWeek 4.docxCOIT20270 Application Development for Mobile PlatformsWeek 4.docx
COIT20270 Application Development for Mobile PlatformsWeek 4.docx
mary772
 
Notes Unit3.pptx
Notes Unit3.pptxNotes Unit3.pptx
Notes Unit3.pptx
MIT Autonomous Aurangabad
 
Android Tutorial For Beginners Part-1
Android Tutorial For Beginners Part-1Android Tutorial For Beginners Part-1
Android Tutorial For Beginners Part-1
Amit Saxena
 
Get an Android tutorial for beginners
Get an Android tutorial for beginnersGet an Android tutorial for beginners
Get an Android tutorial for beginners
JavaTpoint.Com
 
Android App development III
Android App development IIIAndroid App development III
Android App development III
Thenraja Vettivelraj
 
Android User Interface: Basic Form Widgets
Android User Interface: Basic Form WidgetsAndroid User Interface: Basic Form Widgets
Android User Interface: Basic Form WidgetsAhsanul Karim
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI WidgetsAhsanul Karim
 
Day 5: Android User Interface [View Widgets]
Day 5: Android User Interface [View Widgets]Day 5: Android User Interface [View Widgets]
Day 5: Android User Interface [View Widgets]Ahsanul Karim
 
Android Tutorials : Basic widgets
Android Tutorials : Basic widgetsAndroid Tutorials : Basic widgets
Android Tutorials : Basic widgets
Prajyot Mainkar
 
01 09 - graphical user interface - basic widgets
01  09 - graphical user interface - basic widgets01  09 - graphical user interface - basic widgets
01 09 - graphical user interface - basic widgets
Siva Kumar reddy Vasipally
 
Holland9 Android Workshop Hogeschool Rotterdam
Holland9 Android Workshop Hogeschool RotterdamHolland9 Android Workshop Hogeschool Rotterdam
Holland9 Android Workshop Hogeschool Rotterdam
J B
 
Android
AndroidAndroid
Android
Sai Kiran
 
What is Android?
What is Android?What is Android?
What is Android?
ndalban
 
Android apps development
Android apps developmentAndroid apps development
Android apps development
Monir Zzaman
 

Similar to Notes Unit4.pptx (20)

Android
AndroidAndroid
Android
 
Mobile Application Development-Designing User Interface With View
Mobile Application Development-Designing User Interface With ViewMobile Application Development-Designing User Interface With View
Mobile Application Development-Designing User Interface With View
 
CS6611 Mobile Application Development Lab Manual-2018-19
CS6611 Mobile Application Development Lab Manual-2018-19CS6611 Mobile Application Development Lab Manual-2018-19
CS6611 Mobile Application Development Lab Manual-2018-19
 
Ap quiz app
Ap quiz appAp quiz app
Ap quiz app
 
Android app development
Android app developmentAndroid app development
Android app development
 
Chapter 10 - Views Part 2
Chapter 10 - Views Part 2Chapter 10 - Views Part 2
Chapter 10 - Views Part 2
 
COIT20270 Application Development for Mobile PlatformsWeek 4.docx
COIT20270 Application Development for Mobile PlatformsWeek 4.docxCOIT20270 Application Development for Mobile PlatformsWeek 4.docx
COIT20270 Application Development for Mobile PlatformsWeek 4.docx
 
Notes Unit3.pptx
Notes Unit3.pptxNotes Unit3.pptx
Notes Unit3.pptx
 
Android Tutorial For Beginners Part-1
Android Tutorial For Beginners Part-1Android Tutorial For Beginners Part-1
Android Tutorial For Beginners Part-1
 
Get an Android tutorial for beginners
Get an Android tutorial for beginnersGet an Android tutorial for beginners
Get an Android tutorial for beginners
 
Android App development III
Android App development IIIAndroid App development III
Android App development III
 
Android User Interface: Basic Form Widgets
Android User Interface: Basic Form WidgetsAndroid User Interface: Basic Form Widgets
Android User Interface: Basic Form Widgets
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI Widgets
 
Day 5: Android User Interface [View Widgets]
Day 5: Android User Interface [View Widgets]Day 5: Android User Interface [View Widgets]
Day 5: Android User Interface [View Widgets]
 
Android Tutorials : Basic widgets
Android Tutorials : Basic widgetsAndroid Tutorials : Basic widgets
Android Tutorials : Basic widgets
 
01 09 - graphical user interface - basic widgets
01  09 - graphical user interface - basic widgets01  09 - graphical user interface - basic widgets
01 09 - graphical user interface - basic widgets
 
Holland9 Android Workshop Hogeschool Rotterdam
Holland9 Android Workshop Hogeschool RotterdamHolland9 Android Workshop Hogeschool Rotterdam
Holland9 Android Workshop Hogeschool Rotterdam
 
Android
AndroidAndroid
Android
 
What is Android?
What is Android?What is Android?
What is Android?
 
Android apps development
Android apps developmentAndroid apps development
Android apps development
 

Recently uploaded

TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 

Recently uploaded (20)

TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 

Notes Unit4.pptx

  • 1. Mobile Application Development 1 Course teacher: Mr Kiran Khandarkar, Assistant Professor in CSE Department.
  • 2. 2 Course Outcomes ESC155: Mobile Application Development ESC255: Lab-III: Mobile Application Development  CO1: Explain Android Ecosystem and features of android operating system (II Understand)  CO2: Configure Android environment and development tools. (III Apply)  CO3: Use different layouts and control flow for designing User interface. (III Apply)  CO4: Design user interface using different UI Components of Android. (III Apply)  CO5: Demonstrate different lifecycles in Android. (III Apply)  CO6: Illustrate process of publishing an android app on google play store. (III Apply)
  • 3. • UNIT-IV: Text View, Edit Text, Button, Image Button, Radio Button and Radio Group, Progress Bar, Image View Textbooks/ Reference Books : 1. Composing Mobile Apps , by Anubhav Pradhan, Anil V Deshpande, Wiley Publication. 2. Android App Development for Dummies , Michael Burton , Wiley Publication. 3. Android Programming for Beginners , John Horton , Packt Publishing. 3
  • 4. 4 • The Basic building block for user interface is a View object which is created from the View class and occupies a rectangular area on the screen. • View referes to Android.view class , which is the super class for all the GUI Components like Textview, ImageView, Button etc. Views are divided into following categories, Basic Views: it contain Commonly used view such as Textview,EditText, Button views Picker Views: It has views which enable users to select from list like Datepicker, Timepicker. ListView : It has views like ListView and Spinner Views.
  • 5. 5
  • 6. 6 Most Commonly Used Android View classes: These views can be used to create a useful input and output fields. •Text View •EditText •Button •ImageView •ImageButton •CheckBox •Radio button •RadioGroup •ListView •Spinner •AutoCompleteTextView
  • 7. 7 Image view: Image view helps to display images in an android application. Any image can be selected, we just have to paste our image in a drawable folder from where we can access it. For example: In below Code “@drawable/ic_laucher” has been taken.
  • 8. 8 XML coding of Image view: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:gravity="center_horizontal" > <ImageView android:id="@+id/myimageview" android:layout_width="100dp" android:layout_height="100dp" android:layout_margin="20dp" android:gravity="center" android:padding="10dp" android:src="@drawable/ic_launcher" />
  • 9. 9 Check Box: Checkbox is used in that applications where we have to select one option from multiple provided. Checkbox is mainly used when 2 or more options are present.
  • 10. 10 XML coding of checkbox: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <CheckBox android:id="@+id/checkBox1" android:layout_width="100dp" android:layout_height="wrap_content" android:layout_margin="20dp" android:text="Formget." android:checked="true" /> <CheckBox android:id="@+id/checkBox2" android:layout_width="100dp" android:layout_height="wrap_content" android:layout_margin="20dp" android:text="Mailget." /> </LinearLayout>
  • 11. 11 Radio Button: Radio button is like checkbox, but there is slight difference between them. Radio button is a two-states button that can be either checked or unchecked.
  • 12. 12 XML coding of Radio Button: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:gravity="center_horizontal" > <RadioButton android:id="@+id/radioButton1" android:layout_width="100dp" android:layout_height="wrap_content" android:layout_margin="20dp" android:text="Formget" android:checked="true" /> <RadioButton android:id="@+id/radioButton1" android:layout_width="100dp" android:layout_height="wrap_content" android:layout_margin="20dp" android:text="Mailget" /> </LinearLayout>
  • 13. 13
  • 14. 14 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <RadioGroup android:id="@+id/radioSex" android:layout_width="wrap_content" android:layout_height="wrap_content" > <RadioButton android:id="@+id/radioMale" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/radio_male" android:checked="true" /> <RadioButton android:id="@+id/radioFemale" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/radio_female" /> </RadioGroup> <Button android:id="@+id/btnDisplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/btn_display" /> </LinearLayout>
  • 15. 15 import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.Toast; public class MyAndroidAppActivity extends Activity { private RadioGroup radioSexGroup; private RadioButton radioSexButton; private Button btnDisplay; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); addListenerOnButton(); } public void addListenerOnButton() { radioSexGroup = (RadioGroup) findViewById(R.id.radioSex); btnDisplay = (Button) findViewById(R.id.btnDisplay);
  • 16. 16 btnDisplay.setOnClickListener(new OnClickListener( ) { @Override public void onClick(View v) { // get selected radio button from radioGroup int selectedId = radioSexGroup.getCheckedRadioButtonId(); // find the radiobutton by returned id radioSexButton = (RadioButton) findViewById(selectedId); Toast.makeText(MyAndroidAppActivity.this, radioSexButton.getText(), Toast.LENGTH_SHORT).show(); } }); } }
  • 17. 17
  • 18. 18
  • 19. 19 Image Button View: Image button is a button but it carries an image on it. We can put an image or a certain text on it and when we click it provides the operations assigned to it.
  • 20. 20 Syntax For Image Button In XML Coding Is: XML coding of Image button: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <ImageButton android:id="@+id/imageButton1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:src="@drawable/ic_launcher" /> </LinearLayout>
  • 21. 21 Attribute Description android:text Used to specify the text to be displayed in the TextView android:textSize Using this attribute we can control the size of the text. android:textColor Using this attribute we can specify the color of our text. android:textAllCaps If set True, this will make the text appear in upper case. android:letterSpacing Using this attribute we can set the spacing between TextView is the most widely used view used to show pre-defined text on display screen.
  • 23. 23 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity"> <ProgressBar android:id="@+id/simpleProgressBar" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="invisible" android:layout_centerHorizontal="true"/> <Button android:id="@+id/startButton" android:layout_width="200dp" android:layout_height="wrap_content" android:text="Start" android:textSize="20sp" android:textStyle="bold" android:layout_centerHorizontal="true" android:layout_marginTop="100dp" android:padding="10dp" android:background="#0f0" android:textColor="#fff"/> </RelativeLayout>
  • 24. 24 import android.graphics.Color; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.ProgressBar; import android.widget.Button; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // initiate progress bar and start button final ProgressBar simpleProgressBar = (ProgressBar) findViewById(R.id.simpleProgressBar); Button startButton = (Button) findViewById(R.id.startButton); // perform click event on button startButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // visible the progress bar simpleProgressBar.setVisibility(View.VISIBLE); } }); } }
  • 25. 25