You are previewing Learn Java for Android Development.
O'Reilly logo
Learn Java for Android Development

Book Description

Android development is hot, and many programmers are interested in joining the fun. However, because this technology is based on Java, you should first obtain a solid grasp of the Java language and its foundational APIs to improve your chances of succeeding as an Android app developer. After all, you will be busy learning the architecture of an Android app, the various Android-specific APIs, and Android-specific tools. If you do not already know Java fundamentals, you will probably end up with a massive headache from also having to quickly cram those fundamentals into your knowledge base.

Learn Java for Android Development teaches programmers of any skill level the essential Java language and foundational Java API skills that must be learned to improve the programmer's chances of succeeding as an Android app developer. Each of the book's 10 chapters provides an exercise section that gives you the opportunity to reinforce your understanding of the chapter's material. Answers to the book's more than 300 exercises are provided in an appendix. Additionally, author Jeff Friesen has created six bonus chapters that you can download from his personal site, located at http://tutortutor.ca/cgi-bin/makepage.cgi?/books/ljfad.

Once you complete this book, you will be ready to dive into Android, and you can start that journey by obtaining a copy of Beginning Android 2.

What you'll learn

  • The Java language: This book provides complete coverage of nearly every pre-Java version 7 language feature (native methods are briefly mentioned but not formally covered). Starting with those features related to classes and objects, you progress to object-oriented features related to inheritance, polymorphism, and interfaces. You then explore the advanced language features for nested types, packages, static imports, exceptions, assertions, annotations, generics, and enums. Continuing, you investigate strictfp, class literals, synchronized, volatile, the enhanced for loop statement, autoboxing/unboxing, and transient fields. The book also briefly presents most (if not all) of Java version 7's language features, although not much is said about closures or modules (which were not finalized at the time of writing).

  • Java APIs: In addition to Object and APIs related to exceptions, you explore Math, StrictMath, BigDecimal, BigInteger, Package, Boolean, Character, Byte, Short, Integer, Long, Float, Double, Number, the References API, the Reflection API, String, StringBuffer, System, the Threading API, the collections framework, the concurrency utilities, the internationalization APIs, the Preferences API, Random, the Regular Expressions API, File, RandomAccessFile, stream classes, and writer/reader classes. You will also get a tiny taste of Swing in the context of internationalization.

  • Tools: You will learn how to use the JDK's javac (compiler), java (application launcher), javadoc (Java documentation generator), and jar (Java archive creator, updater, and extractor) tools. You will also receive an introduction to the NetBeans and Eclipse integrated development environments. Although you can develop Android apps without NetBeans or Eclipse, working with these IDEs is much more pleasant.

Who this book is for

This book is for any programmer (including existing Java programmers and Objective-C [iPhone/iPad] programmers) of any skill level who needs to obtain a solid understanding of the Java language and foundational Java APIs before jumping into Android app development.

Table of Contents

  1. Title Page
  2. Dedication
  3. Contents at a Glance
  4. Contents
  5. About the Author
  6. About the Technical Reviewer
  7. Acknowledgments
  8. Introduction
  9. Chapter 1: Getting Started with Java
    1. What Is Java?
    2. Installing and Exploring the JDK
    3. Installing and Exploring Two Popular IDEs
    4. Four of a Kind
    5. Summary
  10. Chapter 2: Learning Language Fundamentals
    1. Classes
    2. Objects
    3. Summary
  11. Chapter 3: Learning Object-Oriented Language Features
    1. Inheritance
    2. Polymorphism
    3. Interfaces
    4. Summary
  12. Chapter 4: Mastering Advanced Language Features Part 1
    1. Nested Types
    2. Packages
    3. Static Imports
    4. Exceptions
    5. Summary
  13. Chapter 5: Mastering Advanced Language Features Part 2
    1. Assertions
    2. Annotations
    3. Generics
    4. Enums
    5. Summary
  14. Chapter 6: Exploring the Basic APIs Part 1
    1. Math APIs
    2. Package Information
    3. Primitive Wrapper Classes
    4. References API
    5. Summary
  15. Chapter 7: Exploring the Basic APIs Part 2
    1. Reflection API
    2. String Management
    3. System
    4. Threading API
    5. Summary
  16. Chapter 8: Discovering the Collections Framework
    1. Framework Overview
    2. Iterable and Collection
    3. List
    4. Set
    5. SortedSet
    6. Queue
    7. Map
    8. SortedMap
    9. Utilities
    10. Classic Collections Classes
    11. Summary
  17. Chapter 9: Discovering Additional Utility APIs
    1. Concurrency Utilities
    2. Internationalization APIs
    3. Preferences API
    4. Random Number Generation
    5. Regular Expressions API
    6. Summary
  18. Chapter 10: Performing I/O
    1. File
    2. RandomAccessFile
    3. Streams
    4. Writers and Readers
    5. Summary
  19. Appendix: Solutions to Exercises
    1. Chapter 1: Getting Started with Java
    2. Chapter 2: Learning Language Fundamentals
    3. Chapter 3: Learning Object-Oriented Language Features
    4. Chapter 4: Mastering Advanced Language Features Part 1
    5. Chapter 5: Mastering Advanced Language Features Part 2
    6. Chapter 6: Exploring the Basic APIs Part 1
    7. Chapter 7: Exploring the Basic APIs Part 2
    8. Chapter 8: Discovering the Collections Framework
    9. Chapter 9: Discovering Additional Utility APIs
    10. Chapter 10: Performing I/O
  20. Index