Learning what matters: Android
A lot of people asked me what they should do if they want to become solid middle-level Android engineers. Below you can find a somewhat step-by-step guide for an interesting journey into the mobile development.
Read Core Java by Cay Horstmann. Do a small project of your choice in plain Java. Maybe basic GUI. Areas to cover:
- Inheritance, interfaces, abstract classes
- Data types (primitives vs objects, integer types like BigInteger)
- String operations
- Intricacies of Java (e.g. foreach loops, static initializers, finalize, package scopes)
- Collections and differences between implementations (Set, List, Map, Queue, Stack, etc)
- Comparable and Sorting
- Inner classes and memory leaks they cause
- Exceptions class hierarchy and handling exceptions
- Generics & type erasure
- Multithreading (Thread class, Runnable, synchronize, Atomic types, Threadpool executors)
- Basic understanding of GUI render pipeline in Java (this will help with Android)
- Distribution of binaries: jars, Manifest file, publishing artifacts to sonatype/jcenter/etc
- Meta programming: code generation + annotation processors
- Build tools: gradle, maven
Read Busy Coders Guide by Mark Murphy. Write Android application only when you’re comfortable with components of Android (activity, service, broadcast receiver and contentprovider)
Areas to focus on:
- Communication between Android components (activity -> service and back, try all things possible here)
- Understand the design flaws of Android (e.g. god object anti-pattern) and why it’s affecting the development
- Understand how lifecycle of Android app is different from desktop and how to adapt your code to this lifecycle without causing memory leaks and unnecessary memory usage
- Android ViewGroups, Views, support framework (CoordinatorLayout, PercentRelativeLayout and etc.)
- Apply previous Java concepts to writing Android app
Read Design Patterns by Gang Of Four and also research about testing your code. Write tests for your previous app, get branching coverage >=90%. Understand from your practice that writing testable code is as much about tests as it is about design and architecture. If design patterns book was not enough and you want more read Patterns of Enterprise Application Architecture by Martin Fowler.
- Popular design patterns and why it’s easier to test code this way (Factory, Decorator, Delegate etc)
- Junit, Robolectric, Espresso
- Dependency Injection (Dagger 2)
Start with a bit of history overview, then read Clean Code and Clean Coder by Robert Martin. Check how this architecture addresses the maintainability and testing of your code. Refactor accordingly your app.
- MVx (MVC, MVP, MVVM + databinding)
- Routing in the app
- domain and interactors
- data and repository + source pattern
Read about functional programming. Read how Rx was born as subproject in Microsoft. Read RxJava Essentials by Ivan Morgillo. What all of these do no cover is how to test functional code in an object-oriented language, so go to the source code of RxJava and check how they test it
- Understand how reactive approach compares to using callbacks between clean architecture layers
- Understand the differences in reactive operators
- Try to debug you reactive code and investigate stack traces
The edge of client code (the network API)
Read REST books about how API’s are designed and how to address common problems with asynchronous systems. O’Reilly has a lot of books on this subject, e.g. REST API Design Rulebook by Mark Masse or RESTful Web APIs by Leonard Richardson, Mike Amundsen, Sam Ruby.
In your development you’ll probably communicate with API using one of the following, so read about it:
- 1 way communication (HTTP(S))
- 2 way communications (websocket, spdy, http 2.0)
- systems like apache usergrid, apigee, parse.com, google cloud engine and gRPC
Get to know open source community + 3rd party libraries people and companies are providing and maintaining
- Popular libraries (dagger 2, retrofit, robolecric, fresco, picasso, glide, okhttp)
- Analytics (fabric, google analytics, firebase analytics, mixpanel, etc)
- A/B testing
- git (progit) + github.com (forking, PR’s, git successful branching)
- CI (Jenkins, TeamCity), scripting languages like Ruby
- apache commons and google guava
- Android emulator + genymotion
- Gradle (e.g. writing custom build steps), Buck + okBuck
- Profiling your app and searching for memory leaks: hierarchyviewer for render debugging, Eclipse Memory Analyzer for checking where you’ve allocated so much memory
- IntelliJ shortcuts for refactoring and navigation
- Using adb and different things you can do with it (e.g. running activity with specified params)
- Static analysis tools (lint, pmd, findbugs, sonarqube, etc)
- Android support library
- Google play services (+ what happens when you have device without google play)
- Android vector graphics support
- Advanced code generation (autovalue, parcelable, etc.)
- Mocking in tests (mockito, powermock)
- NDK and JNI
- Emerging languages for Android development: Scala, Kotlin, Swift, etc.
At each step try to see how other apps implement this, e.g. go to libraries source code and look, e.g. https://github.com/nickbutcher/plaid. Good writers become even better when they’re reading a lot, writing code is no exception.
Check who are the best people in the field (https://developers.google.com/experts/all/technology/android) and learn from their experiences: check their blogs, conference talks, etc.
Look for android conferences focused on knowledge sharing: Droidcon, Devoxxx, etc.
Check http://androidweekly.net/ for weekly source of new trends in Android
Check podcasts for discussions: https://github.com/artem-zinnatullin/TheContext-Podcast, http://fragmentedpodcast.com/
This list by no means can be considered comprehensive, it’s more of a direction for your own journey.