Droidcon Toronto 2019
Tags: android, droidcon, conference, software
Published: 2019-11-22 11:33:54


It was an arctic Wednesday morning in the city of Toronto and as I stepped down from my commute, a new sense of excitement dawned on me. It was the first-ever droidcon conference in Toronto. For the past nine years, AndroidTO held the reputation of being the largest Android conference in Canada. It was not that long, when the news broke out that AndroidTO was no longer a thing and droidcon would be hosting the android conferences instead. Droidcon, if you’re not familiar, is the largest Android community that organizes more than 25 droidcon conferences around the world attracting more than 25,000 attendees. This was surely an exciting news.

My day started at the registration booth, where I was greeted by the wonderful volunteers that provided me with a swag bag filled with stickers and a shirt. The conference had more than 15 talks scheduled, some that ran in parallel, so picking the talks that I would love to listen to became my strategy. Overall, the conference covered a large variety of topics ranging from Kotlin, Testing, UI to even development in Flutter. In this blog post, I go through some of the things I learned and enjoyed at droidcon Toronto 2019.

## HTTP in a Hostile World

In the first talk of the day, Jesse discussed the pain points of networking within the Android ecosystem. For instance, the concept of idempotence arose, suggesting that a repeating request should not repeat an action. This is essential to an application that is initiating a network call, but ends up executing it multiple times through a double-tap or retry-mechanism that lies on the client or network side.

Debugging issues regarding networking can be a challenge. If a failure does occur, it can be hard to pinpoint whether it’s a client or server side issue. With that in mind, developers have to ensure that their applications are both correct and secure for their users.

One of the ways this can be achieved is through a library called OkHttp. OkHttp is a HTTP client to execute network calls without implementing a larger boilerplate and contains support for modern TLS features. In addition, the library includes a MockWebServer, that can be used to test the client. This can be useful as both client and server teams can validate and maintain the suite of mocked server responses.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/r6ppnjqqk50lk6ags70o.JPG)

In addition, Jesse believes that developers have a large responsibility in protecting their user’s data. It is important to question whether all of the data that is being collected is actually required and if so, when can it be deleted. Complying with an existing privacy standards, such as GDPR and CCPA ensures that a user’s privacy is protected at all times.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/dokjp45cyb7eyqw1ksr5.JPG)

## Fighting Regressions with Benchmarks in CI

For the most part, performance tests are often neglected in software development. Often there are no metrics on performance, until a user reports a laggy UI or something that does not render smoothly. A lot of the performances issues can be discovered earlier in the development cycle through the Benchmark library.

Benchmark tests allow you to measure your code performance and generate a set of results that can be examined and compared over time. Most importantly, these checks can be embedded in a range of automated suites during the continuous integration pipelines. The main use case of benchmarking primarily lies on testing recycler views, inflations of views and performing database queries.

The talk by Chris and Dustin was a repeat of an earlier presentation from Android Dev Summit. I would highly encourage to view their presentation and blog post explaining Benchmark in more detail below.



Read more about Fighting Regression with Benchmarks in CI [presentation](https://www.youtube.com/watch?v=ynBPcFs6OOk) and [blog post](https://medium.com/androiddevelopers/fighting-regressions-with-benchmarks-in-ci-6ea9a14b5c71)


## Testing Beyond Unit, Integration and E2E

Our applications are validated through a series of unit, integration and e2e testing that check for correctness under normal and extreme cases. In this talk, Jimmy explores a new dimension of e2e testing called screenshot testing.

With the current state of e2e testing, Espresso does a great job at identifying the correctness of the UI through matchers. These matchers check whether a certain view is shown, clickable and has the desired set of values. However, theses tests often miss out on the look and feel of the UI.

Screenshot testings validates whether the UI is perceived correctly or not. It is often hard to catch issues that correlate to colours, styles and spacing of certain UI elements. Screenshot testings compares the screenshot of the current state of the application with a set of pre-validated screenshots, to check whether the UI has been changed. With pixel-to-pixel matching, detecting incorrect font, colour or spacing can alert the developer earlier in the feedback loop and help teams deliver a consistent design experience for their users.


![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/zb5hffvpx40tmnf52lng.JPG)


## “Why is everyone else smarter than me?”: Dealing with Imposter Syndrome

This was one of the most interesting talks of the day. Phil shares his experience with imposter syndrome and how it affects his productivity throughout his day. Imposter syndrome is the inability to accept one’s success and having the constant fear of being exposed as a fraud. Dealing with imposter syndrome can be a challenging experience, especially when starting a new job.

Often the case, a negative mindset starts to set in place and thoughts like “Everyone at work is a lot smarter than me” and “I have tricked them into hiring me” starts to formulate. Phil debunks these negative thoughts and claims that we often set a higher expectation of ourselves than what others expect from us. To deal with imposter syndrome, the focus of fear has to be transformed into a growth mindset. For instance, even if a lot of my co-workers are smarter than me, this is a great opportunity for me to learn from those around me.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/ttrmx7nxj2hymv6om9yk.JPG)

Everyone has faced imposter syndrome of some sort in the past. Some insights to deal with it is to write or talk about negative thoughts, keep a list of achievements and ask for feedback to facilitate the growth mindset. But one fact to accept that it is impossible to know everything.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/ttrmx7nxj2hymv6om9yk.JPG)

## Diffusing Changes in your APK

Back to Android! Releasing an Android application requires the generation of an APK. An APK contains a lot of information regarding the state of the application. As developers roll out new versions of their application, they may not be familiar of how much their APK may have changed. In this talk, Jake showcases his tool, Diffuse, that provides a comparison between two APKs. The comparison can outline the changes in the resource types within the APK as well as the count of string, types, classes and method in the compiled classes.

The tool is meant to be used as an additional check on the state of the APK on small changes, such as updating the Dagger library in a SDK Search app. The table below showcases a decrease in APK size through that change. In addition to size and count values, the tool also provides a lint check on the state of the APK.

Check out [Diffuse on GitHub](https://github.com/JakeWharton/diffuse)

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/wjnzd2t9xh4gqhs9qpr3.JPG)

## Conclusion
Alas, the day has come to end. Droidcon provides a great opportunity to learn, network and have fun all within the timespan of one day. The speakers were brilliant, the talks were informative and the volunteers were wonderful.

Pro tips:
- Don’t be shy approaching the speakers after their talks
- Attend talks that you normally would not attend
- Say hi to a random stranger beside you

Till next droidcon…