SlideShare a Scribd company logo
1 of 19
Welcome!
Android workshop part 2
Jim Clermonts |Electrical Engineer
Jimclermonts@gmail.com
@JimClermonts

Library | Inheritance | Lifecycle | Stack | Linking |Object | Listening | Interface | Strings | Intents
1
Last week

Library | Inheritance | Lifecycle | Stack | Linking |Object | Listening | Interface | Strings | Intents
2
Android & Java library

Library | Inheritance | Lifecycle | Stack | Linking |Object | Listening | Interface | Strings | Intents
3
Library | Inheritance | Lifecycle | Stack | Linking |Object | Listening | Interface | Strings | Intents
4
Inheritance
1

3
2
4
5

Super class

Sub class

Library | Inheritance | Lifecycle | Stack | Linking |Object | Listening | Interface | Strings | Intents
5
Android lifecycle

Library | Inheritance | Lifecycle | Stack | Linking |Object | Listening | Interface | Strings | Intents
6
Stacking
onCreate()

onPause()

onDestroy()
Library | Inheritance | Lifecycle | Stack | Linking |Object | Listening | Interface | Strings | Intents
7
Linking

Identity.java

etUsername : EditText
etPassword : EditText
btnLogin : Button

identity.xml

usernameField
passwordField
loginButton

Library | Inheritance | Lifecycle | Stack | Linking |Object | Listening | Interface | Strings | Intents
8
Linking

Ctrl + Space:

Library | Inheritance | Lifecycle | Stack | Linking |Object | Listening | Interface | Strings | Intents
9
Primitive vs Reference variables

Byte
Short
Int
Long
Float
Double
Boolean
char

EditText
Button
Account
Scanner
Etc….

Library | Inheritance | Lifecycle | Stack | Linking |Object | Listening | Interface | Strings | Intents
10
Object

Library | Inheritance | Lifecycle | Stack | Linking |Object | Listening | Interface | Strings | Intents
11
Listening

Library | Inheritance | Lifecycle | Stack | Linking |Object | Listening | Interface | Strings | Intents
12
Listening

Library | Inheritance | Lifecycle | Stack | Linking |Object | Listening | Interface | Strings | Intents
13
Interface

<<Interface>>

Library | Inheritance | Lifecycle | Stack | Linking |Object | Listening | Interface | Strings | Intents
14
View class
Create OnClickListener
Object
Inherit the methods!

Listen on login button

Parameter is a OnClickListener Object!

Library | Inheritance | Lifecycle | Stack | Linking |Object | Listening | Interface | Strings | Intents
15
Last step:

Library | Inheritance | Lifecycle | Stack | Linking |Object | Listening | Interface | Strings | Intents
16
Strings

Library | Inheritance | Lifecycle | Stack | Linking |Object | Listening | Interface | Strings | Intents
17
Intents

Library | Inheritance | Lifecycle | Stack | Linking |Object | Listening | Interface | Strings | Intents
18
…0.0001% covered
“Workshop style”

1

“Reference book”

2

3

Library | Inheritance | Lifecycle | Stack | Linking |Object | Listening | Interface | Strings | Intents
19

More Related Content

Viewers also liked

правила проведения битвы городов (томский отборочный этап) 5 vs-5 dota2
правила проведения битвы городов (томский отборочный этап) 5 vs-5 dota2правила проведения битвы городов (томский отборочный этап) 5 vs-5 dota2
правила проведения битвы городов (томский отборочный этап) 5 vs-5 dota2Alexander Martyushov
 
правила проведения чемпионата по Sc ii 32
правила проведения чемпионата по Sc ii 32правила проведения чемпионата по Sc ii 32
правила проведения чемпионата по Sc ii 32Alexander Martyushov
 
Правила проведения чемпионата по WOT 7x7
Правила проведения чемпионата по WOT 7x7Правила проведения чемпионата по WOT 7x7
Правила проведения чемпионата по WOT 7x7Alexander Martyushov
 
Best Marketing / Account Management Resume
Best Marketing / Account Management ResumeBest Marketing / Account Management Resume
Best Marketing / Account Management Resumedkomakech
 
правила проведения битвы городов (томский отборочный этап) 5 vs-5 dota2
правила проведения битвы городов (томский отборочный этап) 5 vs-5 dota2правила проведения битвы городов (томский отборочный этап) 5 vs-5 dota2
правила проведения битвы городов (томский отборочный этап) 5 vs-5 dota2Alexander Martyushov
 
Twtelecom.detailed.it.exec overview2011 staicer
Twtelecom.detailed.it.exec overview2011 staicerTwtelecom.detailed.it.exec overview2011 staicer
Twtelecom.detailed.it.exec overview2011 staicerAndrew Staicer
 

Viewers also liked (9)

Evaluation question 2
Evaluation question 2Evaluation question 2
Evaluation question 2
 
правила проведения битвы городов (томский отборочный этап) 5 vs-5 dota2
правила проведения битвы городов (томский отборочный этап) 5 vs-5 dota2правила проведения битвы городов (томский отборочный этап) 5 vs-5 dota2
правила проведения битвы городов (томский отборочный этап) 5 vs-5 dota2
 
правила проведения чемпионата по Sc ii 32
правила проведения чемпионата по Sc ii 32правила проведения чемпионата по Sc ii 32
правила проведения чемпионата по Sc ii 32
 
Правила проведения чемпионата по WOT 7x7
Правила проведения чемпионата по WOT 7x7Правила проведения чемпионата по WOT 7x7
Правила проведения чемпионата по WOT 7x7
 
Best Marketing / Account Management Resume
Best Marketing / Account Management ResumeBest Marketing / Account Management Resume
Best Marketing / Account Management Resume
 
Evaluation question 2
Evaluation question 2Evaluation question 2
Evaluation question 2
 
правила проведения битвы городов (томский отборочный этап) 5 vs-5 dota2
правила проведения битвы городов (томский отборочный этап) 5 vs-5 dota2правила проведения битвы городов (томский отборочный этап) 5 vs-5 dota2
правила проведения битвы городов (томский отборочный этап) 5 vs-5 dota2
 
Twtelecom.detailed.it.exec overview2011 staicer
Twtelecom.detailed.it.exec overview2011 staicerTwtelecom.detailed.it.exec overview2011 staicer
Twtelecom.detailed.it.exec overview2011 staicer
 
ATS GLOBAL
ATS GLOBALATS GLOBAL
ATS GLOBAL
 

Recently uploaded

AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxFIDO Alliance
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfdanishmna97
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewDianaGray10
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfAnubhavMangla3
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...marcuskenyatta275
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch TuesdayIvanti
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxjbellis
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTopCSSGallery
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftshyamraj55
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityVictorSzoltysek
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctBrainSell Technologies
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceSamy Fodil
 
How to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in PakistanHow to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in Pakistandanishmna97
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)Wonjun Hwang
 

Recently uploaded (20)

AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
How to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in PakistanHow to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in Pakistan
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
 

Android workshop week2

Editor's Notes

  1. Last week we’ve designed the class diagram and the views. Now we are going to add the behaviour.
  2. Android &amp; Java ships with a library of hundreds of classes. You can import each class or inherit each class in your own class. You have all the methods of that class at your disposal.
  3. Now comes the hardest part.
  4. Classes can be derived (=extends) from other classes, thereby inheriting fields and methods from that class (You instiantiate the super class in your sub class). You can now use all of the methods and fields from that super class and add or alter functionality of it. Each class that has a view, inherits (=extends) the “activity” super class. 2. Each sub class that inherits the “activity” class usually implements the “onCreate” method. The onCreate method creates the activity and sets your view!3. With the use of the keyword “@Override” you indicate that you use the implementation of “onCreate” in the super class!4. With the use of the keyword “super” you invoke the method from the inherited class. 5.You expand the original method with extra functionality (setContentView!).
  5. You don’t have to know all the different states but you have to be aware that an activity has different states (described with methods) in the lifecycle. As a starting programmer we only use onCreate(). When your program goes to the next activity (with his own view), the old activity is automatically “onPause()”. This is all done by the activity class.
  6. As soon as a new activity gets started, it goes on top of the old activity. This process is called stacking. The activity that is visible, is always on top of the stack. The activities down the stack are “onPause()” and when the memory is full, the oldest activities are automatically destroyed.
  7. We have to link the text fields andLogin button in our View to our java class. EditText and Button are classes (from the package “widget”). And whenever you want to link a user input/output in your .java file you use these classes.
  8. So now our view (.xml) is coupled to our class (.java).
  9. Variables come in 2 flavours. Primitive and reference. Reference variables are references to classes.
  10. A class is like a blueprint of how your objects should behave. With the keyword “new” you instantiate a class and make a object. You can make infinite objects of a class. Now you have all the methods and fields of that class at your disposal.
  11. We have to start listening if a user taps the login button. All user interface interaction is handled by the View class. So how do I know that? Hover over the Button and paste “android.widget.Button” in google. You will find the library reference. Button is a class which extends TextView. TextView is a class which extends View. So Button can invoke all of the View’s methods and fields!!!
  12. The class View has a method “setOnClickListener” with parameter an “OnClickListener” object.
  13. A interface defines the behaviour of a class. A interface describes the methods and parameters that the class must implement, but it doesn’t contain (like a class) the actual code! The View class implements OnClickListener and therefore must implement the method onClick(v).
  14. startActivity is also a method of Activity.
  15. Intents are like messages between components. A component can be an activity. Intents are ofcourse derived from the intent class.
  16. Want to learn more? I recommend starting with “HF Java” or “HF C#”. Both languages are very similar and it doesn’t really matter. Only start with “HF Android Development” when you have some Java or C# experience! These books are written in a very practical workshop style. “Programming Android” is a good reference book during programming.And: http://www.vogella.com/articles/Android/article.html