The title got your attention didn’t it? Now don’t worry, this isn’t clickbait. In the following article I am going to tell you everything you need to know about what it takes to become a professional Android developer. However, don’t think you will just be able to close your eyes and somehow one year from now you will be in this position – it is going to take a lot of work. Achieving this quickly is going to require dedication and a strict routine. In my opinion, you will need to set aside 2 – 4 hours a day, at least 5 days a week, to studying. For 99.9% of people – this is completely doable. Also, if you have intermediate programming knowledge, this can be done in 6 months or less.
When should I study?
Whenever you can set aside a solid window of time. For most people in school or those with a full-time job, the best time would be in the evening. In the case of students, just dedicate at least 2 hours a day on top of your normal studies. Do not be tempted to go out and get wasted on the weekend, or even worse, during the week. You have little to gain and a lot to lose by engaging in this behavior – I’ve been there and it’s not worth it.
For those with a fulltime job – I know this can be extremely difficult. By the time you get home from work you are probably already exhausted. This feeling can be exacerbated if you are working a job you don’t like. On top of this, you need to make dinner and wash the dishes (if you are not blessed by the holy invention known as the dishwasher). I feel your pain. However, there are a few ways to remedy this situation.
If you are living with a girlfriend or boyfriend, explain your situation to them. Any decent partner would be more than willing to help you during this time. This isn’t a cue for you to sit on your ass all day everyday though. Be sure to be appreciative and help out when you can. Another solution is meal prep. You can prep meals on a Sunday and go the whole week with dinner (or lunch) ready to go in under 15 minutes. I have never tried prepping meals myself, but I have heard it to be an effective solution on cutting time spent in the kitchen.
How should I study?
This is a big one. The most effective way of learning is by doing. Not reading a 1000 page book and then trying to write a piece of software immediately after. For learning Android development, I would simply download Android Studio and try to do something. Even if you don’t understand anything – don’t worry, this is still a better approach then the one mentioned above. When your lack of knowledge blocks you from proceeding – this is the best time to start reading or watching tutorials.
I should also mention the best time management method I’ve ever used when studying – the pomodoro method. The pomodoro technique is basically as follows: a 25 minute study session followed by a 5 minute break. One pomodoro is equal to 25 minutes of studying and with every 4 pomodoros, you can take a longer break. My longer breaks are about 15 minutes. You should aim to do around 6 – 8 pomodoros a day. You can read more on the technique here. A great online tool for managing your tasks using pomodoros is KanBanFlow.
When you’re studying…
Before you start a pomodoro, be sure to turn off all distractions. Put your phone on silent and face down, sign out of all messaging applications, and be sure to be working in a quiet environment free from noises that could break your concentration. Loud music is something that can distract you. If you must listen to music, I find ambient or nature sounds bordering on white noise to be the best. Also, mindlessly browsing the web does not equate to studying! You need to focus 100% on the task at hand. If you’re browsing the web, be sure that it is related to learning Android development.
What if I’ve never programmed before?
I’m glad you asked. At this point, there are tons of different resources out there that can teach you the fundamentals of programming. A popular interactive resource, and one I’ve also used, is codecademy. Codecademy will take you from having no knowledge of a programming language (or topic) to mastering the basics. For paid resources, I can recommend both Pluralsight and Udacity.
Pluralsight is an online platform containing hundreds of video courses on different topics within the realm of tech. Udacity is more of an online education platform as you get a certificate of completion at the end of a nanodegree. You also get different programming projects during a nanodegree which are given feedback and graded. Udacity also offers great tools for career development, such as resume and cover letter reviews. I would recommend the Intro to Programming Nanodegree if you’re just starting out. Overall, both Udacity and Pluralsight are great options. However, Udacity is a bit more expensive if you choose to pay monthly.
But I can’t program! I suck at math…
Bullshit. Every time I hear this, it just translates to the following in my head, “I’ve never really tried to excel at math, therefore I’ve always been mediocre at it”. This doesn’t just apply to math, but all things in life. “I can’t do x y or z because I’m just not good at it“. As I said at the beginning of this paragraph – bullshit.
No matter what it is in life, when learning any skill you are always going to suck when starting out. This is something you will need to get comfortable with if you’re going to be learning anything, even Android development. Acknowledge that you suck. Be comfortable with the fact that you suck. You will never get better if you do not try. Failure only presents an opportunity to learn – and if you’re not learning, you’re not growing.
Need to brush up on your math skills?
If you need a refresher on highschool math, an excellent and free resource is Khan Academy. Khan Academy contains video courses on many different topics as well as quizzes to test your skills. Be sure to take notes when watching the videos.
A quick note on algorithms…
The concept of algorithms is extremely important – during an interview. Even then, depending on the company, you may not even get a classic whiteboard algorithm challenge. Don’t get me wrong, knowledge of algorithms and what makes an algorithm good or bad IS important – just not as important as most people tend to assume.
Here’s the deal, at a lot of top companies, such as Google or Amazon, you will be faced with a complex programming question during the interview process. You will need a very good understanding of algorithms and data structures in order to effectively solve whatever question they throw at you. This is not to say that your day-to-day work will consist of solving overly complex programming challenges, but rather – they are testing your problem solving skills. They want to hire the best and most capable candidates and can certainly afford to do so. If you need a quick rundown on how to judge an algorithm’s performance, check out my article on Big O notation. Also, if you would like a great book on how to overcome the technical side of an interview be sure to read Gayle McDowell’s book, Cracking the Coding Interview.
Don’t I need a degree for this kind of job?
NO! In this day and age, you do not need a degree to be a programmer. I cannot tell you that enough times. Anybody who tells you otherwise is delusional, has their mind stuck in the 70’s or is simply expressing an emotional reaction due to the thought of their degree not holding any value. Out of all the jobs I have ever applied for, only one didn’t want to proceed due to my lack of a completed degree. Any employer who doesn’t want to hire you due to you lacking a piece of paper is an employer not worth working for.
The tried and true argument against this is something along the lines of, “well having a degree shows you have the discipline to complete something that takes time and effort”. There are so many things wrong with this statement. First of all, you do not need to waste 4 – 6 years in school to learn general programming skills. Not to mention the ridiculous amount of debt you can accrue during your studies (depending on your country). Also many things take “time and effort”, but that doesn’t mean they are things worth doing – such as going down stairs while doing a handstand, learning to juggle knives or climbing Mt. Everest. My point is this – most of the information you will learn during your studies won’t help you on the job.
Newly graduated students come out of their university education expecting a $100k job offer on a silver platter, only to find themselves not knowing any of the required skills for the jobs they want to apply for (ie. Android developer). They will know a lot of stuff but cannot really do anything exceptional.
What can I do instead?
Pick a specific technology that sounds interesting to you and specialize in it. Study it religiously. Hone your skills at it daily. Know everything you can about it and always be up to date with the newest advancements. This is what is key in becoming a highly paid developer and is something most fail to realize. On top of this fact, getting started takes a fraction of the time (as well as cost, potentially) as it does to going the academic route and getting a degree.
Today, there are so many cost and time effective resources outside of university that allow you to specialize in almost anything programming related. As the title of this article states, it can take you about one year, or less, from knowing nothing about programming to becoming an Android developer if you’re motivated enough.
Learning Android quickly
Ok, now that we have gotten the preliminary topics out of the way, let’s get down to actually discussing the key concepts in Android development. I’ll list everything you need to know in this paragraph before going in-depth on each subject individually.
- Object oriented programming fundamentals and Java and/or Kotlin
- Android components; how they work and interact with each other
- Popular and useful libraries
- Asynchronous programming
- Modular software architecture (MVP or MVVM)
- Test driven development (TDD)
This list covers a lot of ground, but it is everything you should learn in order to be an outstanding Android developer.
Should I learn Java or Kotlin?
This is a great question. At the time of this writing, I believe that learning Java is still extremely important. All of the Android APIs, components, and documentation are still written in Java. For this reason, I find it a good idea to have a relatively strong grasp on Java before beginning Android development in any capacity. A great book for learning, and one I personally used, would have to be Head First Java.
What about Kotlin?
Kotlin is picking up a tremendous amount of steam and is quickly becoming the preferred language for Android development. I would learn Kotlin after becoming comfortable with Java. If you can read Java, you can read Kotlin (to an extent). Kotlin offers a ton of great features over Java such as an overall emphasis on null safety, more expressive code and much less boilerplate when writing your classes. If you would like to learn Kotlin, Jetbrains (the creators of the language) have an excellent set of online exercises that will explain the basics as well as Kotlin specific features. You can also clone the project and work through it in your preferred IDE. The documentation is just as good and can be found here. If you would like a good book on Kotlin, check out Manning’s Kotlin in Action.
Resources for learning Android
As I said earlier, the best way to learn is by doing, but you will of course need structured guidance on Android specific concepts. In my opinion, the greatest book for Android development would have to be Android Programming: The Big Nerd Ranch Guide. This book does an excellent job of explaining Android fundamentals, taking you all the way from a beginner to intermediate Android developer. On top of that, the book works through several projects, so you will have something to show in your portfolio if you decide to follow along.
If you would prefer an online education route, I can highly recommend Udacity’s Android Nanodegree. The program contains video lessons explaining different topics within Android development wrapped in interactive courses. At the end of each course, you will be required to apply the information you learned and submit a project which will be graded and given feedback. Once you have finally completed the whole program, you will have a nice collection of projects you can show off in your portfolio as well as a certificate of completion. The nanodegree should take you 1 – 3 months at the most if you don’t have a full-time job.
In my opinion, you should combine both of these resources. Whenever you get stuck working on one of your Udacity projects, you can always refer to the BNR book. I should also mention that before going into either of these, you should have a solid foundation of Java. Otherwise, things are going to be a lot more complex than they should be.
Android libraries you MUST learn
If you have never programmed before, you’re probably wondering, “what the hell is a library?”. A library is basically a collection of ready-made classes/functions you can import into your own project. For example, instead of writing the code you’d need for fetching and caching images from the web, you could use a library which does this for you. The two most popular libraries for this are Picasso and Glide.
I will first start off with the libraries I feel every Android developer must learn no matter what. Though be sure you begin learning these after you have a good understanding of Android fundamentals. These will be the libraries that are industry standard at this point in time.
RxJava2 / RxKotlin
RxJava2 / RxKotlin: There are many Rx libraries for different languages but the two you should become most familiar with are RxJava2 and RxKotlin. Rx (or ReactiveX) is essentially the observer pattern on steroids. Instead of messing around with Runnables, Handlers and writing your own callbacks – Rx makes writing asynchronous code incredibly easy. Rx makes your asynchronous solutions cleaner, more concise and easier to test. It may take some time to wrap your head around the library, but it is definitely worth it in the end. A resource which really helped me learn the basics and all of the different operators was, https://github.com/Froussios/Intro-To-RxJava. Be aware that all the examples use RxJava1 code, so be sure to read about the differences here: https://github.com/ReactiveX/RxJava/wiki/What’s-different-in-2.0.
Dagger2: This library is a Google fork of a previous version of Dagger written by Square, which led to this one becoming known as Dagger2. Dagger is a library used for Dependency injection management. As projects become bigger, more and more dependencies are needed – this is where Dagger comes in. You simply only need to tell dagger how to build your dependencies and it will generate the code needed to glue everything together. You can then go on to annotate the classes which rely on certain dependencies and Dagger will inject them for you.
Retrofit: When it comes down to retrieving and parsing data (JSON/XML) from the web, Retrofit is the library for doing so. You only need to write a small interface and use various annotations to tell Retrofit how to build your request(s). A great guide on retrofit can be found here: https://github.com/codepath/android_guides/wiki/Consuming-APIs-with-Retrofit
Butterknife: Perhaps the biggest amount of boilerplate in Android projects is taken up by code responsible for getting a reference to views from our layouts. This library eliminates a lot of the work by only requiring an annotation above our class defined views. If you’re writing your Android projects in Java, it is a library you shouldn’t go without using. It is worth noting however, that Butterknife is outdone if you’re writing in Kotlin, coupled with the Kotlin Android Extensions plugin.
These are the important libraries I recommend every aspiring Android developer to know inside and out. There are many more out there, but these are the ones you should learn before any other.
The following libraries are not as widely used as the ones above, but are either some of my personal favourites or super useful in certain situations.
- Timber: A really handy library used for log statements.
- Mosby: A library I use in all of my projects for quickly setting up my apps to follow the MVP pattern.
- Firebase: Essentially an SDK for server-less architecture. Firebase has various libraries which allow you to accomplish many different things. Such as cloud storage, real-time database and push notifications. If you need a basic backend solution, Firebase has got you covered.
- Leakcanary: A library used for detecting memory leaks in your apps.
- Exoplayer: A library used for video playback/streaming – arguably better than Android’s built in MediaPlayer API.
- MPAndroidChart: If you need any type of chart/graph/visual data representation – this is the library you want.
- Android-ktx: Ready-made Kotlin extension functions for Android development. At the time of this writing, the library is still in “preview”.
The importance of clean architecture
This is perhaps the most important section of the entire article. I cannot stress enough how important it is to learn clean architecture. If you want to read an in-depth explanation of what I mean by this, please do yourself a favour and checkout an excellent book on the subject, Clean Architecture: A Craftsman’s Guide to Software Structure and Design. Essentially, you want to write your classes so that they are scalable, testable, loosely coupled and easy to maintain.
When I first started developing my own Android apps, I would place all of my code in either my fragments or activities. I would write network code, helper functions, database code and everything unrelated to the ui in my ui classes. If you’re anything more than a beginner, you are probably already cringing.
The problem with writing code this way is that – it’s a mess. It’s difficult to come back and add or change functionality at a later point, difficult to read and most importantly – almost impossible to test. Writing unit tests for messy Android code cannot really be done. You will want to take advantage of the principles of clean architecture or use one of the following patterns that are quite popular when it comes to Android development.
MVP & MVVM
MVP (Model View Presenter) and MVVM (Model View Viewmodel) are the two most popular architecture design patterns used in Android development at the moment. I cannot speak much about MVVM as I prefer MVP, but if you’d like to know what MVVM is all about, check out a video I found helpful here.
Both of these patterns offer up ways to seperate your code into different components. In MVP, there are three different layers:
- View: UI related classes such as Activity or Fragment
- Presenter: a non-android class used to pass data/events from the model to the view.
- Model: Network/service related classes.
If you would like to read more about MVP and look at code which follows it, you can check out the following blog post by Antonio Leiva. Basically, if you follow either of these patterns, you will be left with a very clean codebase which is scalable and easy to test.
Google Architecture Components
Aside from MVP and MVVM, Google has their own set of architecture components that supposedly lead to cleaner Android solutions. I cannot really give a solid opinion on these as I have never used them, but if you’re curious you can check them out here.
Test Driven Development on Android
TDD is a software development methodology with a focus on writing tests before any implementation code. Basically, you define your classes, declare methods and member variables, but you don’t write any code pertaining to logic. You will write test cases before any live code. Once you’ve written your test(s), you can then proceed to write the code that will make the test pass. If you’re confused by what I mean, check out this video which shows a basic TDD workflow example using the popular JUnit library.
It is important to follow TDD when writing your Android apps as it leads to less bugs, more solid code and forces an emphasis on clean architecture (as writing unit tests in a project with bad architecture is next to impossible).
Libraries used for testing
There are some Android specific libraries which are used when writing different tests. However, the most popular is perhaps Robolectric.
Robolectric: This library allows you to test Android specific classes without an emulator or physical device – which is a huge time saver. If you have ever tried to test Android specific code in JUnit, you probably received a “not mocked” error.
Junit: This library is used for testing plain old Java code and also includes a set of useful annotations that can be taken advantage of by other libraries. You will be using JUnit almost everywhere in your unit tests.
Mockito: Mockito is used for generating mock classes. On top of this, the library provides methods which are used to manipulate mock behaviour. You will most likely want to use mocks for the dependencies of the specific class you are testing. That way, you can verify their behaviour when certain methods are called in the class which is under test. The current Kotlin alternative to Mockito is Mockk.
There is also the matter of the Android Testing Support Library, which is added as a dependency by default whenever you create a new project. It includes various tools used for testing Android code specifically. I don’t normally use these tools so much so I can’t provide a solid opinion on them. The library contains the popular Espresso UI testing framework, so be sure to look in to that for large scale UI tests.
At this point, I’ve discussed everything you need to learn to become a great Android developer. I’ll reiterate by stating that when learning – building a routine is important. Like I said at the beginning of this article, you will need to set aside at least 2 – 4 hours of your day to focused studying if you want to to make this a reality in a short amount of time.
Depending on the demand, I will write a follow up to this article. Let me know in the comments if you’re interested. Until then, get out there and learn some Android!