SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Know thy code Framework
Know thy code ???.* What we wont know after this talk Code review secrets  Know my code  What we will learn from it ( Hopefully ) How to make better use of framework source How to make new components from the framework Framework
Android – Open Source  Android has been available under a free software/open source license since October, 21 2008 Google published the entire source code (including network and telephony stacks) under an Apache License.
Android – Open Source Source available at source.android.com. Source is a bunch of git projects. Google built repo on top of git. Souce is ~3GB , needs ~10GB to build. Currently only builds on Linux and Mac
What code will we be seeing
Framework source in eclipse Source code from major release-specific branches can be downloaded like this: http://android.git.kernel.org/?p=platform/frameworks/base.git;a=snapshot;h=refs/heads/froyo;sf=tgz You can get other versions by changing the branch name (froyo) in the link above (to donut, gingerbread, etc.) Links : https://bitly.com/bundles/rvyas/1
Framework source in eclipse Extract the android folder from  <tarball>/core/java/  into  android-sdk/platforms/<platform version>/sources/ Make sure the platform-version is the same as the android version of the tarball. Refresh project in eclipse  To test press Alt + Shift + T to check if you can view the activity class  Source : http://kmansoft.wordpress.com/2011/01/27/android-sources-for-debugging/
Alternate “cloud” source viewer Chrome extension : bit.ly/andsrcchrome 	Adds an 'ad' command to the Chrome Omnibox
Alternate “cloud” source viewer
Getting hands dirty
Getting hands dirty publicclassSeekBarextendsAbsSeekBar publicabstractclassAbsSeekBarextendsProgressBar mThumbOffset= thumb.getIntrinsicWidth() / 2; setThumbPos(getWidth(), thumb, scale, Integer.MIN_VALUE); setThumbPos(w, thumb, scale, 0); Modified code : http://bit.ly/andvsb
Getting hands dirty Story : HTTP Requests
Getting hands dirty publicabstractclassAsyncTask<Params, Progress, Result> { privatestaticfinal String LOG_TAG = "AsyncTask"; privatestaticfinalintCORE_POOL_SIZE = 5; privatestaticfinalintMAXIMUM_POOL_SIZE = 128; privatestaticfinalintKEEP_ALIVE = 10; privatestaticfinalBlockingQueue<Runnable> sWorkQueue = newLinkedBlockingQueue<Runnable>(10); privatestaticfinalThreadFactorysThreadFactory = newThreadFactory() { privatefinalAtomicIntegermCount = newAtomicInteger(1); public Thread newThread(Runnable r) { returnnew Thread(r, "AsyncTask #" + mCount.getAndIncrement());         }     };
Performance examples publicclassSQLiteDatabaseextendsSQLiteClosable Android implements locking in SQLiteDatabase - No point trying to hit the database from multiple threads - On the positive you don’t need to synchronize your 		  requests.
Questions? Thank you.

Weitere ähnliche Inhalte

Was ist angesagt?

Android Application Development
Android Application DevelopmentAndroid Application Development
Android Application DevelopmentKhaleel Jageer
 
Fuchsia operating system by google document
Fuchsia operating system by google documentFuchsia operating system by google document
Fuchsia operating system by google documentPRUTHVI RAJ BANDA
 
ANDROID TECHNOLOGY
ANDROID TECHNOLOGYANDROID TECHNOLOGY
ANDROID TECHNOLOGYshakil2604
 
Android Things Latest News / Aug 25, 2017
Android Things Latest News / Aug 25, 2017Android Things Latest News / Aug 25, 2017
Android Things Latest News / Aug 25, 2017Masahiro Hidaka
 
Android and android versions
Android and android versionsAndroid and android versions
Android and android versionsMegha Jain
 
Alternatives to Java for Android development
Alternatives to Java for Android developmentAlternatives to Java for Android development
Alternatives to Java for Android developmentttogrul
 
Future of android - Fuchsia OS
Future of android - Fuchsia OSFuture of android - Fuchsia OS
Future of android - Fuchsia OSPrasadKulkarni201
 
Tizen, Firefox OS and the Future of Android
Tizen, Firefox OS and the Future of AndroidTizen, Firefox OS and the Future of Android
Tizen, Firefox OS and the Future of AndroidOytun Eren Sengul
 
Google Fuchsia
Google FuchsiaGoogle Fuchsia
Google FuchsiaJai Sadana
 
Embedded Recipes 2019 - Overview of Fuchsia, a new operating system
Embedded Recipes 2019 - Overview of Fuchsia, a new operating systemEmbedded Recipes 2019 - Overview of Fuchsia, a new operating system
Embedded Recipes 2019 - Overview of Fuchsia, a new operating systemAnne Nicolas
 
The evolution of android from os 1.0 to lollipop
The evolution of android from os 1.0 to lollipopThe evolution of android from os 1.0 to lollipop
The evolution of android from os 1.0 to lollipopsomya sharma
 
Developing FOSDEM Companion
Developing FOSDEM CompanionDeveloping FOSDEM Companion
Developing FOSDEM Companioncbeyls
 
Introduction to Android (Jeudis du libre)
Introduction to Android (Jeudis du libre)Introduction to Android (Jeudis du libre)
Introduction to Android (Jeudis du libre)cbeyls
 

Was ist angesagt? (19)

Android
AndroidAndroid
Android
 
Android Application Development
Android Application DevelopmentAndroid Application Development
Android Application Development
 
Fuchsia operating system by google document
Fuchsia operating system by google documentFuchsia operating system by google document
Fuchsia operating system by google document
 
ANDROID TECHNOLOGY
ANDROID TECHNOLOGYANDROID TECHNOLOGY
ANDROID TECHNOLOGY
 
Android Things Latest News / Aug 25, 2017
Android Things Latest News / Aug 25, 2017Android Things Latest News / Aug 25, 2017
Android Things Latest News / Aug 25, 2017
 
01 02 - introduction - adroid stack
01  02 - introduction - adroid stack01  02 - introduction - adroid stack
01 02 - introduction - adroid stack
 
Android and android versions
Android and android versionsAndroid and android versions
Android and android versions
 
Alternatives to Java for Android development
Alternatives to Java for Android developmentAlternatives to Java for Android development
Alternatives to Java for Android development
 
Future of android - Fuchsia OS
Future of android - Fuchsia OSFuture of android - Fuchsia OS
Future of android - Fuchsia OS
 
Presentation2
Presentation2Presentation2
Presentation2
 
Versions of android
Versions of androidVersions of android
Versions of android
 
Tizen, Firefox OS and the Future of Android
Tizen, Firefox OS and the Future of AndroidTizen, Firefox OS and the Future of Android
Tizen, Firefox OS and the Future of Android
 
Google Fuchsia
Google FuchsiaGoogle Fuchsia
Google Fuchsia
 
Silverlight
SilverlightSilverlight
Silverlight
 
Embedded Recipes 2019 - Overview of Fuchsia, a new operating system
Embedded Recipes 2019 - Overview of Fuchsia, a new operating systemEmbedded Recipes 2019 - Overview of Fuchsia, a new operating system
Embedded Recipes 2019 - Overview of Fuchsia, a new operating system
 
The evolution of android from os 1.0 to lollipop
The evolution of android from os 1.0 to lollipopThe evolution of android from os 1.0 to lollipop
The evolution of android from os 1.0 to lollipop
 
Android Versions
Android VersionsAndroid Versions
Android Versions
 
Developing FOSDEM Companion
Developing FOSDEM CompanionDeveloping FOSDEM Companion
Developing FOSDEM Companion
 
Introduction to Android (Jeudis du libre)
Introduction to Android (Jeudis du libre)Introduction to Android (Jeudis du libre)
Introduction to Android (Jeudis du libre)
 

Ähnlich wie Know thy code: Framework secrets revealed

Docker Container As A Service - Mix-IT 2016
Docker Container As A Service - Mix-IT 2016Docker Container As A Service - Mix-IT 2016
Docker Container As A Service - Mix-IT 2016Patrick Chanezon
 
Droidcon uk2012 androvm
Droidcon uk2012 androvmDroidcon uk2012 androvm
Droidcon uk2012 androvmdfages
 
Scaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesScaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesRobert Lemke
 
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...Paris Open Source Summit
 
Android installation guide
Android installation guideAndroid installation guide
Android installation guidemagicshui
 
Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Tony Frame
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with PythonBrian Lyttle
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopmentgillygize
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspectiveGunjan Kumar
 
Life of a Chromium Developer
Life of a Chromium DeveloperLife of a Chromium Developer
Life of a Chromium Developermpaproductions
 
maXbox Arduino Tutorial
maXbox Arduino TutorialmaXbox Arduino Tutorial
maXbox Arduino TutorialMax Kleiner
 
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)Eric D. Schabell
 
lecture-2-android-dev.pdf
lecture-2-android-dev.pdflecture-2-android-dev.pdf
lecture-2-android-dev.pdfjakjak36
 
Kubernetes best practices
Kubernetes best practicesKubernetes best practices
Kubernetes best practicesBill Liu
 
Automated Image Builds in OpenShift and Kubernetes
Automated Image Builds in OpenShift and KubernetesAutomated Image Builds in OpenShift and Kubernetes
Automated Image Builds in OpenShift and KubernetesGraham Dumpleton
 
Devry gsp 215 week 7 i lab networking and a tiny web server new
Devry gsp 215 week 7 i lab networking and a tiny web server newDevry gsp 215 week 7 i lab networking and a tiny web server new
Devry gsp 215 week 7 i lab networking and a tiny web server newwilliamethan912
 
Command line for the beginner - Using the command line in developing for the...
Command line for the beginner -  Using the command line in developing for the...Command line for the beginner -  Using the command line in developing for the...
Command line for the beginner - Using the command line in developing for the...Jim Birch
 
C# Production Debugging Made Easy
 C# Production Debugging Made Easy C# Production Debugging Made Easy
C# Production Debugging Made EasyAlon Fliess
 
"Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko
"Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko "Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko
"Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko Fwdays
 

Ähnlich wie Know thy code: Framework secrets revealed (20)

Docker Container As A Service - Mix-IT 2016
Docker Container As A Service - Mix-IT 2016Docker Container As A Service - Mix-IT 2016
Docker Container As A Service - Mix-IT 2016
 
Droidcon uk2012 androvm
Droidcon uk2012 androvmDroidcon uk2012 androvm
Droidcon uk2012 androvm
 
Scaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesScaleable PHP Applications in Kubernetes
Scaleable PHP Applications in Kubernetes
 
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
 
Android installation guide
Android installation guideAndroid installation guide
Android installation guide
 
Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with Python
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopment
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
 
Life of a Chromium Developer
Life of a Chromium DeveloperLife of a Chromium Developer
Life of a Chromium Developer
 
maXbox Arduino Tutorial
maXbox Arduino TutorialmaXbox Arduino Tutorial
maXbox Arduino Tutorial
 
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
 
lecture-2-android-dev.pdf
lecture-2-android-dev.pdflecture-2-android-dev.pdf
lecture-2-android-dev.pdf
 
Kubernetes best practices
Kubernetes best practicesKubernetes best practices
Kubernetes best practices
 
Automated Image Builds in OpenShift and Kubernetes
Automated Image Builds in OpenShift and KubernetesAutomated Image Builds in OpenShift and Kubernetes
Automated Image Builds in OpenShift and Kubernetes
 
Devry gsp 215 week 7 i lab networking and a tiny web server new
Devry gsp 215 week 7 i lab networking and a tiny web server newDevry gsp 215 week 7 i lab networking and a tiny web server new
Devry gsp 215 week 7 i lab networking and a tiny web server new
 
Command line for the beginner - Using the command line in developing for the...
Command line for the beginner -  Using the command line in developing for the...Command line for the beginner -  Using the command line in developing for the...
Command line for the beginner - Using the command line in developing for the...
 
C# Production Debugging Made Easy
 C# Production Debugging Made Easy C# Production Debugging Made Easy
C# Production Debugging Made Easy
 
Intro to Android Programming
Intro to Android ProgrammingIntro to Android Programming
Intro to Android Programming
 
"Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko
"Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko "Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko
"Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko
 

Mehr von Ravi Vyas

What Product Market Fit is not
What Product Market Fit is notWhat Product Market Fit is not
What Product Market Fit is notRavi Vyas
 
Mobile Metrics and Analytics
Mobile Metrics and AnalyticsMobile Metrics and Analytics
Mobile Metrics and AnalyticsRavi Vyas
 
Key User Lifecycle Metrics for Growth & Engagement
Key User Lifecycle Metrics for Growth & EngagementKey User Lifecycle Metrics for Growth & Engagement
Key User Lifecycle Metrics for Growth & EngagementRavi Vyas
 
Android workshop
Android workshopAndroid workshop
Android workshopRavi Vyas
 
Why android first
Why android firstWhy android first
Why android firstRavi Vyas
 
Creating apps that work on all screen sizes
Creating apps that work on all screen sizesCreating apps that work on all screen sizes
Creating apps that work on all screen sizesRavi Vyas
 

Mehr von Ravi Vyas (6)

What Product Market Fit is not
What Product Market Fit is notWhat Product Market Fit is not
What Product Market Fit is not
 
Mobile Metrics and Analytics
Mobile Metrics and AnalyticsMobile Metrics and Analytics
Mobile Metrics and Analytics
 
Key User Lifecycle Metrics for Growth & Engagement
Key User Lifecycle Metrics for Growth & EngagementKey User Lifecycle Metrics for Growth & Engagement
Key User Lifecycle Metrics for Growth & Engagement
 
Android workshop
Android workshopAndroid workshop
Android workshop
 
Why android first
Why android firstWhy android first
Why android first
 
Creating apps that work on all screen sizes
Creating apps that work on all screen sizesCreating apps that work on all screen sizes
Creating apps that work on all screen sizes
 

Kürzlich hochgeladen

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
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
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 

Kürzlich hochgeladen (20)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
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
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
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
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 

Know thy code: Framework secrets revealed

  • 1. Know thy code Framework
  • 2. Know thy code ???.* What we wont know after this talk Code review secrets Know my code What we will learn from it ( Hopefully ) How to make better use of framework source How to make new components from the framework Framework
  • 3. Android – Open Source Android has been available under a free software/open source license since October, 21 2008 Google published the entire source code (including network and telephony stacks) under an Apache License.
  • 4. Android – Open Source Source available at source.android.com. Source is a bunch of git projects. Google built repo on top of git. Souce is ~3GB , needs ~10GB to build. Currently only builds on Linux and Mac
  • 5. What code will we be seeing
  • 6. Framework source in eclipse Source code from major release-specific branches can be downloaded like this: http://android.git.kernel.org/?p=platform/frameworks/base.git;a=snapshot;h=refs/heads/froyo;sf=tgz You can get other versions by changing the branch name (froyo) in the link above (to donut, gingerbread, etc.) Links : https://bitly.com/bundles/rvyas/1
  • 7. Framework source in eclipse Extract the android folder from <tarball>/core/java/ into android-sdk/platforms/<platform version>/sources/ Make sure the platform-version is the same as the android version of the tarball. Refresh project in eclipse To test press Alt + Shift + T to check if you can view the activity class Source : http://kmansoft.wordpress.com/2011/01/27/android-sources-for-debugging/
  • 8.
  • 9. Alternate “cloud” source viewer Chrome extension : bit.ly/andsrcchrome Adds an 'ad' command to the Chrome Omnibox
  • 12. Getting hands dirty publicclassSeekBarextendsAbsSeekBar publicabstractclassAbsSeekBarextendsProgressBar mThumbOffset= thumb.getIntrinsicWidth() / 2; setThumbPos(getWidth(), thumb, scale, Integer.MIN_VALUE); setThumbPos(w, thumb, scale, 0); Modified code : http://bit.ly/andvsb
  • 13. Getting hands dirty Story : HTTP Requests
  • 14. Getting hands dirty publicabstractclassAsyncTask<Params, Progress, Result> { privatestaticfinal String LOG_TAG = "AsyncTask"; privatestaticfinalintCORE_POOL_SIZE = 5; privatestaticfinalintMAXIMUM_POOL_SIZE = 128; privatestaticfinalintKEEP_ALIVE = 10; privatestaticfinalBlockingQueue<Runnable> sWorkQueue = newLinkedBlockingQueue<Runnable>(10); privatestaticfinalThreadFactorysThreadFactory = newThreadFactory() { privatefinalAtomicIntegermCount = newAtomicInteger(1); public Thread newThread(Runnable r) { returnnew Thread(r, "AsyncTask #" + mCount.getAndIncrement()); } };
  • 15. Performance examples publicclassSQLiteDatabaseextendsSQLiteClosable Android implements locking in SQLiteDatabase - No point trying to hit the database from multiple threads - On the positive you don’t need to synchronize your requests.

Hinweis der Redaktion

  1. Apologize
  2.  Repo unifies the many Git repositories when necessary, does the uploads to our revision control system, and automates parts of the Android development workflow. Repo is not meant to replace Git, only to make it easier to work with Git in the context of Android. The repo command is an executable Python script that you can put anywhere in your path