SlideShare a Scribd company logo
1 of 11
Download to read offline
BASIC ANDROID APPS
Widgets & Event Handling
BASIC ANDROID APPS
แนวคิดการเขียนโปรแกรม ตัวอย่างที่ 1 การใช้ Operation รับค่าจาก EditText1 ไปกระทากับ
EditText2 แล้วแสดงผลออกมาใน TextView หลังจากกด Button
ออกแบบหน้าจอ Layout
นาตัวแปรเหล่านี้
ไปทา final ค่า
BASIC ANDROID APPS
เขียนคาสั่ง final ค่าจาก Widget พร้อมทั้ง Import เข้าไปในส่วนของ Header Code
ทาการใช้ความรู้เมื่อครู่สร้าง
Result ผลลัพ์ขึ้นมาเพิ่ม
หมายเหตุตรวจสอบ id ของ Widget ในหน้า Layout ให้เรียบร้อย
BASIC ANDROID APPS
สร้าง เมธอดใหม่เมื่อเกิด Event Click ที่ button1 (การบวกค่าผลลัพธ์)
สร้างตัวแปร float ขึ้นมา 3 ตัวคือ ค่าที่1,ค่าที่2 และผลลัพธ์, รับค่า Value ตัวเลขที่เราใส่มาเก็บ
ไว้ใน num1, num2 ต่อจากนั้นเอาตัวแปร result มารับค่า num1+num2 เรียกแสดงผล
BASIC ANDROID APPS
สร้าง เมธอดใหม่เมื่อเกิด Event Click ที่ button2 (การลบค่าผลลัพธ์)
จงแสดงวิธีทาจากตัวอย่างเมื่อครู่
BASIC ANDROID APPS
Hint:
BASIC ANDROID APPS
พิจารณาโจทย์ต่อไปนี้
BASIC ANDROID APPS
BASIC ANDROID APPS
แบบฝึกหัด
BASIC ANDROID APPS
แบบฝึกหัด
BASIC ANDROID APPS
แบบฝึกหัด

More Related Content

Viewers also liked

Viewers also liked (11)

Creative Inbound Marketing - Adways Labs Thailand Co., Ltd.
Creative Inbound Marketing - Adways Labs Thailand Co., Ltd.Creative Inbound Marketing - Adways Labs Thailand Co., Ltd.
Creative Inbound Marketing - Adways Labs Thailand Co., Ltd.
 
การสื่อภาษา - ศูนย์เตรียมความพร้อมเพื่อการทำงาน
การสื่อภาษา - ศูนย์เตรียมความพร้อมเพื่อการทำงานการสื่อภาษา - ศูนย์เตรียมความพร้อมเพื่อการทำงาน
การสื่อภาษา - ศูนย์เตรียมความพร้อมเพื่อการทำงาน
 
NCIT 2015 - The Development of Game Engine in Learning Media
NCIT 2015 - The Development of Game Engine in Learning MediaNCIT 2015 - The Development of Game Engine in Learning Media
NCIT 2015 - The Development of Game Engine in Learning Media
 
The Evaluation of Effectiveness on Mobile Application Banner
The Evaluation of Effectiveness on Mobile Application BannerThe Evaluation of Effectiveness on Mobile Application Banner
The Evaluation of Effectiveness on Mobile Application Banner
 
Inbound Marketing University: Intro to Inbound Marketing
Inbound Marketing University: Intro to Inbound MarketingInbound Marketing University: Intro to Inbound Marketing
Inbound Marketing University: Intro to Inbound Marketing
 
iOS Developer Concept introduction
iOS Developer Concept introductioniOS Developer Concept introduction
iOS Developer Concept introduction
 
NCIT 2015 - Virtual Reality Application to simulation and control walking pla...
NCIT 2015 - Virtual Reality Application to simulation and control walking pla...NCIT 2015 - Virtual Reality Application to simulation and control walking pla...
NCIT 2015 - Virtual Reality Application to simulation and control walking pla...
 
งานคอม!!!! Aoy
งานคอม!!!! Aoyงานคอม!!!! Aoy
งานคอม!!!! Aoy
 
Proba
ProbaProba
Proba
 
Proba
ProbaProba
Proba
 
Proba
ProbaProba
Proba
 

Similar to Basic Android Development: Widget & Event Hadling

คู่มือการอบรมครู การพัฒนาสื่อการเรียนการสอน ด้วย MIT App Inventor
คู่มือการอบรมครู การพัฒนาสื่อการเรียนการสอน ด้วย MIT App Inventorคู่มือการอบรมครู การพัฒนาสื่อการเรียนการสอน ด้วย MIT App Inventor
คู่มือการอบรมครู การพัฒนาสื่อการเรียนการสอน ด้วย MIT App Inventor
Somchart Phaeumnart
 
Authorware
AuthorwareAuthorware
Authorware
pui3327
 
ความหมายของโปรแกรมคอมพิวเตอร์
ความหมายของโปรแกรมคอมพิวเตอร์ความหมายของโปรแกรมคอมพิวเตอร์
ความหมายของโปรแกรมคอมพิวเตอร์
Onrutai Intanin
 
Lesson 6 การสร้างรายงาน
Lesson 6 การสร้างรายงานLesson 6 การสร้างรายงาน
Lesson 6 การสร้างรายงาน
Errorrrrr
 
2. โครงสร้างภาษาซี
2. โครงสร้างภาษาซี2. โครงสร้างภาษาซี
2. โครงสร้างภาษาซี
mansuang1978
 

Similar to Basic Android Development: Widget & Event Hadling (20)

ใบความรู้ที่ 10 application calculator
ใบความรู้ที่ 10 application calculatorใบความรู้ที่ 10 application calculator
ใบความรู้ที่ 10 application calculator
 
ใบความรู้ที่ 7 application paint pot
ใบความรู้ที่ 7 application paint potใบความรู้ที่ 7 application paint pot
ใบความรู้ที่ 7 application paint pot
 
ใบความรู้ที่ 5 ส่วนประกอบของโปรแกรม mit app inventor
ใบความรู้ที่ 5 ส่วนประกอบของโปรแกรม mit app inventorใบความรู้ที่ 5 ส่วนประกอบของโปรแกรม mit app inventor
ใบความรู้ที่ 5 ส่วนประกอบของโปรแกรม mit app inventor
 
ใบความรู้ที่ 8 application paint pot2
ใบความรู้ที่ 8 application paint pot2ใบความรู้ที่ 8 application paint pot2
ใบความรู้ที่ 8 application paint pot2
 
คู่มือการอบรมครู การพัฒนาสื่อการเรียนการสอน ด้วย MIT App Inventor
คู่มือการอบรมครู การพัฒนาสื่อการเรียนการสอน ด้วย MIT App Inventorคู่มือการอบรมครู การพัฒนาสื่อการเรียนการสอน ด้วย MIT App Inventor
คู่มือการอบรมครู การพัฒนาสื่อการเรียนการสอน ด้วย MIT App Inventor
 
Authorware
AuthorwareAuthorware
Authorware
 
Tutorial android
Tutorial androidTutorial android
Tutorial android
 
ใบความรู้ที่ 6 application talk to me
ใบความรู้ที่ 6 application talk to meใบความรู้ที่ 6 application talk to me
ใบความรู้ที่ 6 application talk to me
 
53011213097
5301121309753011213097
53011213097
 
Vb 6.0
Vb 6.0 Vb 6.0
Vb 6.0
 
Kikjl
KikjlKikjl
Kikjl
 
Kikjl
KikjlKikjl
Kikjl
 
56670274
5667027456670274
56670274
 
56670274
5667027456670274
56670274
 
การเขียนโปรแกรมด้วยVb 6.0
การเขียนโปรแกรมด้วยVb 6.0การเขียนโปรแกรมด้วยVb 6.0
การเขียนโปรแกรมด้วยVb 6.0
 
ความหมายของโปรแกรมคอมพิวเตอร์
ความหมายของโปรแกรมคอมพิวเตอร์ความหมายของโปรแกรมคอมพิวเตอร์
ความหมายของโปรแกรมคอมพิวเตอร์
 
การเขียนโปรแกรมโดยใช้ Net bean
การเขียนโปรแกรมโดยใช้ Net beanการเขียนโปรแกรมโดยใช้ Net bean
การเขียนโปรแกรมโดยใช้ Net bean
 
หลักการเขียนโปรแกรม
หลักการเขียนโปรแกรมหลักการเขียนโปรแกรม
หลักการเขียนโปรแกรม
 
Lesson 6 การสร้างรายงาน
Lesson 6 การสร้างรายงานLesson 6 การสร้างรายงาน
Lesson 6 การสร้างรายงาน
 
2. โครงสร้างภาษาซี
2. โครงสร้างภาษาซี2. โครงสร้างภาษาซี
2. โครงสร้างภาษาซี
 

More from Banyapon Poolsawas

More from Banyapon Poolsawas (20)

เอกสารอบรม ARIT, AI for Future
เอกสารอบรม ARIT, AI for Futureเอกสารอบรม ARIT, AI for Future
เอกสารอบรม ARIT, AI for Future
 
Metaverse: Blockchain NFT Smart Contract and Decentraland [TH]
Metaverse: Blockchain NFT Smart Contract and Decentraland [TH]Metaverse: Blockchain NFT Smart Contract and Decentraland [TH]
Metaverse: Blockchain NFT Smart Contract and Decentraland [TH]
 
DD303 กระบวนการทำ Photogrammetry Class 5
DD303 กระบวนการทำ Photogrammetry Class 5DD303 กระบวนการทำ Photogrammetry Class 5
DD303 กระบวนการทำ Photogrammetry Class 5
 
WebXR Export บน Unity 2020
WebXR Export บน Unity 2020WebXR Export บน Unity 2020
WebXR Export บน Unity 2020
 
PakPao:FriendTrips ปักเป้าเที่ยวทริปหารเฉลี่ย
PakPao:FriendTrips ปักเป้าเที่ยวทริปหารเฉลี่ยPakPao:FriendTrips ปักเป้าเที่ยวทริปหารเฉลี่ย
PakPao:FriendTrips ปักเป้าเที่ยวทริปหารเฉลี่ย
 
Design for Inspiration บทที่ 4: Sense and Intent การรับรู้ได้ถึงการเปลี่ยนแปล...
Design for Inspiration บทที่ 4: Sense and Intent การรับรู้ได้ถึงการเปลี่ยนแปล...Design for Inspiration บทที่ 4: Sense and Intent การรับรู้ได้ถึงการเปลี่ยนแปล...
Design for Inspiration บทที่ 4: Sense and Intent การรับรู้ได้ถึงการเปลี่ยนแปล...
 
Design for Inspiration บทที่ 3: Italian Renaissance, Raffaello Santi
Design for Inspiration บทที่ 3: Italian Renaissance, Raffaello SantiDesign for Inspiration บทที่ 3: Italian Renaissance, Raffaello Santi
Design for Inspiration บทที่ 3: Italian Renaissance, Raffaello Santi
 
Design for Inspiration บทที่ 2: Italian Renaissance, Michelangelo Buonarroti
Design for Inspiration บทที่ 2: Italian Renaissance, Michelangelo BuonarrotiDesign for Inspiration บทที่ 2: Italian Renaissance, Michelangelo Buonarroti
Design for Inspiration บทที่ 2: Italian Renaissance, Michelangelo Buonarroti
 
Design for Inspiration บทที่ 1: Italian Renaissance, Sandro Botticelli
Design for Inspiration บทที่ 1: Italian Renaissance, Sandro BotticelliDesign for Inspiration บทที่ 1: Italian Renaissance, Sandro Botticelli
Design for Inspiration บทที่ 1: Italian Renaissance, Sandro Botticelli
 
Designing the Future of Game 2020
Designing the Future of Game 2020Designing the Future of Game 2020
Designing the Future of Game 2020
 
Class 7 รีวิว The Master กระบวนการถ่ายทอดผลงานทางศิลปะ การทำงานศิลปะอย่างมีจิ...
Class 7 รีวิว The Master กระบวนการถ่ายทอดผลงานทางศิลปะ การทำงานศิลปะอย่างมีจิ...Class 7 รีวิว The Master กระบวนการถ่ายทอดผลงานทางศิลปะ การทำงานศิลปะอย่างมีจิ...
Class 7 รีวิว The Master กระบวนการถ่ายทอดผลงานทางศิลปะ การทำงานศิลปะอย่างมีจิ...
 
Class6 ศาสตร์ของการเล่าเรื่อง และ แนวคิดด้านนวัตกรรม Art of Story Telling & I...
Class6 ศาสตร์ของการเล่าเรื่อง และ แนวคิดด้านนวัตกรรม Art of Story Telling & I...Class6 ศาสตร์ของการเล่าเรื่อง และ แนวคิดด้านนวัตกรรม Art of Story Telling & I...
Class6 ศาสตร์ของการเล่าเรื่อง และ แนวคิดด้านนวัตกรรม Art of Story Telling & I...
 
Class 5 การออกแบบเพื่อสร้างแรงบันดาลใจ หลัก Gestalt Principles
Class 5 การออกแบบเพื่อสร้างแรงบันดาลใจ หลัก Gestalt PrinciplesClass 5 การออกแบบเพื่อสร้างแรงบันดาลใจ หลัก Gestalt Principles
Class 5 การออกแบบเพื่อสร้างแรงบันดาลใจ หลัก Gestalt Principles
 
Class 3 การออกแบบเพื่อสร้างแรงบันดาลใจ Visual Hierarchy และ Grid system
Class 3 การออกแบบเพื่อสร้างแรงบันดาลใจ Visual Hierarchy และ Grid systemClass 3 การออกแบบเพื่อสร้างแรงบันดาลใจ Visual Hierarchy และ Grid system
Class 3 การออกแบบเพื่อสร้างแรงบันดาลใจ Visual Hierarchy และ Grid system
 
Class2 การออกแบบเพื่อสร้างแรงบันดาลใจ Dots Lines and Planes
Class2 การออกแบบเพื่อสร้างแรงบันดาลใจ Dots Lines and PlanesClass2 การออกแบบเพื่อสร้างแรงบันดาลใจ Dots Lines and Planes
Class2 การออกแบบเพื่อสร้างแรงบันดาลใจ Dots Lines and Planes
 
Class1 การออกแบบเพื่อสร้างแรงบันดาลใจ Formstorming
Class1 การออกแบบเพื่อสร้างแรงบันดาลใจ FormstormingClass1 การออกแบบเพื่อสร้างแรงบันดาลใจ Formstorming
Class1 การออกแบบเพื่อสร้างแรงบันดาลใจ Formstorming
 
การออกแบบกราฟิก 3D ด้วย Blender 2.8+ โดย อาจารย์ บัญญพนต์ พูลสวัสดิ์ Chapter 2
การออกแบบกราฟิก 3D ด้วย Blender 2.8+ โดย อาจารย์ บัญญพนต์ พูลสวัสดิ์ Chapter 2การออกแบบกราฟิก 3D ด้วย Blender 2.8+ โดย อาจารย์ บัญญพนต์ พูลสวัสดิ์ Chapter 2
การออกแบบกราฟิก 3D ด้วย Blender 2.8+ โดย อาจารย์ บัญญพนต์ พูลสวัสดิ์ Chapter 2
 
การออกแบบกราฟิก 3D ด้วย Blender 2.8+ โดย อาจารย์ บัญญพนต์ พูลสวัสดิ์ Chapter 1
การออกแบบกราฟิก 3D ด้วย Blender 2.8+ โดย อาจารย์ บัญญพนต์ พูลสวัสดิ์ Chapter 1 การออกแบบกราฟิก 3D ด้วย Blender 2.8+ โดย อาจารย์ บัญญพนต์ พูลสวัสดิ์ Chapter 1
การออกแบบกราฟิก 3D ด้วย Blender 2.8+ โดย อาจารย์ บัญญพนต์ พูลสวัสดิ์ Chapter 1
 
DA393 Course Activity วิชาการออกแบบเพื่อสร้างแรงบันดาลใจ 3 อาจารย์ บัญญพนต์ พ...
DA393 Course Activity วิชาการออกแบบเพื่อสร้างแรงบันดาลใจ 3 อาจารย์ บัญญพนต์ พ...DA393 Course Activity วิชาการออกแบบเพื่อสร้างแรงบันดาลใจ 3 อาจารย์ บัญญพนต์ พ...
DA393 Course Activity วิชาการออกแบบเพื่อสร้างแรงบันดาลใจ 3 อาจารย์ บัญญพนต์ พ...
 
ANT College of Creative Design and Entertainment Technology
ANT College of Creative Design and Entertainment TechnologyANT College of Creative Design and Entertainment Technology
ANT College of Creative Design and Entertainment Technology
 

Basic Android Development: Widget & Event Hadling