SlideShare a Scribd company logo
行動APP開發管理實務
Button, TextView and EditText
尹君耀 Xavier Yin
Outline
 Review
 Prior Knowledge
 Button
 Events
 TextView
 Practice
Review
 Install Android Studio
– Java, Android SDK and IDE
 How to development your app?
– Create an empty project
– Arrange your resources
– Bind your resources into an Activity file(java class)
– Set Manifest file
– Launch an emulator or real device
Basic Components
 Activity
 Service
 BroadcastReceiver
 ContentProvider
UI Components
 View class
– This class represents the basic
building block for user interface
components.
 ViewGroup class
– The ViewGroup subclass is the base
class for layouts, which are invisible
containers that hold other Views (or
other ViewGroups) and define their
layout properties.
UI Components
 View class
– This class represents the basic
building block for user interface
components.
 ViewGroup class
– The ViewGroup subclass is the base
class for layouts, which are invisible
containers that hold other Views (or
other ViewGroups) and define their
layout properties.
UI Components
 View class
– This class represents the basic
building block for user interface
components.
 ViewGroup class
– The ViewGroup subclass is the base
class for layouts, which are invisible
containers that hold other Views (or
other ViewGroups) and define their
layout properties.
Button
 Button
– Represents a push-button widget. Push-buttons can be pressed, or
clicked, by the user to perform an action.
– A button consists of text or an icon (or both text and an icon) that
communicates what action occurs when the user touches it.
TextView and EditText
 TextView
– Displays text to the user and
optionally allows them to edit
it.
 EditText
– EditText is a thin veneer over
TextView that configures itself
to be editable.
TextView and EditText
 TextView
– Displays text to the user and
optionally allows them to edit
it.
 EditText
– EditText is a thin veneer over
TextView that configures itself
to be editable.
TextView and EditText
 TextView
– Displays text to the user and
optionally allows them to edit
it.
 EditText
– EditText is a thin veneer over
TextView that configures itself
to be editable.
Event Listeners
 Event Listeners
– An event listener is an interface in the View class that contains a single
callback method. These methods will be called by the Android
framework when the View to which the listener has been registered is
triggered by user interaction with the item in the UI.
– Included in the event listener interfaces are the following callback
methods:
 onClick()
 onTouch()
 onLongClick()
 onFocusChange()
 onKey()
Practice
 Requirements
ActivityA
Practice
 Requirements
ActivityA ActivityB
Practice
 Requirements
ActivityA ActivityB
Practice
 Requirements
ActivityA
Practice
 Create an empty project
 Launch an emulator
– Create a Virtual Device…
 3.2”QVGA…..
 armeabi
 Analyze your requirements (res)
– Colors: #AEE32345
– Dimens: 10dp
– Strings: Android原生按鈕,送出, Activity A的結果:%s。, 請在EditText輸入
您需要的內容。, 無法找到相對應的結果
Practice
 Analyze your requirements
– Layout: laout_activity_a.xml, laout_activity_b.xml
 Bind the above files with your java files
– ActivityA.java and ActivityB.java
 Modify Manifest.xml
– ActivityA is a Main program
– ActivityB
Sample Code and Slides
 Slides
– https://www.slideshare.net/secret/JtRP83lClHIKi7
 Sample Code
– SimpleUnit2
 https://github.com/xavier0507/TKUSampleCode_SimpleUnit2.git
– Advanced
 https://github.com/xavier0507/TKUSampleCode_Unit2.git
References
 Android developers:
– http://developer.android.com/design/index.html
Practice
 Requirements
Practice
 Requirements
Practice
 Requirements
Clicked
Practice
 Requirements
Practice
 Requirements: activity_main.xml
10dp
Center
20dp
20dp
20dp
20dp
1. Original Button:
TextColor: #FF000000
TextSize: Medium
BackgroundColor: default
2. MyStyle Button:
TextColor: #FF000000
TextSize: Medium
TextStyle: Bold
BackgroundColor: default
3. Custom Button:
TextColor: #FF000000
Corners-radius = 10dp
Stroke-width = 3dp, color = #FF001113
Gradient-type = linear, startColor = #FF449DEF,
centerColor = #FF2F6699, endColor = #FF449DEF
4. Custom Clickable Button:
TextColor: #FF000000
Normal state:
Corners-radius = 5dp
Stroke-width = 1dp, color = #FF001113
Solid-color = #FFEE3456
Pressed state:
Corners-radius = 5dp
Stroke-width = 1dp, color = #FF001113
Solid-color = #33EE3456
Practice
 Requirements: activity_show_result.xml
10dp
10dp
10dp
3. Custom Clickable Button:
TextColor: #FF000000
Normal state:
Corners-radius = 5dp
Stroke-width = 1dp, color = #FF001113
Solid-color = #FFEE3456
Pressed state:
Corners-radius = 5dp
Stroke-width = 1dp, color = #FF001113
Solid-color = #33EE3456
1. TextView:
TextColor: #FF000000
TextSize: Medium
BackgroundColor: default
2. EditText:
TextColor: #FFFFFFFF
TextSize: Medium
BackgroundColor: #FF000000
SingleLine: true
Practice
 Create a new project
– Empty project
 Define resources that you need
– Colors.xml
Practice
 Define resources that you need
– dimens.xml
Practice
 Define resources that you need
– strings.xml
Practice
 Define resources that you need
– styles.xml
Practice
 Prepare Layout files
– activity_main.xml
Practice
 Prepare Layout files
– activity_show_result.xml
Practice
 Bind the above files with your java files
– MainActivity
 setContentView(R.layout.activity_main)
 Find components
 Set Click Listener and create an Intent
– ResultActivity
 getIntent()
 TextView sets text content
– Constant
Practice
 Define App Manifest file
– Intent-filter
– Add ResultActivity
 Launch your App in a device or make other components.

More Related Content

PPTX
行動App開發管理實務unit4
PPTX
Material design - widgets and sample code
PPTX
行動App開發管理實務 unit1
PPTX
行動App開發管理實務unit3
PDF
Basic Android Layout
PPTX
Tku-行動app開發管理實務-如何開發Android應用程式
PPTX
Android development session 3 - layout
PPTX
Android Training (Android UI)
行動App開發管理實務unit4
Material design - widgets and sample code
行動App開發管理實務 unit1
行動App開發管理實務unit3
Basic Android Layout
Tku-行動app開發管理實務-如何開發Android應用程式
Android development session 3 - layout
Android Training (Android UI)

What's hot (17)

PDF
Android layouts
PDF
Android ui layout
PDF
Best Practices for Android UI by RapidValue Solutions
PDF
01 08 - graphical user interface - layouts
PPT
android layouts
PDF
Android Screen Containers & Layouts
PPT
Android UI Patterns
PPTX
Unit 2 - Introduction to UIKit
PDF
01 09 - graphical user interface - basic widgets
PPTX
PPTX
Android Layout
PDF
Ui layout (incomplete)
PDF
Chapter 5 - Layouts
KEY
Ch6 file, saving states, and preferences
PPTX
TKU行動APP開發管理實務 - ListView & Custom Adapter
PDF
Chapter 10 - Views Part 2
PPT
"Android" mobilių programėlių kūrimo įvadas #2
Android layouts
Android ui layout
Best Practices for Android UI by RapidValue Solutions
01 08 - graphical user interface - layouts
android layouts
Android Screen Containers & Layouts
Android UI Patterns
Unit 2 - Introduction to UIKit
01 09 - graphical user interface - basic widgets
Android Layout
Ui layout (incomplete)
Chapter 5 - Layouts
Ch6 file, saving states, and preferences
TKU行動APP開發管理實務 - ListView & Custom Adapter
Chapter 10 - Views Part 2
"Android" mobilių programėlių kūrimo įvadas #2
Ad

Similar to 行動App開發管理實務 unit2 (20)

PPTX
Tku-行動app開發管理實務-Android應用程式開發基礎
PDF
Android programming basics
PDF
Mobile Software Engineering Crash Course - C03 Android
PPT
Android Application Development Programming
PDF
Introduction to Andriod Studio Lecture note: Android Development Lecture 1.pdf
PPT
Android
PDF
PDF
PDF
DOCX
Mobile Application Development Lab Mannual 2024.docx
DOC
ANDROID LAB MANUAL.doc
PPTX
Android App development III
PPTX
Android Study Jam 2
PPTX
Android Development for Beginners with Sample Project - Day 1
ODP
2013.05.02 android-l1
PPTX
Jetpack Compose Session 2 (1).pptx
PPTX
Building a simple user interface lesson2
PPTX
Lesson 3
PPTX
Week 5 slides
PDF
Android application development workshop day1
Tku-行動app開發管理實務-Android應用程式開發基礎
Android programming basics
Mobile Software Engineering Crash Course - C03 Android
Android Application Development Programming
Introduction to Andriod Studio Lecture note: Android Development Lecture 1.pdf
Android
Mobile Application Development Lab Mannual 2024.docx
ANDROID LAB MANUAL.doc
Android App development III
Android Study Jam 2
Android Development for Beginners with Sample Project - Day 1
2013.05.02 android-l1
Jetpack Compose Session 2 (1).pptx
Building a simple user interface lesson2
Lesson 3
Week 5 slides
Android application development workshop day1
Ad

Recently uploaded (20)

PDF
Basic Mud Logging Guide for educational purpose
PPTX
Cell Structure & Organelles in detailed.
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Pharma ospi slides which help in ospi learning
PDF
Pre independence Education in Inndia.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
Classroom Observation Tools for Teachers
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
01-Introduction-to-Information-Management.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Complications of Minimal Access Surgery at WLH
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
master seminar digital applications in india
Basic Mud Logging Guide for educational purpose
Cell Structure & Organelles in detailed.
Microbial disease of the cardiovascular and lymphatic systems
STATICS OF THE RIGID BODIES Hibbelers.pdf
Pharma ospi slides which help in ospi learning
Pre independence Education in Inndia.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Renaissance Architecture: A Journey from Faith to Humanism
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Classroom Observation Tools for Teachers
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
O7-L3 Supply Chain Operations - ICLT Program
01-Introduction-to-Information-Management.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
Complications of Minimal Access Surgery at WLH
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Supply Chain Operations Speaking Notes -ICLT Program
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
O5-L3 Freight Transport Ops (International) V1.pdf
master seminar digital applications in india

行動App開發管理實務 unit2

  • 1. 行動APP開發管理實務 Button, TextView and EditText 尹君耀 Xavier Yin
  • 2. Outline  Review  Prior Knowledge  Button  Events  TextView  Practice
  • 3. Review  Install Android Studio – Java, Android SDK and IDE  How to development your app? – Create an empty project – Arrange your resources – Bind your resources into an Activity file(java class) – Set Manifest file – Launch an emulator or real device
  • 4. Basic Components  Activity  Service  BroadcastReceiver  ContentProvider
  • 5. UI Components  View class – This class represents the basic building block for user interface components.  ViewGroup class – The ViewGroup subclass is the base class for layouts, which are invisible containers that hold other Views (or other ViewGroups) and define their layout properties.
  • 6. UI Components  View class – This class represents the basic building block for user interface components.  ViewGroup class – The ViewGroup subclass is the base class for layouts, which are invisible containers that hold other Views (or other ViewGroups) and define their layout properties.
  • 7. UI Components  View class – This class represents the basic building block for user interface components.  ViewGroup class – The ViewGroup subclass is the base class for layouts, which are invisible containers that hold other Views (or other ViewGroups) and define their layout properties.
  • 8. Button  Button – Represents a push-button widget. Push-buttons can be pressed, or clicked, by the user to perform an action. – A button consists of text or an icon (or both text and an icon) that communicates what action occurs when the user touches it.
  • 9. TextView and EditText  TextView – Displays text to the user and optionally allows them to edit it.  EditText – EditText is a thin veneer over TextView that configures itself to be editable.
  • 10. TextView and EditText  TextView – Displays text to the user and optionally allows them to edit it.  EditText – EditText is a thin veneer over TextView that configures itself to be editable.
  • 11. TextView and EditText  TextView – Displays text to the user and optionally allows them to edit it.  EditText – EditText is a thin veneer over TextView that configures itself to be editable.
  • 12. Event Listeners  Event Listeners – An event listener is an interface in the View class that contains a single callback method. These methods will be called by the Android framework when the View to which the listener has been registered is triggered by user interaction with the item in the UI. – Included in the event listener interfaces are the following callback methods:  onClick()  onTouch()  onLongClick()  onFocusChange()  onKey()
  • 17. Practice  Create an empty project  Launch an emulator – Create a Virtual Device…  3.2”QVGA…..  armeabi  Analyze your requirements (res) – Colors: #AEE32345 – Dimens: 10dp – Strings: Android原生按鈕,送出, Activity A的結果:%s。, 請在EditText輸入 您需要的內容。, 無法找到相對應的結果
  • 18. Practice  Analyze your requirements – Layout: laout_activity_a.xml, laout_activity_b.xml  Bind the above files with your java files – ActivityA.java and ActivityB.java  Modify Manifest.xml – ActivityA is a Main program – ActivityB
  • 19. Sample Code and Slides  Slides – https://www.slideshare.net/secret/JtRP83lClHIKi7  Sample Code – SimpleUnit2  https://github.com/xavier0507/TKUSampleCode_SimpleUnit2.git – Advanced  https://github.com/xavier0507/TKUSampleCode_Unit2.git
  • 20. References  Android developers: – http://developer.android.com/design/index.html
  • 25. Practice  Requirements: activity_main.xml 10dp Center 20dp 20dp 20dp 20dp 1. Original Button: TextColor: #FF000000 TextSize: Medium BackgroundColor: default 2. MyStyle Button: TextColor: #FF000000 TextSize: Medium TextStyle: Bold BackgroundColor: default 3. Custom Button: TextColor: #FF000000 Corners-radius = 10dp Stroke-width = 3dp, color = #FF001113 Gradient-type = linear, startColor = #FF449DEF, centerColor = #FF2F6699, endColor = #FF449DEF 4. Custom Clickable Button: TextColor: #FF000000 Normal state: Corners-radius = 5dp Stroke-width = 1dp, color = #FF001113 Solid-color = #FFEE3456 Pressed state: Corners-radius = 5dp Stroke-width = 1dp, color = #FF001113 Solid-color = #33EE3456
  • 26. Practice  Requirements: activity_show_result.xml 10dp 10dp 10dp 3. Custom Clickable Button: TextColor: #FF000000 Normal state: Corners-radius = 5dp Stroke-width = 1dp, color = #FF001113 Solid-color = #FFEE3456 Pressed state: Corners-radius = 5dp Stroke-width = 1dp, color = #FF001113 Solid-color = #33EE3456 1. TextView: TextColor: #FF000000 TextSize: Medium BackgroundColor: default 2. EditText: TextColor: #FFFFFFFF TextSize: Medium BackgroundColor: #FF000000 SingleLine: true
  • 27. Practice  Create a new project – Empty project  Define resources that you need – Colors.xml
  • 28. Practice  Define resources that you need – dimens.xml
  • 29. Practice  Define resources that you need – strings.xml
  • 30. Practice  Define resources that you need – styles.xml
  • 31. Practice  Prepare Layout files – activity_main.xml
  • 32. Practice  Prepare Layout files – activity_show_result.xml
  • 33. Practice  Bind the above files with your java files – MainActivity  setContentView(R.layout.activity_main)  Find components  Set Click Listener and create an Intent – ResultActivity  getIntent()  TextView sets text content – Constant
  • 34. Practice  Define App Manifest file – Intent-filter – Add ResultActivity  Launch your App in a device or make other components.