SlideShare a Scribd company logo
1 of 44
Android 101 נושאיההרצאה: ,[object Object]
מהםכליהעבודה?
מהםאבניהבנייןשליישום ? Android
איזהכליםישבשביל? Debugging ,[object Object]
What’s given by Android for development? ADB. AVD manager and emulator. Android devices. SDK. NDK. Android tools.
The “Android Debug Bridge” is:  A command line tool. handles communication with a development unit a client-server program that includes three components: A client, which runs on your computer.  A server, which runs as a background process. A daemon, which runs as a background process on each development unit. Android tools – ADB.
Runs on your computer. Mouse/keyboard to mimic touch and key events. Mimics all hardware and software features. Different screen sizes and densities. Emulating phone events (SMS, phone calls). Spoofing location events. Different API levels. Android tools – Emulator.
Android tools – Emulator.
All android devices are debug-able via USB “out of the box” (no root is needed). To enable: Settings>applications: Allow unknown resources. Settings>applications>development: Allow USB debugging. Stay awake. Android tools – Device.
Programming language: JAVA + XML. Create standard android application by using and utilizing the applications framework. Most popularIDE: Eclipse + ADT. Other possible IDEs: intellij. Net beans. Android tools – SDK.
Programming language: everything! Create an android application by accessing the native code directly. Reasons for using NDK: Using non-java ready made code. Using hardware acceleration. A real need for more  performance. Android tools – NDK.
Android building blocks The components of an android application and their connecting methods.
The (Android) application. An application consists of A manifest xml. A set of: Activities. Services. Broadcast receivers. Content providers.
The Manifest The Manifest is essentially a list of components that the application uses or requires, such as: The components of the applications. User permissions . The minimum API level. Hardware and software features. API dependencies.
A manifest example
.The Activity An activity represents a single screen with a user interface (Java file + xml layout file). An application usually consists of multiple activities that are loosely bound to each other. One Activity is flagged as “main” and it is started at the application launch time. An Activity can launch other activities to create an app UI workflow.  The Activity has an Intent attribute that determines how android treats it.
Activity explained with an example. A screen that displays a list of emails. A screen that displays a single email. A screen  that enables you  to compose  an email. Each and every one of these is an Activity!
Starting an Activity. When you press reply: ,[object Object]
The recipients aresent via the“Extras” attribute of the intent.
The Activity life-cycle. There are 6 stages in the Android Activity life cycle. These stages allow you to perform tasks in their correct time of the workflow.
The Activity life-cycle vol2.
SharedPrefs – A tool that saves data to a file so it will be available even if the app is closed and restarted. It is generally used for: 1. Saving user preferences. 2. Saving a “snapshot” of the app so it could be resumed to precisely the same state.  The Activity life-cycle vol3 – before example.
The Activity life-cycle vol3 – example of use.
Consists of xml. Describe the static layout of a screen. A few types available: LinearLayout– children are lined up automatically. RelativeLayout- children order needs to be defined. ListView– children are items of a list. Etc. The Activity – Layout.
The Activity – Layout example.
.The Service An application component that can perform long-running operations in the background and does not provide a user interface. The service has two forms: ,[object Object]
A “bound” service is bound by an app component and is used as a client-server bridge, this sort of service is terminated when the application that is bound to it is closed.,[object Object]
The same principle as in the activity life cycle applies here only the stages are different. As you can see the bound and started services have a similar cycle with a twist: The bound service is only “alive” while the binding application is “alive”. The service life cycle.
The service life cycle.
a component that responds to system-wide broadcast announcements. The announcement can originate either from a system event (screen on/off) or a custom activity event. When this protocol is customized it facilitates message sending between applications and activities that should work together. The Broadcast receivers.
The manifest tag: The Broadcast receivers - example.
The broadcast receiver file: The Broadcast receivers - example.
Components that manage a shared set of application data.  The data is stored at one of the following formats: In the file system. In an SQLite database. on the web. More.. Essentially you can store it in any persistent storage location your application can access.  The Content providers.
Through the content provider, other applications can query or even modify the data (if the content provider allows it).  providers are also useful for reading and writing data that is private to your application and is not shared. The Content providers.
Here’s a few examples for system content providers: Contacts. Text messages. Phone calls. The Content providers – examples.
Android provides a few precious tools for that: DDMS. Logcat. Hierarchy viewer. Monkey & monkey runner. Android debug tools.
Android debug tools – DDMS. The “DalvikDebug Monitor Server (DDMS)” is:  A debugging tool that provides: Port forwarding services.  Screen capture.  thread and heap information.  Logcatand process logging. Mobile data spoofing (location, calls and SMS) Memory dump.
Android debug tools – DDMS.
Amechanism for collecting and viewing system debug output. Filter levels: V — Verbose (lowest priority) D — Debug I — Info W — Warning E — Error Invoke logs with a custom TAG in your app to monitor its operation: Android debug tools – Logcat.
 Displays the View objects that form the UI of the Activity that is running on your device or emulator.  Start command: <sdk>/tools/hierarchyviewer If #levels > 7 -> NOT GOOD! Android debug tools – Hierarchy viewer.
Creates random UI events. Great UI durability test. You can configure: The amount of event. Percentage of touch/motion/track/key events. The monkey’s “aggressiveness” (die after exception/error/security error etc.). Android debug tools – Monkey.
Enables using the monkey tool in a more precise way: Write a python code. The monkey performs it. Great for recreating bugs and create tests to see when they are resolved. Android debug tools – Monkey runner.
Tips and pointers - ANR. “Activity not responding”: Appears if: 5 seconds of no action after a touch event. 10 second after invoking a BR it hasn’t finished working. Why? Every activity has 1 UI thread and if it is stuck the UX suffers.
Everything that isn’t a UI action shouldn’t be on the UI thread, use: AsyncTask. TimerTask. Handler. Scheduled task. Thread. Then post your data on the UI thread. Tips and pointers – Avoid ANR.

More Related Content

What's hot

01 what is android
01 what is android01 what is android
01 what is androidC.o. Nieto
 
Day 2 android internals a quick overview
Day 2 android internals a quick overviewDay 2 android internals a quick overview
Day 2 android internals a quick overviewAhsanul Karim
 
Android before getting started
Android before getting startedAndroid before getting started
Android before getting startedAhsanul Karim
 
Android developer interview questions with answers pdf
Android developer interview questions with answers pdfAndroid developer interview questions with answers pdf
Android developer interview questions with answers pdfazlist247
 
10 ways to improve your Android app performance
10 ways to improve your Android app performance10 ways to improve your Android app performance
10 ways to improve your Android app performanceBoris Farber
 
Day 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesDay 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesAhsanul Karim
 
Nativa Android Applications development
Nativa Android Applications developmentNativa Android Applications development
Nativa Android Applications developmentAlfredo Morresi
 
Hidden Object Detection for Computer Vision Based Test Automation System
Hidden Object Detection for Computer Vision Based Test Automation SystemHidden Object Detection for Computer Vision Based Test Automation System
Hidden Object Detection for Computer Vision Based Test Automation SystemSyeful Islam
 
Basic of Android App Development
Basic of Android App DevelopmentBasic of Android App Development
Basic of Android App DevelopmentAbhijeet Gupta
 
Mobile application security
Mobile application securityMobile application security
Mobile application securityShubhneet Goel
 
Intro To Android App Development
Intro To Android App DevelopmentIntro To Android App Development
Intro To Android App DevelopmentMike Kvintus
 
What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]Sittiphol Phanvilai
 
Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?Bitbar
 

What's hot (20)

01 what is android
01 what is android01 what is android
01 what is android
 
AndroidManifest
AndroidManifestAndroidManifest
AndroidManifest
 
Day 2 android internals a quick overview
Day 2 android internals a quick overviewDay 2 android internals a quick overview
Day 2 android internals a quick overview
 
Android before getting started
Android before getting startedAndroid before getting started
Android before getting started
 
Android programming basics
Android programming basicsAndroid programming basics
Android programming basics
 
Android developer interview questions with answers pdf
Android developer interview questions with answers pdfAndroid developer interview questions with answers pdf
Android developer interview questions with answers pdf
 
Android basics
Android basicsAndroid basics
Android basics
 
10 ways to improve your Android app performance
10 ways to improve your Android app performance10 ways to improve your Android app performance
10 ways to improve your Android app performance
 
Day 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesDay 3: Getting Active Through Activities
Day 3: Getting Active Through Activities
 
Google Android
Google AndroidGoogle Android
Google Android
 
Android app development
Android app developmentAndroid app development
Android app development
 
Nativa Android Applications development
Nativa Android Applications developmentNativa Android Applications development
Nativa Android Applications development
 
Hidden Object Detection for Computer Vision Based Test Automation System
Hidden Object Detection for Computer Vision Based Test Automation SystemHidden Object Detection for Computer Vision Based Test Automation System
Hidden Object Detection for Computer Vision Based Test Automation System
 
Android Layout.pptx
Android Layout.pptxAndroid Layout.pptx
Android Layout.pptx
 
Basic of Android App Development
Basic of Android App DevelopmentBasic of Android App Development
Basic of Android App Development
 
Android Basic- CMC
Android Basic- CMCAndroid Basic- CMC
Android Basic- CMC
 
Mobile application security
Mobile application securityMobile application security
Mobile application security
 
Intro To Android App Development
Intro To Android App DevelopmentIntro To Android App Development
Intro To Android App Development
 
What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]
 
Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?
 

Similar to Android 101: The Building Blocks

Android terminologies
Android terminologiesAndroid terminologies
Android terminologiesjerry vasoya
 
5 beginner android application development foundation
5 beginner android application development foundation5 beginner android application development foundation
5 beginner android application development foundationCbitss Technologies
 
Android In A Nutshell
Android In A NutshellAndroid In A Nutshell
Android In A NutshellTed Chien
 
Android app fundamentals
Android app fundamentalsAndroid app fundamentals
Android app fundamentalsAmr Salman
 
Android interview questions and answers
Android interview questions and answersAndroid interview questions and answers
Android interview questions and answerskavinilavuG
 
Android application development
Android application developmentAndroid application development
Android application developmentMd. Mujahid Islam
 
"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2Tadas Jurelevičius
 
Functional Requirements Of System Requirements
Functional Requirements Of System RequirementsFunctional Requirements Of System Requirements
Functional Requirements Of System RequirementsLaura Arrigo
 
Mobile Application Security
Mobile Application SecurityMobile Application Security
Mobile Application SecurityIshan Girdhar
 
Android 3.0 Portland Java User Group 2011-03-15
Android 3.0 Portland Java User Group 2011-03-15Android 3.0 Portland Java User Group 2011-03-15
Android 3.0 Portland Java User Group 2011-03-15sullis
 
Part 2 android application development 101
Part 2 android application development 101Part 2 android application development 101
Part 2 android application development 101Michael Angelo Rivera
 
Beginning android
Beginning android Beginning android
Beginning android Igor R
 
Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Lars Vogel
 

Similar to Android 101: The Building Blocks (20)

Android terminologies
Android terminologiesAndroid terminologies
Android terminologies
 
Android beginners David
Android beginners DavidAndroid beginners David
Android beginners David
 
5 beginner android application development foundation
5 beginner android application development foundation5 beginner android application development foundation
5 beginner android application development foundation
 
Mobile testing android
Mobile testing   androidMobile testing   android
Mobile testing android
 
Android In A Nutshell
Android In A NutshellAndroid In A Nutshell
Android In A Nutshell
 
Android Development Basics
Android Development BasicsAndroid Development Basics
Android Development Basics
 
Android app fundamentals
Android app fundamentalsAndroid app fundamentals
Android app fundamentals
 
Android interview questions and answers
Android interview questions and answersAndroid interview questions and answers
Android interview questions and answers
 
Android OS
Android OSAndroid OS
Android OS
 
Android os
Android osAndroid os
Android os
 
Android application development
Android application developmentAndroid application development
Android application development
 
"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2
 
Android101
Android101Android101
Android101
 
Functional Requirements Of System Requirements
Functional Requirements Of System RequirementsFunctional Requirements Of System Requirements
Functional Requirements Of System Requirements
 
Android
AndroidAndroid
Android
 
Mobile Application Security
Mobile Application SecurityMobile Application Security
Mobile Application Security
 
Android 3.0 Portland Java User Group 2011-03-15
Android 3.0 Portland Java User Group 2011-03-15Android 3.0 Portland Java User Group 2011-03-15
Android 3.0 Portland Java User Group 2011-03-15
 
Part 2 android application development 101
Part 2 android application development 101Part 2 android application development 101
Part 2 android application development 101
 
Beginning android
Beginning android Beginning android
Beginning android
 
Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11 Android Introduction on Java Forum Stuttgart 11
Android Introduction on Java Forum Stuttgart 11
 

Recently uploaded

2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 

Android 101: The Building Blocks

  • 1.
  • 4.
  • 5. What’s given by Android for development? ADB. AVD manager and emulator. Android devices. SDK. NDK. Android tools.
  • 6. The “Android Debug Bridge” is: A command line tool. handles communication with a development unit a client-server program that includes three components: A client, which runs on your computer. A server, which runs as a background process. A daemon, which runs as a background process on each development unit. Android tools – ADB.
  • 7. Runs on your computer. Mouse/keyboard to mimic touch and key events. Mimics all hardware and software features. Different screen sizes and densities. Emulating phone events (SMS, phone calls). Spoofing location events. Different API levels. Android tools – Emulator.
  • 8. Android tools – Emulator.
  • 9. All android devices are debug-able via USB “out of the box” (no root is needed). To enable: Settings>applications: Allow unknown resources. Settings>applications>development: Allow USB debugging. Stay awake. Android tools – Device.
  • 10. Programming language: JAVA + XML. Create standard android application by using and utilizing the applications framework. Most popularIDE: Eclipse + ADT. Other possible IDEs: intellij. Net beans. Android tools – SDK.
  • 11. Programming language: everything! Create an android application by accessing the native code directly. Reasons for using NDK: Using non-java ready made code. Using hardware acceleration. A real need for more performance. Android tools – NDK.
  • 12. Android building blocks The components of an android application and their connecting methods.
  • 13. The (Android) application. An application consists of A manifest xml. A set of: Activities. Services. Broadcast receivers. Content providers.
  • 14. The Manifest The Manifest is essentially a list of components that the application uses or requires, such as: The components of the applications. User permissions . The minimum API level. Hardware and software features. API dependencies.
  • 16. .The Activity An activity represents a single screen with a user interface (Java file + xml layout file). An application usually consists of multiple activities that are loosely bound to each other. One Activity is flagged as “main” and it is started at the application launch time. An Activity can launch other activities to create an app UI workflow. The Activity has an Intent attribute that determines how android treats it.
  • 17. Activity explained with an example. A screen that displays a list of emails. A screen that displays a single email. A screen that enables you to compose an email. Each and every one of these is an Activity!
  • 18.
  • 19. The recipients aresent via the“Extras” attribute of the intent.
  • 20. The Activity life-cycle. There are 6 stages in the Android Activity life cycle. These stages allow you to perform tasks in their correct time of the workflow.
  • 22. SharedPrefs – A tool that saves data to a file so it will be available even if the app is closed and restarted. It is generally used for: 1. Saving user preferences. 2. Saving a “snapshot” of the app so it could be resumed to precisely the same state. The Activity life-cycle vol3 – before example.
  • 23. The Activity life-cycle vol3 – example of use.
  • 24. Consists of xml. Describe the static layout of a screen. A few types available: LinearLayout– children are lined up automatically. RelativeLayout- children order needs to be defined. ListView– children are items of a list. Etc. The Activity – Layout.
  • 25. The Activity – Layout example.
  • 26.
  • 27.
  • 28. The same principle as in the activity life cycle applies here only the stages are different. As you can see the bound and started services have a similar cycle with a twist: The bound service is only “alive” while the binding application is “alive”. The service life cycle.
  • 30. a component that responds to system-wide broadcast announcements. The announcement can originate either from a system event (screen on/off) or a custom activity event. When this protocol is customized it facilitates message sending between applications and activities that should work together. The Broadcast receivers.
  • 31. The manifest tag: The Broadcast receivers - example.
  • 32. The broadcast receiver file: The Broadcast receivers - example.
  • 33. Components that manage a shared set of application data. The data is stored at one of the following formats: In the file system. In an SQLite database. on the web. More.. Essentially you can store it in any persistent storage location your application can access. The Content providers.
  • 34. Through the content provider, other applications can query or even modify the data (if the content provider allows it). providers are also useful for reading and writing data that is private to your application and is not shared. The Content providers.
  • 35. Here’s a few examples for system content providers: Contacts. Text messages. Phone calls. The Content providers – examples.
  • 36. Android provides a few precious tools for that: DDMS. Logcat. Hierarchy viewer. Monkey & monkey runner. Android debug tools.
  • 37. Android debug tools – DDMS. The “DalvikDebug Monitor Server (DDMS)” is: A debugging tool that provides: Port forwarding services. Screen capture.  thread and heap information.  Logcatand process logging. Mobile data spoofing (location, calls and SMS) Memory dump.
  • 38. Android debug tools – DDMS.
  • 39. Amechanism for collecting and viewing system debug output. Filter levels: V — Verbose (lowest priority) D — Debug I — Info W — Warning E — Error Invoke logs with a custom TAG in your app to monitor its operation: Android debug tools – Logcat.
  • 40.  Displays the View objects that form the UI of the Activity that is running on your device or emulator.  Start command: <sdk>/tools/hierarchyviewer If #levels > 7 -> NOT GOOD! Android debug tools – Hierarchy viewer.
  • 41. Creates random UI events. Great UI durability test. You can configure: The amount of event. Percentage of touch/motion/track/key events. The monkey’s “aggressiveness” (die after exception/error/security error etc.). Android debug tools – Monkey.
  • 42. Enables using the monkey tool in a more precise way: Write a python code. The monkey performs it. Great for recreating bugs and create tests to see when they are resolved. Android debug tools – Monkey runner.
  • 43. Tips and pointers - ANR. “Activity not responding”: Appears if: 5 seconds of no action after a touch event. 10 second after invoking a BR it hasn’t finished working. Why? Every activity has 1 UI thread and if it is stuck the UX suffers.
  • 44. Everything that isn’t a UI action shouldn’t be on the UI thread, use: AsyncTask. TimerTask. Handler. Scheduled task. Thread. Then post your data on the UI thread. Tips and pointers – Avoid ANR.
  • 45. Create an AsyncTask: start an AsyncTask: Tips and pointers – example.
  • 46.
  • 48. - layout-xlarge/..Tips and pointers – Multiple screens.
  • 49. 3 main possibilities: GPS. Most accurate. Wireless networks. Gives faster results. Costs less battery. Works inside buildings. Cell towers. Always available. Tips and pointers – location detection.