O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Java Programming for Android Developers For Dummies, 2nd Edition

Book Description

Develop the next killer Android App using Java programming!

Android is everywhere! It runs more than half the smartphones in the U.S.—and Java makes it go. If you want to cash in on its popularity by learning to build Android apps with Java, all the easy-to-follow guidance you need to get started is at your fingertips. Inside, you'll learn the basics of Java and grasp how it works with Android; then, you'll go on to create your first real, working application. How cool is that?

The demand for Android apps isn't showing any signs of slowing, but if you're a mobile developer who wants to get in on the action, it's vital that you get the necessary Java background to be a success. With the help of Java Programming for Android Developers For Dummies, you'll quickly and painlessly discover the ins and outs of using Java to create groundbreaking Android apps—no prior knowledge or experience required!

  • Get the know-how to create an Android program from the ground up
  • Make sense of basic Java development concepts and techniques
  • Develop the skills to handle programming challenges
  • Find out how to debug your app

Don't sit back and watch other developers release apps that bring in the bucks! Everything you need to create that next killer Android app is just a page away!

Table of Contents

    1. Cover
    2. Introduction
      1. How to Use This Book
      2. Conventions Used in This Book
      3. What You Don’t Have to Read
      4. Foolish Assumptions
      5. How This Book Is Organized
      6. Icons Used in This Book
      7. Beyond the Book
      8. Where to Go from Here
    3. Part 1: Getting Started with Java Programming for Android Developers
      1. Chapter 1: All about Java and Android
        1. The Consumer Perspective
        2. The Many Faces of Android
        3. The Developer Perspective
        4. From Development to Execution with Java
        5. Java, Android, and Horticulture
      2. Chapter 2: Getting the Tools That You Need
        1. The Stuff You Need
        2. If You Don't Like to Read the Instructions …
        3. Getting This Book's Sample Programs
        4. Setting Up Java
        5. Setting Up Android Studio and the Android SDK
        6. Launching the Android Studio IDE
        7. Opening One of This Book's Sample Programs
        8. Using Android Studio
        9. Things You Might Eventually Have to Do
      3. Chapter 3: Creating and Running an Android App
        1. Creating Your First App
        2. If the Emulator Doesn't Behave
        3. The Project Tool Window
        4. Dragging, Dropping, and Otherwise Tweaking an App
        5. What All That Java Code Does
        6. Going Pro
    4. Part 2: Writing Your Own Java Programs
      1. Chapter 4: An Ode to Code
        1. Hello, Android!
        2. The Java Class
        3. Why Java Methods Are Like Meals at a Restaurant
        4. Punctuating Your Code
        5. All About Android Activities
      2. Chapter 5: Java's Building Blocks
        1. Info Is As Info Does
        2. Things You Can Do with Types
      3. Chapter 6: Working with Java Types
        1. Working with Strings
        2. Practice Safe Typing
      4. Chapter 7: Though These Be Methods, Yet There Is Madness in't
        1. Minding Your Types When You Call a Method
        2. Primitive Types and Pass-by Value
      5. Chapter 8: What Java Does (and When)
        1. Making Decisions
        2. Repeating Instructions Over and Over Again
        3. What's Next?
    5. Part 3: Working with the Big Picture: Object-Oriented Programming
      1. Chapter 9: Why Object-Oriented Programming Is Like Selling Cheese
        1. Classes and Objects
        2. More About Classes and Objects (Adding Methods to the Mix)
        3. Java's Modifiers
        4. What's Next?
      2. Chapter 10: Saving Time and Money: Reusing Existing Code
        1. The Last Word on Employees — Or Is It?
        2. More about Java's Modifiers
        3. Keeping Things Simple
        4. Some Observations about Android's Classes
    6. Part 4: Powering Android with Java Code
      1. Chapter 11: The Inside Story
        1. A Button-Click Example
        2. Introducing Inner Classes
        3. No Publicity, Please!
        4. Lambda Expressions
      2. Chapter 12: Dealing with a Bunch of Things at a Time
        1. Creating a Collection Class
        2. Stepping Through a Collection
        3. Java's Many Collection Classes
        4. Arrays
        5. Using Collections in an Android App
      3. Chapter 13: An Android Social Media App
        1. The Twitter App's Files
        2. How to Talk to the Twitter Server
        3. The Application's Main Activity
        4. Java's Exceptions
      4. Chapter 14: Hungry Burds: A Simple Android Game
        1. Introducing the Hungry Burds Game
        2. The Main Activity
        3. It's Been Fun
    7. Part 5: The Part of Tens
      1. Chapter 15: Ten Ways to Avoid Mistakes
        1. Putting Capital Letters Where They Belong
        2. Breaking Out of a switch Statement
        3. Comparing Values with a Double Equal Sign
        4. Adding Listeners to Handle Events
        5. Defining the Required Constructors
        6. Fixing Nonstatic References
        7. Staying within Bounds in an Array
        8. Anticipating Null Pointers
        9. Using Permissions
        10. The Activity Not Found
      2. Chapter 16: Ten Websites for Developers
        1. This Book's Websites
        2. The Horse's Mouth
        3. Finding News and Reviews
    8. About the Author
    9. Advertisement Page
    10. Connect with Dummies
    11. End User License Agreement