Learn Java for Android Development: Java Shorthand 13/13

These quick tips discuss some of the most common Java shorthand techniques you’ll come across when you’re getting started in Android development.
You’ll find these little code tidbits—which we are calling Java shorthand—used in the Android SDK sample code, and just about every Android development book published at this time, not to mention online tutorials and developer forums. None of these tips are Android-specific; they are simply Java techniques that routinely confound beginners new to Java and Android, based upon the emails we receive from our readers. 

Learn Java for Android Challenge: Strings 12/13

You’ve read about how Strings work in Java. Test your new skills with this challenge: solve this String-based puzzle to help you solidify your knowledge of the Java programming language and Android development. That's right, Android, too! You may need to refer to other Android tutorials here.

Setup

To prepare for this challenge, you’ll want to start with a basic Android application. Simply create an Android application within Eclipse and edit its default Activity, specifically the onCreate() method, to test the code you create for this challenge. Remember, you can use the Log.v() method to print output (including strings) to the debug log. This is a quick and convenient way to display testing output for exercises such as this one.

Learn Java for Android Development: Date and Time Basics 11/13

In this tutorial, you’ll learn to work with dates and times in Java and within Android applications. Date and time data can be determined, modified, and stored in a variety of ways.

Android applications are written in the Java, a programming language. Java has a number of primitive data types for different kinds of numbers (integers, floats, etc.), Boolean values, and single characters. Java also includes numerous classes for storing, formatting and modifying date and time data for use within your Android applications. In this tutorial, you’ll learn how to determine the current date and time, store date and time data and display it in a number of ways.

Learn Java for Android Development: String Basics 10/13

In this tutorial, you’ll become familiar with one of the most important programming data structures (types) in Java—the String. String variables can be used to store the textual (letters, numbers, symbols) data associated with a program.

Android applications are written in the Java, a programming language. Java has a number of primitive data types for different kinds of numbers (integers, floats, etc.), Boolean values, and single characters. In addition to storing textual data as arrays or characters, Java also includes a powerful object class called String (java.lang.String), which encapsulates textual data neatly and can be used to manipulate content. In this tutorial, you’ll learn how to create, use and manipulate strings in different ways, including how to store them as Android project resources.

Learn Java for Android Development: Javadoc Code Documentation 9/13

This quick lesson covers Javadoc, a helpful tool for generating documentation from your Java source files. This lesson is part of an ongoing series of tutorials for developers learning Java in order to develop Android applications.

What is Javadoc?

Javadoc is a utility provided with the Java SDK that allows developers to generate code documentation from Java source files. Development environments like Eclipse have built-in support for Javadoc and can generate searchable HTML reference materials from Javadoc-style comments. In fact, the Android SDK reference is a form of Javadoc documentation.

Learn Java for Android Development: More On Inner Classes 8/13

This quick lesson discusses a number of tips for working with inner classes in Java. This lesson is part of an ongoing series of tutorials for developers learning Java in order to develop Android applications.

What are (Anonymous) Inner Classes?

In Java, classes can be nested within one another in order to organize data and functionality in an orderly fashion. Anonymous inner classes are basically developer shorthand, allowing the developer to create, define, and use a custom object all in one go. Anonymous inner classes are frequently used in Android to define handlers for controls, define and launch new threads, and create and return custom objects in methods without cluttering code with unnecessary setup.
For a thorough discussion of nested and inner classes, including anonymous inner classes, see our tutorial called Learn Java for Android Development: Inner Classes

Learn Java for Android Development: Inner Classes 7/13

In this tutorial, you’ll become familiar with the concept of inner classes in Java—those classes whose scope and definition are encompassed within another class. You’ll also learn about anonymous inner classes, which are used quite frequently when developing with the Android SDK.

Android applications are written in the Java, an object-oriented programming language. In this tutorial, you’ll learn about inner classes, when and why to use them and how they work. You’ll also learn how to create new objects dynamically using anonymous inner classes.

Learn Java for Android Challenge: Iteration 6/13

You’ve read about how iteration works in Java. Test your new skills with this challenge: five progressively difficult exercises that help you solidify your knowledge of the Java programming language and Android development. That's right, Android too! You may need to refer to other Android tutorials that we've published on Mobiletuts+, but if you can complete this challenge successfully you will know you are progressing nicely in your Java and Android SDK understanding.

Setup

To prepare for this challenge, you’ll want to start with a basic Android application. Simply create an Android application within Eclipse and edit its default Activity, specifically the onCreate() method, to test the code from each of these challenges.

Learn Java for Android Development: Reflection Basics 5/13

In this tutorial, you’ll become familiar with the concept of Java reflection: the ability of a class or object to examine details about its own implementation programmatically.
Android applications are written in the Java, a programming language that supports reflection—the ability of an object to examine itself. In this tutorial, you’ll learn the basics of Java reflection, including how to inspect the methods and fields of a given class, check for the availability of specific methods, and other practical tasks you may need to use when developing for different versions of the Android SDK.

Learn Java for Android Development: Working with Arrays 4/13

This quick lesson shows you how to work with arrays in Java. This lesson is part of an ongoing series of tutorials for developers learning Java in order to develop Android applications.

What is an Array?

An array is a common data structure used to store an ordered list of items. The array elements are typed. For example, you could create an array of characters to represent the vowels in the alphabet:
UA-50246500-1