SlideShare ist ein Scribd-Unternehmen logo
1 von 7
Very basic
Calculator
layout in
activity_main.
xml file.
Good thing is that layout
can be controlled by drug-
and-drop method. So just
click on “Hello World” and
you can simply delete it.
Then just drug into your app
four buttons (which will later
represent arithmetic
symbols)
Now by clicking on
activity_main.xml tab at
the bottom you will go into
the “code” of the layout.
Each button is represented
by opening and closing tag
<Button … />
And as parameters you can
change it's text, layout_width
and so on...
android:id sets name which
represents button in a java
file.
Now change text and id
parameters for each
button.
Like in the next slide.
Don't worry if your code is a bit
different.
Because of graphical relative
layout android:layout_... might
have different value
<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" >
<Button
android:id="@+id/minus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/plus"
android:layout_alignBottom="@+id/plus"
android:layout_alignParentRight="true"
android:layout_marginRight="67dp"
android:text="-" />
<Button
android:id="@+id/division"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/plus"
android:layout_below="@+id/plus"
android:layout_marginTop="47dp"
android:text="/" />
<Button
android:id="@+id/mult"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/division"
android:layout_alignBottom="@+id/division"
android:layout_alignLeft="@+id/minus"
android:text="*" />
<Button
android:id="@+id/plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="39dp"
android:text="+" />
</RelativeLayout>
Now change back to
Graphical Layout and
correct layout by drug and
drop if something doesn't
look beautiful enough.
From Form Widgets folder
drug and drop TextView.
(this field will be used to
show the answer)
And from Text Fields drug
and drop Plain Text.
(this will take two numbers
as input)
Now open activity_main.xml
and change id's
appropriately
<TextView
android:id="@+id/answer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/input1"
android:layout_below="@+id/input1"
android:layout_marginLeft="14dp"
android:layout_marginTop="27dp"
android:text="TextView" />
<EditText
android:id="@+id/input1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="22dp"
android:ems="10" >
</EditText>
<EditText
android:id="@+id/input2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/input1"
android:layout_alignParentTop="true"
android:ems="10" />

Weitere ähnliche Inhalte

Was ist angesagt?

Microsoft Office 2003 Creating Macros
Microsoft Office 2003 Creating MacrosMicrosoft Office 2003 Creating Macros
Microsoft Office 2003 Creating MacrosS Burks
 
How to make a result sheet of students using MS EXCEL
How to make a result sheet of students using MS EXCELHow to make a result sheet of students using MS EXCEL
How to make a result sheet of students using MS EXCELAnu Radha
 
Microsoft excel 2007 programme for effective tertiary institution result grading
Microsoft excel 2007 programme for effective tertiary institution result gradingMicrosoft excel 2007 programme for effective tertiary institution result grading
Microsoft excel 2007 programme for effective tertiary institution result gradingAlexander Decker
 
Fomatting Text Tips
Fomatting Text TipsFomatting Text Tips
Fomatting Text TipsEMAINT
 
Android Training (Android UI)
Android Training (Android UI)Android Training (Android UI)
Android Training (Android UI)Khaled Anaqwa
 
Excel Document Recovery to the Rescue
Excel Document Recovery to the RescueExcel Document Recovery to the Rescue
Excel Document Recovery to the RescueWiley
 
Learn Vba excel 2007
Learn Vba excel 2007Learn Vba excel 2007
Learn Vba excel 2007Steve Johnson
 
Dynamic Web Pages Ch 2 V1.0
Dynamic Web Pages Ch 2 V1.0Dynamic Web Pages Ch 2 V1.0
Dynamic Web Pages Ch 2 V1.0Cathie101
 
Customizing Forms
Customizing FormsCustomizing Forms
Customizing FormsEMAINT
 
How to add the windows calculator to the quick access toolbar in microsoft ex...
How to add the windows calculator to the quick access toolbar in microsoft ex...How to add the windows calculator to the quick access toolbar in microsoft ex...
How to add the windows calculator to the quick access toolbar in microsoft ex...Trường Tiền
 
Smart todolist
Smart todolistSmart todolist
Smart todolistAppSheet
 
Android android layouts
Android android layoutsAndroid android layouts
Android android layoutsperpetrotech
 
Getting Started with MS Access and Pivot Tables
Getting Started with MS Access and Pivot TablesGetting Started with MS Access and Pivot Tables
Getting Started with MS Access and Pivot TablesParth Acharya
 
Lesson 1 setting up excel environment
Lesson 1   setting up excel environmentLesson 1   setting up excel environment
Lesson 1 setting up excel environmentguevarra_2000
 

Was ist angesagt? (20)

Microsoft Office 2003 Creating Macros
Microsoft Office 2003 Creating MacrosMicrosoft Office 2003 Creating Macros
Microsoft Office 2003 Creating Macros
 
Excel ch10
Excel ch10Excel ch10
Excel ch10
 
How to make a result sheet of students using MS EXCEL
How to make a result sheet of students using MS EXCELHow to make a result sheet of students using MS EXCEL
How to make a result sheet of students using MS EXCEL
 
Toolbar
ToolbarToolbar
Toolbar
 
Forms and buttons
Forms and buttonsForms and buttons
Forms and buttons
 
Android development session 3 - layout
Android development   session 3 - layoutAndroid development   session 3 - layout
Android development session 3 - layout
 
Microsoft excel 2007 programme for effective tertiary institution result grading
Microsoft excel 2007 programme for effective tertiary institution result gradingMicrosoft excel 2007 programme for effective tertiary institution result grading
Microsoft excel 2007 programme for effective tertiary institution result grading
 
Oracle forms 6_i__1_
Oracle forms 6_i__1_Oracle forms 6_i__1_
Oracle forms 6_i__1_
 
Fomatting Text Tips
Fomatting Text TipsFomatting Text Tips
Fomatting Text Tips
 
Android Training (Android UI)
Android Training (Android UI)Android Training (Android UI)
Android Training (Android UI)
 
Excel Document Recovery to the Rescue
Excel Document Recovery to the RescueExcel Document Recovery to the Rescue
Excel Document Recovery to the Rescue
 
Vlookup example
Vlookup exampleVlookup example
Vlookup example
 
Learn Vba excel 2007
Learn Vba excel 2007Learn Vba excel 2007
Learn Vba excel 2007
 
Dynamic Web Pages Ch 2 V1.0
Dynamic Web Pages Ch 2 V1.0Dynamic Web Pages Ch 2 V1.0
Dynamic Web Pages Ch 2 V1.0
 
Customizing Forms
Customizing FormsCustomizing Forms
Customizing Forms
 
How to add the windows calculator to the quick access toolbar in microsoft ex...
How to add the windows calculator to the quick access toolbar in microsoft ex...How to add the windows calculator to the quick access toolbar in microsoft ex...
How to add the windows calculator to the quick access toolbar in microsoft ex...
 
Smart todolist
Smart todolistSmart todolist
Smart todolist
 
Android android layouts
Android android layoutsAndroid android layouts
Android android layouts
 
Getting Started with MS Access and Pivot Tables
Getting Started with MS Access and Pivot TablesGetting Started with MS Access and Pivot Tables
Getting Started with MS Access and Pivot Tables
 
Lesson 1 setting up excel environment
Lesson 1   setting up excel environmentLesson 1   setting up excel environment
Lesson 1 setting up excel environment
 

Andere mochten auch (20)

Yourprezi
YourpreziYourprezi
Yourprezi
 
Clink for Card Issuers
Clink for Card IssuersClink for Card Issuers
Clink for Card Issuers
 
HAINUTE BOTEZ
HAINUTE BOTEZHAINUTE BOTEZ
HAINUTE BOTEZ
 
Ebecm19
Ebecm19Ebecm19
Ebecm19
 
Teks Forum Hegemoni
Teks Forum HegemoniTeks Forum Hegemoni
Teks Forum Hegemoni
 
Android tutorials6 run_your_app
Android tutorials6 run_your_appAndroid tutorials6 run_your_app
Android tutorials6 run_your_app
 
就職活動は遅らせるべきか
就職活動は遅らせるべきか就職活動は遅らせるべきか
就職活動は遅らせるべきか
 
Mousedeer
Mousedeer Mousedeer
Mousedeer
 
Android tutorials8 todo_list
Android tutorials8 todo_listAndroid tutorials8 todo_list
Android tutorials8 todo_list
 
DOL model notice for exchange
DOL  model notice for exchangeDOL  model notice for exchange
DOL model notice for exchange
 
аттестация учителей
аттестация учителейаттестация учителей
аттестация учителей
 
Mobile andwebapps
Mobile andwebappsMobile andwebapps
Mobile andwebapps
 
Johnny prodcomimpex srl
Johnny prodcomimpex srlJohnny prodcomimpex srl
Johnny prodcomimpex srl
 
Yourprezi
YourpreziYourprezi
Yourprezi
 
How the cell phone work
How the cell phone workHow the cell phone work
How the cell phone work
 
Benefits 101 guide
Benefits 101 guideBenefits 101 guide
Benefits 101 guide
 
видеоэкскурсия в красный берег(полная)
видеоэкскурсия в красный берег(полная)видеоэкскурсия в красный берег(полная)
видеоэкскурсия в красный берег(полная)
 
HAINUTE BOTEZ
HAINUTE BOTEZ HAINUTE BOTEZ
HAINUTE BOTEZ
 
Imbracaminte copii
Imbracaminte copiiImbracaminte copii
Imbracaminte copii
 
Услуги стадиона «Динамо»
Услуги стадиона «Динамо»Услуги стадиона «Динамо»
Услуги стадиона «Динамо»
 

Ähnlich wie Android tutorials7 calculator_basiclayout

Android tutorials7 calculator
Android tutorials7 calculatorAndroid tutorials7 calculator
Android tutorials7 calculatorVlad Kolesnyk
 
Basics and different xml files used in android
Basics and different xml files used in androidBasics and different xml files used in android
Basics and different xml files used in androidMahmudul Hasan
 
How to create ui using droid draw
How to create ui using droid drawHow to create ui using droid draw
How to create ui using droid drawinfo_zybotech
 
mobile application development -unit-3-
mobile application development  -unit-3-mobile application development  -unit-3-
mobile application development -unit-3-TejamFandat
 
Dreamweaver cs6 step by step
Dreamweaver cs6 step by stepDreamweaver cs6 step by step
Dreamweaver cs6 step by stepzoran Jelinek
 
Android Homework for-july-19th-2015
Android Homework for-july-19th-2015Android Homework for-july-19th-2015
Android Homework for-july-19th-2015Rishi Kumar
 
android layouts
android layoutsandroid layouts
android layoutsDeepa Rani
 
Android apps development
Android apps developmentAndroid apps development
Android apps developmentMonir Zzaman
 
View groups containers
View groups containersView groups containers
View groups containersMani Selvaraj
 
Rapid applications development update12-06-14
Rapid applications development update12-06-14Rapid applications development update12-06-14
Rapid applications development update12-06-14LennartF
 
Web app-la-jan-2
Web app-la-jan-2Web app-la-jan-2
Web app-la-jan-2Thinkful
 

Ähnlich wie Android tutorials7 calculator_basiclayout (20)

Android tutorials7 calculator
Android tutorials7 calculatorAndroid tutorials7 calculator
Android tutorials7 calculator
 
Basics and different xml files used in android
Basics and different xml files used in androidBasics and different xml files used in android
Basics and different xml files used in android
 
How to create ui using droid draw
How to create ui using droid drawHow to create ui using droid draw
How to create ui using droid draw
 
mobile application development -unit-3-
mobile application development  -unit-3-mobile application development  -unit-3-
mobile application development -unit-3-
 
Create New Android Layout
Create New Android LayoutCreate New Android Layout
Create New Android Layout
 
Dreamweaver cs6 step by step
Dreamweaver cs6 step by stepDreamweaver cs6 step by step
Dreamweaver cs6 step by step
 
Android app development guide for freshers by ace web academy
Android app development guide for freshers  by ace web academyAndroid app development guide for freshers  by ace web academy
Android app development guide for freshers by ace web academy
 
Android Homework for-july-19th-2015
Android Homework for-july-19th-2015Android Homework for-july-19th-2015
Android Homework for-july-19th-2015
 
android layouts
android layoutsandroid layouts
android layouts
 
Ap quiz app
Ap quiz appAp quiz app
Ap quiz app
 
Android xml-based layouts-chapter5
Android xml-based layouts-chapter5Android xml-based layouts-chapter5
Android xml-based layouts-chapter5
 
Android ui with xml
Android ui with xmlAndroid ui with xml
Android ui with xml
 
Android apps development
Android apps developmentAndroid apps development
Android apps development
 
View groups containers
View groups containersView groups containers
View groups containers
 
Deck 6-456 (1)
Deck 6-456 (1)Deck 6-456 (1)
Deck 6-456 (1)
 
Rapid applications development update12-06-14
Rapid applications development update12-06-14Rapid applications development update12-06-14
Rapid applications development update12-06-14
 
Android development part 2
Android development part 2Android development part 2
Android development part 2
 
Android development part 2
Android development part 2Android development part 2
Android development part 2
 
01 08 - graphical user interface - layouts
01  08 - graphical user interface - layouts01  08 - graphical user interface - layouts
01 08 - graphical user interface - layouts
 
Web app-la-jan-2
Web app-la-jan-2Web app-la-jan-2
Web app-la-jan-2
 

Mehr von Vlad Kolesnyk

Mech eng presentation
Mech eng presentationMech eng presentation
Mech eng presentationVlad Kolesnyk
 
Android tutorials7 calculator_intro
Android tutorials7 calculator_introAndroid tutorials7 calculator_intro
Android tutorials7 calculator_introVlad Kolesnyk
 
Android tutorials8 todo_list
Android tutorials8 todo_listAndroid tutorials8 todo_list
Android tutorials8 todo_listVlad Kolesnyk
 
Android tutorials2 android_tools_on_eclipse
Android tutorials2 android_tools_on_eclipseAndroid tutorials2 android_tools_on_eclipse
Android tutorials2 android_tools_on_eclipseVlad Kolesnyk
 
Android tutorials1 install_ide
Android tutorials1 install_ideAndroid tutorials1 install_ide
Android tutorials1 install_ideVlad Kolesnyk
 
Android tutorials7 calculator_packageexploirer
Android tutorials7 calculator_packageexploirerAndroid tutorials7 calculator_packageexploirer
Android tutorials7 calculator_packageexploirerVlad Kolesnyk
 
Android tutorials7 calculator_javaprogramming
Android tutorials7 calculator_javaprogrammingAndroid tutorials7 calculator_javaprogramming
Android tutorials7 calculator_javaprogrammingVlad Kolesnyk
 
Android tutorials7 calulator_improve
Android tutorials7 calulator_improveAndroid tutorials7 calulator_improve
Android tutorials7 calulator_improveVlad Kolesnyk
 

Mehr von Vlad Kolesnyk (9)

Mech eng presentation
Mech eng presentationMech eng presentation
Mech eng presentation
 
Android tutorials7 calculator_intro
Android tutorials7 calculator_introAndroid tutorials7 calculator_intro
Android tutorials7 calculator_intro
 
Android tutorials8 todo_list
Android tutorials8 todo_listAndroid tutorials8 todo_list
Android tutorials8 todo_list
 
Android tutorials2 android_tools_on_eclipse
Android tutorials2 android_tools_on_eclipseAndroid tutorials2 android_tools_on_eclipse
Android tutorials2 android_tools_on_eclipse
 
Android tutorials1 install_ide
Android tutorials1 install_ideAndroid tutorials1 install_ide
Android tutorials1 install_ide
 
Android tutorials7 calculator_packageexploirer
Android tutorials7 calculator_packageexploirerAndroid tutorials7 calculator_packageexploirer
Android tutorials7 calculator_packageexploirer
 
Android tutorials7 calculator_javaprogramming
Android tutorials7 calculator_javaprogrammingAndroid tutorials7 calculator_javaprogramming
Android tutorials7 calculator_javaprogramming
 
Android tutorials7 calulator_improve
Android tutorials7 calulator_improveAndroid tutorials7 calulator_improve
Android tutorials7 calulator_improve
 
Github tutorial1
Github tutorial1Github tutorial1
Github tutorial1
 

Kürzlich hochgeladen

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Kürzlich hochgeladen (20)

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

Android tutorials7 calculator_basiclayout

  • 2. Good thing is that layout can be controlled by drug- and-drop method. So just click on “Hello World” and you can simply delete it. Then just drug into your app four buttons (which will later represent arithmetic symbols)
  • 3. Now by clicking on activity_main.xml tab at the bottom you will go into the “code” of the layout. Each button is represented by opening and closing tag <Button … /> And as parameters you can change it's text, layout_width and so on... android:id sets name which represents button in a java file. Now change text and id parameters for each button. Like in the next slide.
  • 4. Don't worry if your code is a bit different. Because of graphical relative layout android:layout_... might have different value <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" > <Button android:id="@+id/minus" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/plus" android:layout_alignBottom="@+id/plus" android:layout_alignParentRight="true" android:layout_marginRight="67dp" android:text="-" /> <Button android:id="@+id/division" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/plus" android:layout_below="@+id/plus" android:layout_marginTop="47dp" android:text="/" /> <Button android:id="@+id/mult" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/division" android:layout_alignBottom="@+id/division" android:layout_alignLeft="@+id/minus" android:text="*" /> <Button android:id="@+id/plus" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_marginLeft="39dp" android:text="+" /> </RelativeLayout>
  • 5. Now change back to Graphical Layout and correct layout by drug and drop if something doesn't look beautiful enough.
  • 6. From Form Widgets folder drug and drop TextView. (this field will be used to show the answer) And from Text Fields drug and drop Plain Text. (this will take two numbers as input)
  • 7. Now open activity_main.xml and change id's appropriately <TextView android:id="@+id/answer" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/input1" android:layout_below="@+id/input1" android:layout_marginLeft="14dp" android:layout_marginTop="27dp" android:text="TextView" /> <EditText android:id="@+id/input1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_marginTop="22dp" android:ems="10" > </EditText> <EditText android:id="@+id/input2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/input1" android:layout_alignParentTop="true" android:ems="10" />