Andriod dev toolbox part 2

Staff Full Stack Engineer at WeWrok
Jan. 21, 2016

More Related Content


Andriod dev toolbox part 2

  1. Android dev toolbox II AVGeeks, 2016
  2. Shem Magnezi @shemag8 |
  3. Part 1 Libraries
  4. Part 2 Tools
  5. Why use external tools? ▣ Same as libraries- don't reinvent the wheel.
  6. Why not? ▣ Proprietary solutions (Outsource them, style!)
  7. Systrace Collects system and application process execution data and generates detailed, interactive reports from devices
  8. Allocation tracking Monitor where objects are being allocated when you perform certain actions
  9. Trace view Traceview can help you debug your application and profile its performance.
  10. Hierarchy Viewer Visualizes your app's view hierarchy and profiles the relative rendering speed for each view.
  11. Developer options Realtime on device debugging.
  12. Hugo Annotation-triggered method call logging for your debug builds. @DebugLog public String getName(String first, String last) { SystemClock.sleep(15); // Don't ever really do this! return first + " " + last; } V/Example: ⇢ getName(first="Jake", last="Wharton") V/Example: ⇠ getName [16ms] = "Jake Wharton"
  13. Leak Canary A memory leak detection library for Android and Java. public class ExampleApplication extends Application { @Override public void onCreate() { super.onCreate(); LeakCanary.install(this); } }
  14. Phone Home Standalone library that sends logs from remote Android devices to a central server for debugging. PhoneHomeConfig.getInstance() // enable or disable log flushing .enabled(false) // wait for this many log events before flushing ... .batchSize(100) // ... or until this many seconds have passed between flushes .flushIntervalSeconds(1800) // when developing, log all messages to logcat, then flush everything to the sink .debugLogLevel(android.util.Log.VERBOSE) // in production, only log INFO messages and above to logcat, then flush everything to the sink .productionLogLevel(android.util.Log.INFO) // specify the sink that receives flushed logs. Required if you enable log flushing .logSink(new PhoneHomeSink() { public void flushLogs(final List<PhoneHomeLogEvent> logEvents) { // flush log events to your backend } });
  15. Probe Android applications performance testing tool. python --package --activity TheActivityToRunProbeOn --repeat-count x -- timeout y
  16. Magneto Magneto allows you to write smart and powerful tests for Android apps.
  17. Monkey testing adb shell monkey -p -v 500 The Monkey is a program that runs on your emulator or device and generates pseudo-random streams of user events such as clicks, touches, or gestures, as well as a number of system-level events. You can use the Monkey to stress-test applications that you are developing, in a random yet repeatable manner.
  18. Stetho A debug bridge for Android applications
  19. Espresso APIs for writing UI tests to simulate user interactions within a single target app. @Test public void changeText_sameActivity() { // Type text and then press the button. onView(withId( .perform(typeText(mStringToBetyped), closeSoftKeyboard()); onView(withId(; // Check that the text was changed. onView(withId( .check(matches(withText(mStringToBetyped))); }
  20. Robolectric A unit test framework that de-fangs the Android SDK jar so you can test-drive the development of your Android app @RunWith(RobolectricTestRunner.class) public class MyActivityTest { @Test public void clickingButton_shouldChangeResultsViewText() throws Exception { MyActivity activity = Robolectric.setupActivity(MyActivity.class); Button button = (Button) activity.findViewById(; TextView results = (TextView) activity.findViewById(; button.performClick(); assertThat(results.getText().toString()).isEqualTo("Robolectric Rocks!"); } }
  21. Part 3 Resources
  22. Android Arsenal
  23. Droid Toolbox
  24. MaterialUp
  25. Android For Devs
  26. Android library statistics (By Appbrain)
  27. Android Developers Blog
  28. Google Developers @Medium
  29. The developer show
  30. Android Weekly
  31. Part 4 People
  32. Nick Butcher Design/Developer Advocate @ Google @crafty Chet Hasse Android animator @ Google @chethaase Chiu-Ki Chan Android developer, public speaker @chiuki Romain Guy Working on awesome stuff at Google @romainguy Roman Nurik Designer @ Google @romannurik Kelly Shuster Android Engineer, Public speaker & tech diversity advocate. @kellyshuster
  33. Ian Lake Developer Advocate @ Google @ianhlake Joanna Smith Developer Advocate @ Google @dontmesswithjo Yigit Boyar UI toolkit team @Android/ Google @yigitboyar Lisa Wray Android @ Genius (prev Google & NYT) @lisawrayz Jake Wharton open source practitioner and contributor, @square @jakewharton Colt McAnlis Developer Advocate @ Google @duhroach
  34. Thanks! Any questions? You can find this presentation at: Presentation template by SlidesCarnival | Photographs by Unsplash