Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

First Do No Harm - 360|AnDev

298 views

Published on

Developing Android applications is a powerful way to connect people with the information they need the most. Unlike doctors, we were not required to take an oath or pledge when becoming Android Developers. However, we can still learn much from the principles behind the phrase, “First, do no harm.” In this talk, we will discuss over a dozen tools that are at your disposal as a developer which can enable you to provide high quality applications to your users. We start out by covering items you can use to increase your Android know-how. Next we move on to five techniques for keeping bugs our of your applications. Finally, we cover the best tools available for tracking down issues when they do arise. Thus allowing you to first, do no harm!

Published in: Technology
  • Be the first to comment

First Do No Harm - 360|AnDev

  1. 1. @brwngrldev
  2. 2. What’s Involved: • Major in Math/Science • Take the MCAT • Go to Medical School • Take the USMLE Step 1 • Do Rotations • Take the USMLE Step 2 • Complete Internship • Do Residency • Take the USMLE Step 3 • Take the Board Exams • Do a Fellowship @brwngrldev
  3. 3. @brwngrldev
  4. 4. @brwngrldev
  5. 5. How can I become an Android Developer? @brwngrldev
  6. 6. How can I become a great Android Developer? @brwngrldev
  7. 7. @brwngrldev
  8. 8. @brwngrldev
  9. 9. Newsletters @brwngrldev
  10. 10. Podcasts @brwngrldev
  11. 11. Online Courses • At your own pace • All aspects of development • Different perspectives @brwngrldev
  12. 12. Online Courses - Udacity @brwngrldev
  13. 13. Online Courses - Caster.IO @brwngrldev
  14. 14. “…associate with eagles, you will learn how to soar…” - Ojo Michael E. @brwngrldev
  15. 15. Conferences • Hear from the Experts • Grow your Network • Learn new Techniques @brwngrldev
  16. 16. Conferences
  17. 17. Open Source • Countless Examples • Learn by Doing • Design Patterns in Action @brwngrldev
  18. 18. Open Source @brwngrldev
  19. 19. Open Source @brwngrldev
  20. 20. Study • Newsletters • Podcasts • Online Courses • Conferences • Open Source @brwngrldev
  21. 21. @brwngrldev
  22. 22. @brwngrldev
  23. 23. Prevention • Static Code Analysis • Code Reviews • Leak Canary • Testing @brwngrldev
  24. 24. Static Code Analysis Lint Checkstyle FindBugs PMD @brwngrldev
  25. 25. Static Code Analysis 0 40 80 120 160 Checkstyle FindBugs PMD Error Prone Lint @brwngrldev
  26. 26. Static Code Analysis - FindBugs @brwngrldev
  27. 27. Static Code Analysis - FindBugs @brwngrldev
  28. 28. Code Reviews @brwngrldev
  29. 29. Code Reviews @brwngrldev
  30. 30. Code Reviews @brwngrldev
  31. 31. Code Reviews Here’s my awesome code! ! Cool, looks like line 54 could cause an NPE though. @brwngrldev
  32. 32. Code Reviews Here’s my awesome code! Oh yeah, you’re right. Will fix! ! Cool, looks like line 54 could cause an NPE though. @brwngrldev
  33. 33. Code Reviews Here’s my awesome code! Oh yeah, you’re right. Will fix! Thanks for not `let`ting me forget that! 😂 ! Cool, looks like line 54 could cause an NPE though. Instead of an `if` here, a `let` would be better. @brwngrldev
  34. 34. Code Reviews @brwngrldev
  35. 35. Leak Canary debugCompile “…:leakcanary-android:$leak”
 releaseCompile “…:leakcanary-android-no-op:$leak”
 testCompile “…:leakcanary-android-no-op:$leak” @brwngrldev
  36. 36. Leak Canary private BooksAdapter booksAdapter;
 
 @Bind(R.id.recyclerView)
 RecyclerView recyclerView;
 
 private static Toolbar toolbar;
 
 private BooksPresenter booksPresenter; @brwngrldev
  37. 37. Leak Canary @brwngrldev
  38. 38. Architecture @brwngrldev
  39. 39. Architecture Foo Foo Bar Baz @brwngrldev
  40. 40. MVP + Dagger @brwngrldev
  41. 41. MVP + Dagger @brwngrldev EVENT BUS/RXJAVA DATABASE REPOSITORY REPOSITORY ACTIVITY FRAGMENT PRESENTER PRESENTER SERVICE
  42. 42. API Testing
  43. 43. API Testing - Postman @brwngrldev
  44. 44. API Testing - Postman 1.Send Requests 2.Receive Response 3.Run Test Scripts @brwngrldev
  45. 45. Sending Requests @brwngrldev
  46. 46. API Response [
 {
 "userId": 1,
 "id": 1,
 "title": "sunt aut facere repellat",
 "body": "quia et suscipitnsuscipit recusandae"
 },
 {
 "userId": 1,
 "id": 2,
 "title": "qui est esse",
 "body": "est rerum tempore vitaensequi sint"
 }
 ] https://jsonplaceholder.typicode.com @brwngrldev
  47. 47. Test - Status Code tests["Status code is 200"] = responseCode.code === 200; @brwngrldev
  48. 48. Test - Schema var schema = {
 "type": [“array”, “null”]
 }; var jsonData = JSON.parse(responseBody); tests["Valid Schema"] = tv4.validate(jsonData, schema); @brwngrldev
  49. 49. IT GETS BETTER @brwngrldev
  50. 50. Test - Schema @brwngrldev 
 {
 "userId": 1,
 "id": 1,
 "title": "sunt aut facere repellat provident",
 "body": "quia et suscipitnsuscipit recusandae"
 }
  51. 51. Test - Schema var postSchema = {
 "type" : "object",
 "properties" : {
 "userId": { "type" : "integer" },
 "id": { "type" : "integer" },
 "title": { "type" : "string" },
 "body" : { "type" : "string" }
 }
 }; @brwngrldev
  52. 52. API Testing @brwngrldev
  53. 53. Set Up Monitors @brwngrldev
  54. 54. Prevention • Static Code Analysis • Code Reviews • Leak Canary • Testing @brwngrldev
  55. 55. @brwngrldev
  56. 56. 74 year old stomach pain 34 year old stomach pain @brwngrldev
  57. 57. @brwngrldev
  58. 58. @brwngrldev
  59. 59. @brwngrldev
  60. 60. LET’S SHARE @brwngrldev
  61. 61. Code Outside InsideEmulator
  62. 62. CODE @brwngrldev
  63. 63. @Override public void onFailure(Call<Book> call, Throwable t) { bus.post(new BookLoadingErrorEvent(id)); Timber.e(t, "Unable to load the book data from API."); } Write Logs @brwngrldev
  64. 64. Logcat/Pidcat @brwngrldev
  65. 65. @brwngrldev
  66. 66. Log Events public void trackEvent(String event) { analytics.track(event); if (Fabric.isInitialized()) { Crashlytics.log(event); } } @brwngrldev
  67. 67. Crashlytics @brwngrldev
  68. 68. OUTSIDE @brwngrldev
  69. 69. Crashlytics @brwngrldev
  70. 70. Crashlytics @brwngrldev
  71. 71. Classy Shark @brwngrldev
  72. 72. Classy Shark @brwngrldev
  73. 73. Battery Historian @brwngrldev
  74. 74. Battery Historian @brwngrldev
  75. 75. Battery Historian @brwngrldev
  76. 76. @brwngrldev
  77. 77. Systrace @brwngrldev
  78. 78. Systrace Alerts Pane @brwngrldev
  79. 79. Systrace Alert Detail @brwngrldev
  80. 80. INSIDE @brwngrldev
  81. 81. Apk Analyzer @brwngrldev
  82. 82. Android Profiler @brwngrldev
  83. 83. Android Profiler: Memory @brwngrldev
  84. 84. Android Profiler: CPU @brwngrldev
  85. 85. @brwngrldev
  86. 86. Android Profiler: Network @brwngrldev
  87. 87. EMULATOR @brwngrldev
  88. 88. Android Options: GPU Overdraw blue -> green -> light red -> dark red (1x) (4x or more) @brwngrldev
  89. 89. Android Options: GPU Overdraw @brwngrldev blue -> green -> light red -> dark red (1x) (4x or more)
  90. 90. Android Options: Profile GPU Rendering 16 milliseconds @brwngrldev
  91. 91. Android Options: Profile GPU Rendering https://developer.android.com/studio/profile/dev-options-rendering.html@brwngrldev
  92. 92. @brwngrldev
  93. 93. @brwngrldev
  94. 94. Resources • http://www.kotlinweekly.net - Kotlin Weekly • http://androidweekly.net - Android Weekly • https://www.androiddevdigest.com - Android Dev Digest • http://www.adavis.info/2015/07/android-devs-listen-up.html - Podcasts • https://www.udacity.com - Udacity • https://caster.io - Caster.IO • http://androidstudygroup.github.io/conferences - Android Conferences
  95. 95. Resources • http://findbugs.sourceforge.net - FindBugs • https://github.com/square/leakcanary - Leak Canary • https://www.getpostman.com - Postman • https://github.com/JakeWharton/timber - Timber • https://github.com/JakeWharton/pidcat - Pidcat • https://fabric.io/kits/android/crashlytics - Crashlytics • https://www.lynda.com/trial/AnnyceDavis - Lynda.com
  96. 96. Resources • https://github.com/google/android-classyshark - ClassyShark • https://github.com/google/battery-historian - Battery Historian • https://developer.android.com/studio/profile/systrace.html - Systrace • https://developer.android.com/studio/build/apk-analyzer.html - APK Analyzer • http://www.adavis.info/2015/03/android-overdraw-what-is-it-and-why.html - Overdraw • https://developer.android.com/studio/profile/dev-options-rendering.html - GPU Rendering

×