This guide is not original content, instead this post is an amalgamation of numerous other guides discussing the process of learning Android. This guide currently incorporates content from the following list of sources:
HalfApp's "How to get started programming Android apps" blog post has been integrated into this article as well. We've also added resources of our own here including Java resources from this gist and links that we recommend to people when first learning Android.
Thanks to these original content authors for helping us put together this useful resource.
If you never programmed at all before or if you are interested in starting with the basics, spend the first few months just on learning Java. Learn the syntax and understand how everything works. You’ll need to be able to create classes, create and call methods, use interfaces as well as know how inheritance works, before you can go to the next step. These are the basics of Java, and you’ll use them extensively when developing Android apps. Helpful resources for learning Java:
Be sure to check out these particular Java topics as well:
In addition to understanding Java and OOP, most Android development requires the use of data from a server-side database and as such requires you to have a solid conceptual understanding of RESTful APIs, consuming HTTP endpoints and parsing JSON responses. Here are a few resources to get started:
You also need to know how to understand XML since a great deal of Android development takes place in XML files:
Once you understand Java, OOP (Classes, Inheritance, etc), XML and APIs with JSON, you now have the proper context to enter the world of Android development.
Understanding the concepts above is a good thing because it allows you search for practical ways to achieve something. Almost everything you can think of doing has already been tried and documented by someone else. You just need to know how to find it. Which leads me to my next set of things you may consider to learn first:
In terms of designing a good looking app, here are some links that will help you start looking at ideas and acquiring design assets like icons.
There are various sites that provide icons, colors or other assets for your apps:
There are various guides that provide insight into the design principles for Android:
There are various sites that provide inspiration by showcasing beautiful modern app design:
With the basics in mind, it is time to start coding your first Android app. To begin you need to setup Android Studio and the Android SDK. The Android SDK is actually a bundle of helpful tools consisting of Android libraries, an emulator, a debugger, and documentation. It also gives you a framework of Java classes and methods that all Android devices are able to use, the core Android library. You'll have to update this library as new versions come out, but more on that later. The whole SDK is packaged inside Android Studio, allowing you to only worry about your code and how devices implement it.
When learning Android it’s not about learning how to code, it’s more about understanding the way that Android works. That means that you’ll spend the majority of the time learning about Activity Lifecycle, Fragments, ListViews, Intents, and other important Android specific concepts as opposed to algorithms or data structures.
The following online courses teach Android through structured lessons and quizzes:
Udacity Android Development for Beginners (Beginner) - This course is designed for students who are new to programming, and want to learn how to build Android apps. You don’t need any programming experience to take this course.
Developing Android Apps by Google (Intermediate) - Udacity course created by Google that teaches the core concepts involved in developing Android apps through videos and course work.
Programming Android Applications on Coursera - Coursera online course from the University of Maryland.
Building Mobile Applications Course - Courseware including videos and slides with high-level overview of Android development.
Google Android Interactive Codelabs - Hands-on step-by-step labs supported by Google.
The following guides act as excellent references while exploring Android:
CodePath Android Cliffnotes are the guides that you are reading right now! Check out the link to see the various "getting started" resources and hopefully you'll find them as an invaluable resource.
The Android official training guides are a good place to start. The Building Your First App lesson is very easy to follow and already gives you a good understanding of some key concepts of the Android SDK.
Vogella Android Tutorials - These are awesome free tutorials for most common Android topics.
Google Android Glossary - Common Android terms defined in a glossary site with visual diagrams to help reinforce concepts.
Common tasks is a useful list from Google of typical things you can do in your app with links to explanations on how to do them.
The following tutorials attempt to explain aspects of Android development step-by-step:
Google Codelabs for Android Tutorial - Interesting interactive tutorial for learning Android step-by-step.
Android UI Tutorial: Layouts and Animations - a quick live coding of Android UI creations and shows how to use the different layouts, Views (TextView, ListView, ImageView, GridView, RecyclerView) and Motions (Property Animation, drawable Animation) by live coding.
Complete Android Tutorial - In detailed step by step Android tutorial for learning.
The following video lessons present on the basics of Android development:
The following apps can be a useful examples when getting started:
Open-source Apps provides a list of the open-source sample apps that can be used as a resource when first getting started on Android. These sample apps can be a great help in understanding how all the pieces fit together.
DevAppsDirect is another great app you can get from the Play Store. While it also won't teach you how to develop an app, it will show you what is available out there. The app maintains a list of open source libraries you can use in your project for a variety of purposes. Knowing what you can reuse will save you a lot of time in the future.
The following books can act as a complement to the resources above:
Android Programming: Pushing the Limits is a fairly good book to check out.
The Busy Coder's Guide to Android Development is comprehensive with its over 2,400 pages but starts with the basics. It also has "do-it-yourself" tutorials to help you retain what you are learning. The book is a bit expensive but it comes with a one-year subscription to keep it updated during the period, as the author is constantly adding to the text.
There are several key concepts in Android that can cause confusion at first. Descriptions and further reading is listed below.
A configuration change is when the app is re-created on screen. The most common of these is caused by orientation changes. Whenever there is an orientation change, your activity needs to be destroyed and recreated to address the changes in layout. This means you need to handle this recreation process yourself, making sure your app doesn't crash. A lot of beginners (myself included) consider simply disabling these changes but this is considered a bad practice. Besides, even if you do disable orientation changes, there are other things that can cause configuration changes that you need to handle anyway.
Refer to our guide on configuration changes. In addition, here are two good posts discussing this further: http://stackoverflow.com/a/582585/362298 and http://stackoverflow.com/questions/1111980/how-to-handle-screen-orientation-change-when-progress-dialog-and-background-thre
To force yourself to catch problems sooner than later, consider the following tip from a previous post here on Reddit. You can enable a developer setting to not keep activities, so that they are always destroyed and recreated.
And more specifically, here are two examples of dealing with this problem when using a FragmentPagerAdapter, a common use case:
In a more abstract sense but still related to the topic, an old post on avoiding memory leaks is probably worthy of your time as well. This was written by Romain Guy, a Google employee very active in the Android community. It is certainly worth following him on Google+.
You can pass Java objects from one activity to another in a
Bundle if your class implements the Parcelable interface. Parcelables were designed specifically for performance and should almost always be used instead of Serializable. Refer to our guide on Parcelables for a detailed overview of how to use them.
One thing you MUST always keep in mind is the order with which you write to the parcel and read from it. That order must be consistent. Otherwise you will start getting very crypt error messages which are very hard to debug.
Android is full of features to help you deal with threads. This is a very important aspect of Android development because your app has to give snappy responses to user interaction. All your heavy work, such as database operations and network access, needs to be done in a separate thread so that the app does not appear frozen. The best place to start is learning how to start background intent services and how to run AsyncTasks to perform quick background operations
It is important to know when to use a
IntentService or an
AsyncTask. Learn about them, check examples, and make sure you use the right constructs whenever appropriate. For details, refer to our detailed threading and services guide for a comprehensive look at threading in Android.
Broadcast receivers are a great way to have your asynchronous tasks and services (refer to the previous topic above) communicate with the main thread or to receive push notifications from your phone. It is a powerful feature to understand and use. Refer to our guide on communicating with services for a detailed look.