Learning Adventure
Learn to Build Android Apps
Android developers make software applications (apps) using the Java programming language and the Android SDK (software development kit). In this Learning Adventure, we'll get off to a quick start by building a simple crystal ball Android app that can predict the future! Then, we'll get a more formal introduction to programming and learn about concepts that are common to many languages. Finally, we'll create an intermediate Android app that reads external data sources. Please note: Java and JavaScript both have similar names, but they are completely separate programming languages. They have about as much in common as a horse and horseradish.
- Things You'll Learn
- Programming
- Java
- Android App Development
6 badges • 30 videos
-
Overview
Build a Simple Android App
This simple app will introduce the Java language, Eclipse, and some very basic concepts in the Android SDK. By the end, students should know how to build a simple app with touch and motion events, and animations.
-
Step 1
Getting Started with Android
Making an Android app is easier than you think, and we'll show you how! Learn how to set up and use a few free tools to make a simple Crystal Ball app that you can test on your computer. You don't even need an Android phone!
-
Step 2
Learning the Language
Android apps are typically written in a programming language called Java. In this stage we'll introduce you to Java and some of the basic concepts of programming like variables, arrays, and "if" statements. We'll also touch on some of the key principles of object-oriented development.
-
Step 3
Pretty Little Things
It's important that an app performs its functions well, but it's also important that users like it and want to use it. Learn how to spruce up the visual aspects of the Crystal Ball app by using images, animations, View customizations, and sounds.
-
Step 4
Shaking Things Up
We want our app to be fun and engaging, so in this stage we'll show you how to add code to detect when you shake your phone. Then we'll show how to display an answer as a result of that shake. And since shaking involves an actual phone, we'll show you how to run your app on a real device.
-
Step 5
Interrogating the App
We can't always see what's going on behind the scenes of our app, so in this stage we'll show you how to use a few tools to monitor how the Crystal Ball app is working and to troubleshoot problems.
-
Step 6
Sharing Your Creation
At this point you will have built an awesome app, so now it's time to show it off! We'll show you how to share it with friends and submit it to Google Play and the Amazon App Store.
4 badges • 9 videos
-
Overview
Introduction to Programming
Basic programming skills are essential for all web professionals, including designers. Many programming languages share a common set of concepts, which will be covered in this course.
-
Step 1
Basics
Computer programming can be intimidating at first, but this gentle introduction to the subject will make the learning curve a bit easier to climb.
-
Step 2
Control Structures
Control structures determine the flow of execution within an application. A conditional statement can fork the execution down several paths or a loop can execute the same code several times until a condition is met.
-
Step 3
Objects and Arrays
An array is a way of storing multiple items and each item is associated to a number called the index. Each item can be accessed using the index value. Objects are usually associated to meaningful pieces of data which it can hold and manipulate.
-
Step 4
Functions
A function contains a piece of code that needs to be executed several times from different parts of your application. A function optionally takes in arguments and returns an object or value as a result.
5 badges • 24 videos
-
Overview
Build a Blog Reader Android App
The Blog Reader app will teach us one of the most common and important uses of an Android app: downloading data from the Internet and displaying it in a list. We will investigate the Model-View-Controller design pattern that is essential for all Android apps, learn how to request data from the web, parse and use information in JSON format, and utilize the built-in Android ListActivity and adapter. We'll also see how to display a webpage inside our app.
-
Step 1
Exploring the Master-Detail Template
Included in Eclipse are a few Android project templates that can help us get started quickly with certain types of apps. In this stage we'll learn how the Master-Detail Template works, and we'll talk about the Model-View-Controller design pattern that is behind many Android applications.
-
Step 2
Rebuilding from Scratch
Using templates is great for getting started quickly, but to truly understand how to build something we should do it from scratch. In this stage we'll start with a blank project and use the Android system components for displaying data in a list. We'll see first-hand how to build the components of the Model-View-Controller pattern we talked about in the last stage.
-
Step 3
Getting Data from the Web
Now that we're comfortable displaying simple data in a ListView, let's take a look at how to connect to a website and request some data. This stage will cover how to establish that kind of connection and then use an AsyncTask in a separate thread of execution to retrieve data. We'll also see how to parse through the JSON data returned from the blog, and along the way we'll cover Java Exceptions and how to detect and handle them.
-
Step 4
Adapting Data for Display in a List
Now that we've connected to the Treehouse Blog and retrieved data in JSON format, let's take a look at how to adapt that data for display in our ListView. We'll first adapt titles using an ArrayAdapter, we'll add some code to manage the user interface while our web request is running, add an AlertDialog in case of errors, and then we'll add author information using a more complex adapter called SimpleAdapter.
-
Step 5
Using Intents to Display and Share Posts
Our list of blog posts looks nice and everything is working well behind the scenes, but nothing happens when the user taps on an item in the list. In this stage we'll add a listener for such a tap using the 'onListItemClick()' method and talk about a few different Intents we can use for different actions. First, we'll use an Intent to open the URL of the post in the browser, but then we'll add a second Activity to open the URL within our app and display it in a WebView. Finally we'll let users easily share the link however they want using the simple Share Intent.
The Finish Line!
If you've made it this far, congratulations! If you think you're up for it, why not check out the related bonus content or take on another Learning Adventure?