A Developer’s Take On Google IO Day 1
Every year, Google brings together thousands of developers, designers, press, etc. to Google IO to learn about new initiatives and projects coming out. This year was no different.
Yesterday, May 16th was badge pickup day or “Day Zero” of the conference. At 5:30AM I woke up in San Francisco and ventured down to Mountain View to pick up my badge. The seating for the main Google Keynote was first-come-first-serve meaning the earlier I got there, the better seat I’d get.
Upon approaching the main line, it wrapped around a corner I could not see. I assumed the line was pretty long as this was around 6:30AM. At 7:00AM the line started moving and I was shocked. The line was not long at all.
As you can see above, it actually was not crowded at all. Not like 2015 in San Francisco’s Moscone Center.
After what seemed like a very long line, it turned out to be not that bad. For the main keynote, I got placed in Section 101, the closest section to the stage!
Day 1
Early this morning on May 17th, I arrived back at Mountain View to attend the main keynote:
A lot of topics were mentioned in his part of the keynote. First what I learned is Google is getting scary good at image recognition, AI, and smart devices. They showed an example of a picture of a child playing softball behind a chain link fence. The fence obstructed the view of the child, yet they showed something eerily similar to SnapChat’s new magic eraser, except it looked way better.
Also, they have this new feature called Lens which allows you to easily scan objects using the camera for content and do certain actions on them. They showed how it can recognize flowers, or also scan content on the active camera and help you log into WIFI with passwords displayed, for example.
There were many other exciting general announcements that you can read on, however in this post, I would like to highlight the major changes coming to Android development, and it has got me REALLY excited.
KOTLIN
The highlight of the Keynote for us Android developers was now Kotlin is a first-class language for Android! When it was announced you could hear a large gasp in the crowd as it was announced and then immediate roaring applause when the Kotlin slide came up. What this means for developers is that we get a modern, null-safe, and concise language for Android development, putting us on par with Swift for iOS. It’s also 100% interoperable with Java so you can start today and keep existing codebases.
Later at the Developer Keynote they mentioned their continuing commitment to new Java features. It received a very tepid reaction from the crowd and that could have signaled to anyone in the room how we developers felt about Java support. My guess is within a year at next IO, most of the content will be in Kotlin and most professional Android developers will use it in varying capacities. The remaining 5%, companies with a huge codebase and lots of legacy code, will stick around for awhile and maybe never go away. Most, if not all new Android developers will start with Kotlin. If you are reading this and haven’t tried Kotlin, I highly suggest you read up on the language here and decide for yourself if you want to start using it. For me, I am always moving forward and do not want to get left behind.
New Android Architecture Components to Speed Up Development
After both regular and developer keynote, I attended the “Intro to Architecture Components” session. In this session, Google developers explained three distinct problems that they are intending on fixing and making much easier for Android development. They introduced “Architecture Components” which will comprise a set of standard libraries (supposedly more to come) to express opinion on how we should architect applications. First, they agree with most developers that lifecycles are too complex and lead to a lot of spaghetti Activity
and Fragment
code (given you don’t use a pattern like MVVM or MVP). This library will enable lifecycle-aware components and classes such as LiveData
. They abstracted away a common, core lifecycle that LiveData
uses to automatically know and call disposal methods without the end developer caring about the Android-specific lifecycle. This is great for testing. Also, they debuted theViewModel
class. The ViewModel
class provides common functionality for your app to implement the MVVM pattern. If you are using MVVM, this is great! For MVP users, you don’t have to use this library. However, it takes configuration changes into account and persists the ViewModel
between these changes and removes their instances for you automatically when they’re no longer needed. Wonderful!
The second problem the Architecture Components aim to solve is SQLite database storage. They announced Room, a SQLite ORM mapping solution for Android that removes the boilerplate away from SQLite. Currently the main developer webpage for SQLite looks something like this:
It’s hard to read, can lead to a lot of mistakes, and is not well maintained. (On a side note, I am doing a talk at a meetup at Google Launchpad on Friday about DBFlow, a similar, but different library than what they announced). However, what is great about Room, is that it employs a similar strategy to Retrofit in that it has you define interfaces into calls for your data. Also from this you define model classes with annotations, which mirrors other ORM library implementations. It’s great that they finally acknowledged the current state of SQLite, and are finally putting effort into improving it for everyone. An example from the newly launched website:
The final problem Architecture Components aim to solve is supply high level app architecture using the Repository pattern in a standard way.
This architecture very closely mirrors how my typical app architecture looks, and it does well for the ego :o. In this diagram, from the top to the bottom, the data flow is unidirectional. The Controller
only knows about the ViewModel
. The ViewModel
only knows about the Repository
, etc. This way at each stage, you can mock out each component, in a testable way using interfaces or Mockito
. More to come in the later days about these components and how they work in-depth.
Key Takeaways from Today
- Kotlin got the loudest applause. Huge Android developer crowd and likely many are using, wanting to use, or have seen Kotlin in many shapes and forms the past couple years. The largest frustration for us is main design decisions with Java and Android and how verbose and error-prone Java can be.
- The organization is WAY better than in years past. We can finally reserve seats to talks. Two years ago (the last IO at the Moscone Center), the lines were so bad people were attending talks one or two in advance just to have a seat for a future talk they wanted to hear. Then there were lines at each talk where people were waiting to get in, only to realize that people from the previous talk were not leaving their seats. It was bad and greatly diminished my conference experience. This year its like they really listened. Not only can we reserve seats, they added standby lines and saved seats for standby people. Also, they increased the size of the venues so much so, that they are almost have too many seats.
3. There are a lot of people. Most of the walkways between talks are packed and it is tough to walk around.
4. The after party was a great time.