Android development is very hot and demanded nowadays. Here in Stockholm where I live there are tons of job openings I am being offered all the time, it is actually fascinating how high the demand is. What's needed for you to work as an Android developer? How much do you need to know? Here are my thoughts.
Android turned 10 years old recently and its popularity as a mobile operative system has been growing over the years, becoming the most popular one. Not only it's the leading operating system on mobile phones but it also runs on TVs, cars, wearables and even things! No wonder why it's so demanded!
So what is it that you need to become an Android developer? What do employers look for?
Kotlin is taking over Java on Android development at a very rapid rate. According to Github, Kotlin has been the language with higher adoption rate this year and its adoption on Android apps is just increasing. But of course, it's such a delight to write and read Kotlin!
It is still good if you know some Java since there are still many third-party libraries that are written in that language, but still, you see a fast migration from Java to Kotlin.
If you are totally new to programming, perhaps you could learn some Java and then jump into Kotlin. I recommend this because Kotlin is very abstract and there are many things "magically" happening in the background. Since Java is very verbose, it would help you understand the "magic" behind the scenes.
However, don't get stuck into Java since it's Kotlin you are aiming for!
There is a book I recommend called Kotlin for Android Developers. Antonio is very pragmatic in his approach, he teaches you Kotlin through making a weather app.
This one is not "Android" specific but more like a general programming principle. Design patterns are everywhere you look, sometimes you even use them without knowing their names. Every design pattern has its own purpose, but in general, you can say the main goal is to have a maintainable, decoupled, scalable and testable code.
Creating modular components allow you to develop and maintain your app easily. This is something you would not understand doing some hello world tutorials, but as your application grows in features so does your code. It is crucial then to use certain patterns to maintain your app clean.
So what design patterns are mostly used on Android? Without going into details I can say MVVM (Model-View-ViewModel), MVP (Model-View-Presenter) and MVI (Model-View-Intent) are very popular ones.
Master those and you are ready to go.
Every single app nowadays uses a
RecyclerView for one thing or another. Moreover, most of the apps consist of this view only! Look at Facebook, Twitter, Spotify... they are just basically a list of items!
You master that and you can replicate 90% of the apps out there.
Very typical use-case: you have a list of items which you can click on and get a detailed view.
By the way, recently I wrote an article about how to use different viewholders in the same RecyclerView adapter, you might want to check it out.
The best way to create your layouts is using
MotionLayout. It is an extension of
ConstraintLayout that allows you to create animations or transitions between two different layout states in a very simple way. It's delightful to animate views with it, which could be painful before. Although it is in alpha stage right now you can test it and play with it to get familiar.
If you don't need to animate anything a
ConstraintLayout will do just fine, and if it's a very simple thing even a
LinearLayout would do.
Whether you use an
Activity or a
Fragment to represent your views, you always need to deal with Lifecycle. The lifecycle is basically the different stages the component has since it is created, shown and destroyed.
It is really important to know this, especially when you are using things like
Services that can leak memory if you don't clean them up accordingly. There's a repository I always refer to when I need to revise something of the lifecycle, it includes a full diagram of both the
As part of the recent Android Jetpack release, there are few lifecycle-aware components you should learn such as
LiveData, they will make your life easier.
As defined by Google:
Intentis a messaging object you can use to request an action from another app component.
Intents are very useful since they allow you to:
- Start an
- Start a
- Send a
Do you know when you press a link on an app and it opens with the browser? That's an
Intent, an implicit Intent to be exact. Moreover, have you noticed what happens when you have a few apps that can handle the same type of content?
You can learn more details about intents here.
It is highly likely that you are going to need some sort of data persistence within your app, whether you need to store simple variables or complex data structures you will need to deal with
SharedPreferences, a database or a combination of both.
For more information on data persistence, check the data and file storage overview on the Android developers' site.
They are not mandatory but in every project, unless you work in a very restricted and closed environment, you use third party libraries to do certain things. You don't want to reinvent the wheel. If there's a good library in place that allows you to do something you need, just use it.
Before including an external library you should ask yourself the following questions:
- How many of its functionalities will I use?
- What's the method count, in comparison to its counterparts?
- How active is the repository of this library?
- Do I really need a library, can I write this function myself?
If there's something you feel negative about, then don't include it. Keep in mind there are always trade-offs!
The following is a list of popular third-party libraries used on Android development:
- Dagger, Butterknife/Kotterknife (dependency injection)
- RxJava/RxKotlin (reactive programming)
- Retrofit (network requests)
- Moshi, GSON (json parser)
- Glide, Picasso, Fresco (image loading)
- Room (database)
- Stetho (debug)
- Timber, AnkoLogger (logger)
These are the libraries on the top of my mind right now, there are for sure more I am forgetting. Bear in mind that you can do things without them anyway, you don't need to learn all these to be able to do Android development! Without them, things might turn a bit more difficult, sometimes unnecessarily difficult. They are there to fill the gap between the native SDK and what the developer expects. If you feel you don't need them don't use them, the least dependencies you have in your project the better!
Git is a version control system for tracking changes in computer files and coordinating work on those files among multiple people. It is an essential tool every single programmer uses daily. Moreover, once you are familiar with it and understand its importance, you might even start using it for other purposes as well, such as documentation.
Android Studio has a version control module embedded into it. I encourage you to learn git using the terminal though, you will learn and understand much better how it works by doing things "manually". Graphical interfaces lack control you sometimes need.
This is definitely crucial. Knowing how to operate the Google Play developer console is important since that's the most common way you distribute your app to your users. There are other channels and ways to do it but if you are serious about your app, you will definitely want to make it available on Google Play.
To be able to publish apps on Google Play you need to have a developer account, which costs $25 with lifetime access, or at least that was the price back in the days when I signed up 😀.
You might think that there are a lot of concepts you need to be familiar with, and perhaps it is true. I just covered the basics and the most important things I could think of, there's much more of course but you will do fine by knowing these to begin with.
But you don't need to know it all. For instance, there are tons of APIs within Android, few that I have not worked with even once. Multimedia, Maps, Vision, Position, you name it. Why would you use the media player if you are not working with an app such as Youtube or Spotify?
Again, you don't need to know them all, but you need to know they exist. So a good thing to do would be to go through the developers' website and see what's available for you as a developer.
Finally, there is this engineer mindset you need to have. The way to tackle a
problem challenge, the way you analyze a given solution, the way you collaborate with other team members... These kind of things are forged by experience, the more you work with them the better you will become.
Do you think I missed something? Leave a comment below, I would like to hear your thoughts 😊.