SlideShare uma empresa Scribd logo
1 de 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.

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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)
 

Semelhante a 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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
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
 

Semelhante a 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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
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
 

Mais de 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
 

Mais de 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
 

Último

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 

Último (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 

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.

Notas do Editor

  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