SlideShare a Scribd company logo
1 of 12
Android
Studio Basics
Mark Daniel G. Dacer
Project Files
• MainActivity– holds the code and
functionality of the app
• Activity_main.xml – Design and Layout
Layout Editor
Pallete Design Surface
Orientation Resolution
Attributes
Component Tree
Layout
View
Attributes and XML
• Attributes are properties of a view,
element and etc.
• Attributes are define by the XML
• XML is a Markup Language
Hello World!
Has many attributes
ID & References
• id is a unique resource name for the
element
• Can be use as references inside the code
Button and Methods
1
2
Click and hold
Drag and Drop
• Create a button then define the onClick
attribute of the button
• We will create a method for the button to
do something like disabling itself.
• Note the onclick defined name must be
same as the method name
Define the name
Logcats
• Logcat is a command-line tool that
dumps a log of system messages,
including stack traces when the device
throws an error and messages that you
have written from your app with the Log
class
Changing attributes
using methods
• We can create a object then cast it to the
view element.
• Then set some codes to change it
attributes, like the text, color, and etc.
R class and Find ID
• We can use findViewById to get the
reference ID and perform various attribute
changes
Getting Data
• Add a plain text and button views
• Create a method
• Create a variable for that specific view
and pass the data from the R class
• Then convert that data to string and
assign it to a variable
• Then running the app and log the
input
Making Toast
• An Android Toast is a small message
displayed on the screen
More learning Links
• Sample Demo project:
https://drive.google.com/file/d/14fLjvMdrWpI5tzCAvSOpVQdTqhg-
6BIv/view?usp=sharing
• Android Studio Documentation: https://developer.android.com/docs

More Related Content

Similar to Android Studio Basics

#42 green lantern framework
#42   green lantern framework#42   green lantern framework
#42 green lantern framework
Srilu Balla
 
Domain Driven Design in the Browser - Cameron Edwards
Domain Driven Design in the Browser - Cameron EdwardsDomain Driven Design in the Browser - Cameron Edwards
Domain Driven Design in the Browser - Cameron Edwards
Hakka Labs
 
Android application development
Android application developmentAndroid application development
Android application development
Linh Vi Tường
 

Similar to Android Studio Basics (20)

The Ring programming language version 1.10 book - Part 7 of 212
The Ring programming language version 1.10 book - Part 7 of 212The Ring programming language version 1.10 book - Part 7 of 212
The Ring programming language version 1.10 book - Part 7 of 212
 
#42 green lantern framework
#42   green lantern framework#42   green lantern framework
#42 green lantern framework
 
Domain Driven Design in the Browser - Cameron Edwards
Domain Driven Design in the Browser - Cameron EdwardsDomain Driven Design in the Browser - Cameron Edwards
Domain Driven Design in the Browser - Cameron Edwards
 
Part 7
Part 7Part 7
Part 7
 
Class as the basis of all computation
Class as the basis of all computationClass as the basis of all computation
Class as the basis of all computation
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
Enhancement of Action Description Language for UML Activity Diagram Review
Enhancement of Action Description Language for UML Activity Diagram ReviewEnhancement of Action Description Language for UML Activity Diagram Review
Enhancement of Action Description Language for UML Activity Diagram Review
 
Introduction to Android- A session by Sagar Das
Introduction to Android-  A session by Sagar DasIntroduction to Android-  A session by Sagar Das
Introduction to Android- A session by Sagar Das
 
What's New Xamarin.Forms 1.3
What's New Xamarin.Forms 1.3What's New Xamarin.Forms 1.3
What's New Xamarin.Forms 1.3
 
Android application development
Android application developmentAndroid application development
Android application development
 
The Developers World
The Developers WorldThe Developers World
The Developers World
 
Delphi L01 Intro
Delphi L01 IntroDelphi L01 Intro
Delphi L01 Intro
 
Android Workshop_1
Android Workshop_1Android Workshop_1
Android Workshop_1
 
Android development course in pune ppt.
Android development course in pune ppt.Android development course in pune ppt.
Android development course in pune ppt.
 
A Toolkit for Digital Accessibility
A Toolkit for Digital Accessibility A Toolkit for Digital Accessibility
A Toolkit for Digital Accessibility
 
Lec02
Lec02Lec02
Lec02
 
Dart Programming.pptx
Dart Programming.pptxDart Programming.pptx
Dart Programming.pptx
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)
 
Android project architecture
Android project architectureAndroid project architecture
Android project architecture
 
Python
PythonPython
Python
 

Recently uploaded

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 

Recently uploaded (20)

Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 

Android Studio Basics

  • 2. Project Files • MainActivity– holds the code and functionality of the app • Activity_main.xml – Design and Layout
  • 3. Layout Editor Pallete Design Surface Orientation Resolution Attributes Component Tree Layout View
  • 4. Attributes and XML • Attributes are properties of a view, element and etc. • Attributes are define by the XML • XML is a Markup Language Hello World! Has many attributes
  • 5. ID & References • id is a unique resource name for the element • Can be use as references inside the code
  • 6. Button and Methods 1 2 Click and hold Drag and Drop • Create a button then define the onClick attribute of the button • We will create a method for the button to do something like disabling itself. • Note the onclick defined name must be same as the method name Define the name
  • 7. Logcats • Logcat is a command-line tool that dumps a log of system messages, including stack traces when the device throws an error and messages that you have written from your app with the Log class
  • 8. Changing attributes using methods • We can create a object then cast it to the view element. • Then set some codes to change it attributes, like the text, color, and etc.
  • 9. R class and Find ID • We can use findViewById to get the reference ID and perform various attribute changes
  • 10. Getting Data • Add a plain text and button views • Create a method • Create a variable for that specific view and pass the data from the R class • Then convert that data to string and assign it to a variable • Then running the app and log the input
  • 11. Making Toast • An Android Toast is a small message displayed on the screen
  • 12. More learning Links • Sample Demo project: https://drive.google.com/file/d/14fLjvMdrWpI5tzCAvSOpVQdTqhg- 6BIv/view?usp=sharing • Android Studio Documentation: https://developer.android.com/docs