So, you’ve decided you’d like to learn how to develop Android apps? Great! Unfortunately, intentions can only carry you so far. Learning to code can be complicated. Sometimes it’s not even clear where to start! Thus, you probably have a slew of questions to answer before you even get started.
- What programming language should you learn?
- Where can you learn about your chosen language?
- Once you’ve grasped the basics, where do you even start typing the code?
In this post, we’re going to attempt to answer that first question. To that end, you’re going to have to do some soul-searching, as deciding which programming language to start with will depend entirely on what you hope to accomplish.
Take your pick
If you want to develop Android apps, step one is picking a language. The differences between the various Android programming languages can be a little complex and nuanced.
But what matters more than the language itself is the tool it is attached to, and the main features and goals of said tool.
The languages you might consider learning for Android development include:
- Java – Java is an official language of Android development and is supported by Android Studio. It has been an official language longer than Kotlin, and it is also popular outside of Kotlin development for many other purposes. Java and Android Studio have a steep learning curve, however.
- Kotlin – Kotlin is another official Android language. It is similar to Java in many ways but is a little easier to get your head around. It is also now Google’s preferred language of choice, though it is not as widely used outside of Android Studio. This may make it slightly less appealing for those hoping to work as developers across numerous projects.
- C++ — Android Studio also supports C++ with the use of the Java NDK. This allows for native coding applications, which can be handy for things like games. C++ is more complicated though, and this option is mostly only going to appeal to large, professional teams. C++ is also supported by Unreal Engine.
- C# — C# is a more beginner-friendly alternative to C or C++ that obfuscates more code. It is also a little less difficult than Java, though the two languages are extremely similar. It’s supported by some very handy tools like Unity and Xamarin, which are great for game development and cross-platform development. C# with Unity is the best option for many mobile game developers.
- LUA (Corona) – Another cross-platform tool built on LUA. It massively simplifies the app-building process while stilling allowing you to call native libraries.
When it’s time to develop Android apps, Jave remains one of the two official options. This means that it has a lot of support from Google. Most non-game apps were probably built with either Java or Kotlin.
The number one way to develop Android apps, is to go ahead and download Android Studio. This is a piece of software called an IDE, or Integrated Development Environment. It will come packaged with the Android SDK (a set of tools to facilitate Android development specifically) and this will give you everything you need in one place to get up and running.
Official documentation from Google will refer to Android Studio and Java (or Kotlin), and you’ll be able to find a lot of support online.
Java itself was released by Sun Microsystems back in 1995 and is used for a wide range of programming applications. Even as Google has made apparent its preference for Kotlin, Java is so entrenched and familiar that many development teams have chosen to stick with it.
Unfortunately, Java is also complicated and isn’t a great “first language.” Things get more complicated still once you add the Android SDK into the mix; a first-time coder can struggle to know what’s Java and what’s Android! Java is an object-oriented programming language with confusing topics like constructors, null pointer exceptions, checked exceptions and more. It’s not terribly readable and you’ll use a lot of “boilerplate” code doing simple things. Development using this route also requires a basic understanding of concepts like Gradle, the Android Manifest and the markup language XML.
That’s not to say that Java is a bad language – far from it. Not only would it be wrong to call any language “bad,” but it’s also true that most of the inconveniences of Java are actually there for our own good and encourage clean code. A lot of people love Java for this reason, and it’s also one of the most versatile and widely used. According to the PYPL (PopularitY of Programming Languages) table, Java is the most sought after programming language among employers.
Android Studio, has also been going from strength to strength over the last few years. Features like a visual designer and suggestions make the process a fair bit smoother, while advanced, powerful features are being added all the time to give developers access to things like cloud storage with easy implementation. It’s worth getting aboard, even if this rapid progress does make it hard to keep up sometimes (especially if you’re some poor guy who writes about this stuff for a living!).
Kotlin has been an official language for Android development for a while now, and Google has even gone so far as to make it the preferred option for Android development. That said, with many development teams already deeply invested in Java, there are many who have chosen not to make the switch.
Like Java, Kotlin runs on the Java Virtual Machine. It’s also completely interoperable with Java and doesn’t cause any slow down or increase in file sizes. The difference is that Kotlin requires less “boilerplate” code, meaning that it is a more streamlined and easy-to-read system. It also does away with errors like null point exceptions and even excuses you from ending every line with semicolons. In short, it’s great if you’re just learning to develop Android apps for the first time.
So, Kotlin is definitely an easier starting point for beginners, and the fact that you can still use Android Studio is a big plus. That said, it’s still a complex language in its own right, and you’ll still need to figure out an awful lot of extra “stuff” to build an Android app this way. There’s also the slight drawback of Kotlin being less widely used outside of Android development.
It’s fair to say that most people reading this should not choose this route to develop Android apps. Android Studio offers support for C/C++ code using the Android NDK (Native Development Kit). This means you’ll be writing code that doesn’t run on the Java Virtual Machine, but rather runs natively on the device and gives you more control over things like memory allocation. For intensive applications like 3D games, this can let you squeeze extra performance out of an Android device. It also means you’ll be able to use libraries written in C or C++.
However, it also tends to be much harder to set up, it introduces more bugs and it is less flexible. And if you did want to create a computer game, you’d probably be better off using a ready-made game engine such as Unity.
C# was developed by Microsoft with the aim of combining the power of C++ and the ease of Visual Basic. It reads a lot like Java, and if you know one of these languages, it will be relatively simple to swap to the other. Like Java, C# is garbage collected, meaning you don’t need to worry about things like memory leaks and freeing up memory yourself. At the same time though, C# is more modern than Java with a cleaner syntax – though this may just be my own bias coming through. The best language to develop Android apps often just comes down to taste!
If you want a particularly easy and welcoming introduction to Android app development, I recommend the combination of C# and Unity. Unity is a game engine (meaning it provides things like physics calculations and 3D graphics rendering) and an IDE (like Android Studio). This is a free tool that makes it incredibly easy to create your own games – with just a few lines of code you can have a basic platform game set up in less than an hour. No exaggeration! And it’s perfectly powerful too, being the tool used by most game studios on the Google Play Store. As a cross-platform solution, Unity will also let you port your games to other operating systems such as iOS and Windows. You can even make console games! On top of all that, developing in this way provides a very practical way to learn Object-Oriented coding (because the objects in this case actually are objects most of the time!). For those hoping to start a career in game development, learning Unity is an excellent first step.
The limitation? Unity is useful for creating games but sub-par for creating standard Android Apps, especially if you want to conform to Google’s Material Design language.
C# can also be used with Xamarin through Visual Studio. This is more akin to traditional Android development with the advantage of being cross-platform (one codebase for Android and iOS). For a complete beginner, this route is again a slightly obtuse entry point to Android development. But for a small company wanting to create an app for iOS and Android, it makes sense, and there’s plenty of support and information out there to help you out.
Corona offers another considerably simpler option for developing Android apps, while still giving you a fair amount of power and control. You’ll be coding in LUA which is already much simpler than Java. And the Corona SDK (Software Development Kit) will make things even easier. It supports all native libraries and allows you to publish to multiple platforms. It is largely used for creating games but can be used in a variety of other ways too. You’ll need to use a text editor like Notepad++ to enter your code and you can run said code on an emulator without even needing to compile first. When you’re ready to create an APK and deploy, you’ll be able to do this using an online tool.
This does require basic coding skills, but it offers a nice and gentle introduction to the world of code. At the same time though, it is definitely limited in what it can accomplish and is only a few steps removed from getting into “app builder” territory. This is more useful for someone who wants to create something relatively simple and isn’t as concerned about developing their coding skills or becoming a pro. If you want to use features such as in-app purchasing, then you’ll need to pay a fee. The same goes for using native Android APIs.
The right choice will depend on your sensibilities and your objectives, but whatever you decide, you’ll find that learning to code is a fantastically rewarding experience and one that opens up a ton of doors for you. And learning to code with Android is the perfect place to start. Hopefully now you at least now a bit more about how to develop Android apps, but if you have any questions, shout them in the comments and our team — and our readers — will do our best to answer them. Good luck!