Learn Android 4.0 Programming in Java

Learn to write real, working Android applications quickly and effectively, from the ground up.
101 reviews
  • John Purcell Software Development Trainer

    After working as a software developer and contractor for over 14 years for a whole bunch of companies including CSC, Proquest, SPSS and AT&T in the UK and Netherlands, I decided to work full-time as a private software trainer. I now live in the beautiful city of Budapest, Hungary, from where I run the website Cave of Programming.

  • Lifetime access to 96 lectures
  • 15+ hours of high quality content
  • Closed captioning enabled
  • A community of 4500+ students learning together!
  • 280+ discussions

Learn Android 4.0 Programming in Java

Learn to write real, working Android applications quickly and effectively, from the ground up.
101 reviews


Discover courses made by experts from around the world.

Take your courses with you and learn anytime, anywhere.

Learn and practice real-world skills and achieve your goals.


A practical guide to Android development. Learn to create Android programs using Java, and create the app of your dreams!

    • You should ideally already know some Java before taking this course.
    • Over 96 lectures and 15.5 hours of content!
    • Learn how to create Android applications
    • Anyone who wants to create Android apps


30 day money back guarantee
Lifetime access
Available on Desktop, iOs and Android
Certificate of completion


  • SECTION 1:
    Nuts and Bolts: The Basics of Android Programming
  • 1
    Nuts and Bolts Introduction
    What we're going to cover in the first section of the tutorial.
  • 2
    Setting Up Your System

    How to install the free software that you'll need to develop for Android.

  • 3
    Creating An Emulator

    You'll need an emulator to see your first program running. We'll create one in this tutorial.

  • 4
    Hello World

    Finally, it's time to create a "Hello World" application!

  • 5
    The EditText View

    The EditText "View" lets the user enter text. We'll use it in our application to let the user save some notes.

  • 6
    Buttons And Linear Layouts
  • 7
    Responding To Button Clicks

    In this tutorial we'll add some code that will get run when the "save" button is clicked.

  • 8
    Important Notes
  • 9
    Debugging With DDMS And Logcat

    In spite of the ferocious-sounding names, DDMS and logcat are very easy to work with and will help you double-check what's going on in your application. In this tutorial we'll use DDMS to double-check that our button click handler is working as expected.

  • 10
    Saving Files To Internal Storage

    There are various options for saving data in Android; search for "android storage options" in Google for more info. We'll be taking a look at some of them in this course, starting with saving files to internal storage in this tutorial.

  • 11
    Reading Files From Internal Storage

    Now that we've written a file to internal storage, in this tutorial we'll move on to reading it.

  • 12
    String Resources and Localization
  • 13
    Creating Launcher Icons
    You can, and should, create a nice icon to launch your application with. There are a few little complications to creating graphics for phones, but we'll get the hardest bit out the way right here!
  • 14
    Running On Your Phone
  • 15
    Saving Program Data: Preferences
    Preferences allow you to save small amounts of data -- single boolean values, integers and so on -- in such a way that the data persists between runs of your application.
  • 16
    Toasts: Alerting the User
    Toasts are little dialogs which go away by themselves, enabling you to mention something to the user without being too annoying in the process.
  • 17
    Adding a New Activity
    Applications often consist of more than one activitiy. Here we'll create a second activity that we're going to use to display an image.
  • 18
    Displaying Images with the ImageView View
    The ImageView view lets you display images.
  • 19
    Getting Touch Coordinates
    You can use touch listeners to find out exactly where the user touches the screen.
  • 20
    Alert Dialogs
    If you really want a dialog and not a toast, you can have one. Here we use one to make sure the user has absolutely definitely read our information before proceeding.
  • 21
    The Event-Listener (aka Observer) Pattern
    While not Android-specific, I'll be using the Event-Listener pattern to simplify the code a little bit. We'll cover it here. If you only want to know Android-specific stuff, you can skip this tutorial. But if you want to increase your mastery of Java, stay tuned.
  • 22
    Creating a Database
    Android incorporates the SQLite database. Here we'll see how to create a database that your application can use to store data. I assume you know basic SQL for this tutorial, or else at least don't mind seeing a bit of SQL from time to time ...
  • 23
    Adding Data to a Database
  • 24
    Retrieving Data from Databases
    Once we've covered retrieving values from our database, we'll finally be able to check that it actually works ....
  • 25
    Asynchronous Tasks: Running Stuff in the Background
    Asynchronous tasks let you execute stuff in the background. If you have a task that takes up to a few seconds, it's best to execute it in the background rather than hold up your main application thread, freezing the interface. Note: if you have a task that takes more than a few seconds, you need to look into more general Java concurrency; check out my free tutorials on multithreading on www.caveofprogramming.com. 
  • 26
    Verifying the Passpoints: Getting Return Values From Asynchronous Tasks
    You can't update the main thread from the doInBackground method of an asynchronous task. So how can you return data from your processing? We'll look at that here. 
  • 27
    Supporting Different Screen Resolutions
    You can declare the screen sizes your application supports in the manifest file, and indeed you should ....
  • 28
    Intents and Launching Activities
    To tell your phone to do something programmatically, you need to create an "intent". Here we'll use an intent to launch an activity.
  • 29
    Nesting ViewGroups
    You can nest ViewGroups to create quite complex layouts, although this isn't always the most efficient way to arrange your screen.
  • 30
    Option Menus
  • 31
    Passing Data to Activities
    Often you want to start some activity and send it some data at the same time, perhaps instructing it to take some special action.
  • 32
    You can trigger an activity and return later to the activity you triggered it from. This is very useful for stuff like taking photos in your application, as well as about a million other things, so we'll take a look at it here.
  • 33
    Taking Photos
  • 34
    Saving and Displaying Photos
    How to save the photos you take and use them in your application, plus a first look at permissions in Android.
  • 35
    List Views
    ListViews allow the user to choose between a bunch of different options. They're one of the commonest Android views, so well worth knowing.
  • 36
    Dynamically Populating Lists
    You can populate your lists dynamically at runtime, rather than hardcoding values. We'll also look at retrieving string array resources in this tutorial.
  • 37
    Formatting List Items: Custom Adapters
  • 38
    Using Icons in Views
  • 39
    Styles and Themes
    You can take style information (fonts, colours, etc) out of your XML layouts and put them in separate stylesheets instead. That way you can more easily re-use a given style, and you can collect all style information together in one place. A style for an entire activity is known as a theme. In this tutorial we'll use styles to style our list demo.
  • 40
    Selectors are drawable items that change depending on your application state. We'll use color selectables here to change the color of list items temporarily when you click on them.
  • 41
    Relative Layouts
    Relative layout is a very powerful ViewGroup that allows you to create complex arrangements of Views by positioning them relative to each other.
  • 42
    Browsing the Gallery
    How to browse the gallery from your application by launching an appropriate sub-activity.
  • 43
    Retrieving an Image from the Gallery
    Once you've browsed the gallery and selected an image, you have to do a little work to convert the URI of the image to a file name ....
  • 44
    The Activity Lifecycle and Saving Data
    All activities have a "lifecycle", which you need to understand and can use to your advantage.
  • 45
    Pre-Publication Checks
    Some things you shouldn't forget to do before attempting to publish your app.
  • 46
    Taking Screenshots of Your App
    You can use DDMS to take screenshots of your application, which you can then use when you publish your app.
  • 47
    Signing and Exporting Your App
    You need to sign your application by creating a digital certificate before you can publish it. In this tutorial we'll see how to create a digital certificate and export the app as an .apk file, signed with the certificate.
  • 48
    Publishing Your App
    Once you've digitally signed and exported your app, it's easy to publish it --- although you do need to pay 25 USD for a developer account before you can publish apps. We'll look at the process here.
  • SECTION 2:
    More Useful Stuff
  • 49
    Using 3rd Party APIs
  • 50
    Action Bars
    Action bars are those bars that appear at the top of the screen in Android 3.0 or greater. You can put icons, titles and menus in them. We'll take a good look at menus in this tutorial, as well as how to turn display of the titles and icons on and off.
  • 51
    Responding to Action Bar Menu Clicks
    Once you've created your action bar menu, you'll be wanting to take action when someone selects things from it. We'll see how to do it here.
  • SECTION 3:
  • 52
    Downloading Text Data from the Internet
    In this tutorial we'll start to look at communication by taking the simplest case -- downloading textual data from the Internet.
  • 53
    Internet Communication Overview
    Let's take a look at how phones can communicate with PCs, with the Internet and with each other. No code in this tutorial; it's just an overview. 
  • 54
    A Simple Server (Java Servlet) Program
    In this tutorial we'll create a simple Java servlet program to act as an Internet server for our device to communicate with. You can find more about servlet programming at this url:


    The first seven videos are free and cover everything you need to know in detail to get a servlet up and running on the Internet. You could also use something like PHP or Ruby to get a server program up and running.

  • 55
    Sending Small Amounts of Data to a Server
    If you want to send small amounts of data to a server (e.g. an id) you can do it via a HTTP GET (in other words, in the URL). 
  • 56
    URL Escaping
    If you want to send text to a server in a URL, you have to be careful to only send small amounts and you need to take care of special characters. We'll look at the latter here.
  • 57
    Introducing JSON with Twitter and The Onion
    Let's take a look at an example of an existing JSON server. You can write your own JSON servers too, of course. JSON is an alternative to XML, and either option is a good way to protect a database while allowing people to connect to it in a controlled way.
  • 58
    Decoding JSON
  • 59
    Encoding Data as JSON
    Let's take a look at encoding data in the JSON format.
  • 60
    Responding to POST Requests in a Servlet
  • 61
    Posting JSON Data to a Server
    If you want to send a lot of data to a server, you'll want to send it via a POST request, not a GET. We'll look at how to POST text (JSON) data here.
  • SECTION 4:
    Layout Techniques
  • 62
    Introducing Fragments
    Fragments are self-contained re-useable parts of activities. In this tutorial we'll create a simple example.
  • 63
    Using ListFragment to Display Lists
    ListFragment is a specialised kind of fragment that makes displaying lists very easy. We'll take a look at it here.
  • 64
    Formatting Items in ListFragment
    It's pretty easy to format items in a list fragment (or anything else that uses ArrayAdapter to format items). Let's do it here, because these items are rather unsightly due to being unduly large.
  • 65
    Fragment Communication
    The key to fragment communication is the Observer pattern, which old hands will recognise at once, while if you're relatively new to GUI programming, you may be left puzzled by it. In this tutorial we'll break it down into steps, and you'll most likely find that once you've typed out the steps yourself a few times, it'll start to really make sense.
  • 66
    Managing Fragments
    You can replace one fragment with another, meaning we can do stuff like showing fragments side by side on a large screen, but replacing one with another in response to user interaction on a small screen. In this tutorial we'll look at how to use the fragment manager to replace one fragment with another.
  • SECTION 5:
    Games and Animation
  • 67
    Animation Introduction
    Introducing frame-based animation in Android with a very simple game example.
  • 68
    By extending SurfaceView we can create a view that we can use for drawing on.
  • 69
    Images and Sound: POV Ray and Psycle
    Just a quick note on the software I used to generate the elementary sound and graphics for this section of the tutorial.
  • 70
    Drawing Images
    Finally we can draw some images!
  • 71
    Detecting Surface Changes
    Our game is going to start up when the view surface is created, and stop (or pause) when the drawing surface is destroyed; so for that we need to know how to detect surface creation and destruction events.
  • 72
    The Animation Thread (Game Loop)
    In this tutorial we'll set up a separate thread that will tell our game when to update and draw itself. It'll contain the "game loop" that's at the hard of all serious animation projects.
  • 73
    The Game Class
    In this tutorial we'll create a game class that basically will manage the various entities that will compose our game, drawing them and updating them.
  • 74
    A Sprite Class
    Let's create a class that can represent a sprite (an entity that visually appears in our game). We'll get it drawing something in this tutorial; then we can use it as a base class for specific game entities in future.
  • 75
    Animating the Sprite
    In this tutorial we'll make our first sprite actually move.
  • 76
    Making the Ball Bounce
  • 77
    Bring Out the GIMP: Autocropping
    In this tutorial I'm just going to show you a little bit of code I added to enable me to position the shadow relative to the main image. We'll also take a quick look at auto-cropping in GIMP.
  • 78
    Adding the Bats
    In this tutorial we'll add a couple of bats to our game. They won't hit the ball or move yet, but at least they'll be there.
  • 79
    Randomising the Ball Position
    Let's use the standard Random class to randomise the direction of the ball when the game starts.
  • 80
    Controlling the Player's Bat (Touch Events)
    By handling touch events we can control the player's bat, taking a big step towards turning this from an animation into a game.
  • 81
    Simulating Intelligence
    In this tutorial we'll add a simple random algorithm to control the opponent's bat, giving a sort of vague appearance of a deranged hyperactive intelligence.
  • 82
    Collision Detection
    Once we've added some collision detection, making good use of Rect.contains(), we can get the ball to bounce off the bats.
  • 83
    Drawing Text
    It's useful to be able to draw text in games, either to display an entire status screen, or just to show the score.
  • 84
    Game States
    In this tutorial we add states to our game, so that it can be paused vs running, won or lost etc.
  • 85
    Playing a Sound
    It's time to add sound to our game! In this tutorial we'll look at playing sounds in Android.
  • 86
    Playing Multiple Sounds
    In this tutorial we'll look at an efficient way of playing multiple sounds.
  • 87
    Adjusting the Volume
    Now we can add the finishing touch to our game by allowing the user to adjust the volume, without which our game would be rather annoying.
  • SECTION 6:
    Map Applications with Android V2 API
  • 88
    Installing Google Play Services
    The first step to creating a maps V2 application is installing Google Play Services and creating a library project.
  • 89
    Creating and Signing a Map Application
    Creating and signing a basic application; we'll leave actually getting it working for the next tutorial!
  • 90
    Getting the Map Demo Running
    Finally we can get the map demo up and running and actually see a map, if we're lucky.
  • 91
    Adding Markers to Maps
    This is a tutorial on adding markers to maps and making them clickable. Well if I'm honest, it's me blundering through the documentation to figure out how to do this. Hopefully it's entertaining :) It's good to see that Google have simplified this a lot since the last API version.
  • SECTION 7:
    Appendix 1: Source Code
  • 92
    Nuts and Bolts Source Code
  • 93
    Communication Source Code
    Communication source attached. Note, one of these projects is actually a Java servlet, not an Android app. If you prefer to use a PHP server, you can find an example at http://www.caveofprogramming.com/php/php-json-an-example-javascript-json-client-with-php-server/
  • 94
    Layout Techniques Source Code (Fragments)
  • 95
    Games and Animation Source Code
  • 96
    Maps Source Code
    Attached you can find the source code for the map applications (API version 2, which is the latest version as of March 2013 --- but may not be the latest if you're watching this in the future .... note, Android maps API is only up to version 2, while the Javascript map API - something else entirely -- is up to version 3.)


Hours of video content
Course Enrollments


  • 76
  • 19
  • 1
  • 3
  • 2


  • Narasimhan Kandooru
    Awesome job..

    I love all the courses I have taken so far. Very good in explaining the concepts and very detail oriented. I like the pace of the course as well. Keep up the great work. I highly recommend your courses to anyone who is interested in learning java.

  • Debashish Barua
    Definetly one of the best courses on Android

    After taking John's Java course, I blindly registered for this course even though it was for an outdated version. This course covers a lot of material in Android and John explains them very clearly. I would strongly recommend everyone to take this course. If you want to be strong at programming in Java, then this is the course for you! A heads-up, while creating an Android project, stick to the latest version (API 21) and limit the minimum SDK version to API 16. This way, you will not face any issues. All in all, I learnt a lot from John. A big thank you!

  • Burf Development Simon Burfield
    Great course

    A good course for beginners, the teacher is very easy to understand and goes at a nice pace. Covers a lot of subjects!

  • Leandro Gurruchaga

    Excellent course, step by step videos, progressive learning.

  • Enrique Padilla
    John Purcell Amazing teacher

    Just as the title says, I like to speek it up to 1.5 because I have some experience with programming, but the content and how it is presented is very clear and very educational. Completely recommend all Courses by this Teacher

  • 30 day money back guarantee!
  • Lifetime Access. No Limits!
  • Mobile Accessibility
  • Certificate of Completion