- Browse
- » Java programming for Android developers for dummies: a Wiley brand
Java programming for Android developers for dummies: a Wiley brand
Author
Publisher
For Dummies, a Wiley brand
Publication Date
[2014]
Language
English
Description
Loading Description...
Table of Contents
From the Book
Introduction
How to Use This Book
Conventions Used in This Book
What You Don't Have to Read
Foolish Assumptions
How This Book Is Organized
Part I. Getting Started with Java Programming for Android Developers
Part II. Writing Your Own Java Programs
Part III. Working with the Big Picture: Object-Oriented Programming
Part IV. Powering Android with Java Code
Part V. The Part of Tens
More on the web!
Icons Used in This Book
Beyond the Book
Where to Go from Here
Part I. Getting Started With Java Programming for Android Developers
Chapter 1. All about Java and Android
The Consumer Perspective
The Many Faces of Android
The Developer Perspective Java
Java
XML
Linux
From Development to Execution with Java
What is a compiler?
What is a virtual machine?
Java, Android, and Horticulture
Chapter 2. Getting the Tools That You Need
The Stuff You Need
If You Don't Like Reading Instructions
Getting This Book's Sample Programs
Gathering Information
Are you running a 32-bit or 64-bit operating system?
If you're a Mac user, which version of Mac OS X do you have?
Is a recent version of Java installed on your computer?
Setting Up Java
Setting Up the Android SDK
Running Eclipse for the First Time
Dude, where's my Android SDK?
Eclipse, meet Java!
Importing this book's sample programs
Creating an Android Virtual Device
Chapter 3. Running Standard Java Programs
Running a Canned Java Program
Typing and Running Your Own Code
Separating your programs from mine
Writing and running your program
What's All That Stuff in the Eclipse Window?
Understanding the big picture
Views, editors, and other stuff
Looking Inside a view or an editor
Returning to the big picture
Chapter 4. Creating an Android App
Creating Your First Android App
Creating an Android project
Running your project
What if
Testing Apps on a Real Device
Examining an Android App
The src directory
The res directory
The gen directory
The Android 4.2 branch
The AndroidManifest.xml file
Part II. Writing your Own Java Programs
Chapter 5. An Ode to Code
Examining a Standard Oracle Java Program
The Java class
The names of classes
Why Java methods are like meals at a restaurant
What does Mom's Restaurant have to do with Java?
The main method in a standard Java program
Punctuating your code
Comments are your friends
What's Barry's excuse?
Another One-Line Method
More Java Methods
Using an import declaration
More method parameters
Fewer method parameters
Hello, Android
Where's the main method?
Extending a class
Overriding methods
An activity's workhorse methods
Chapter 6. Java's Building Blocks
Info Is as Info Does
Variable names
Type names
Assignments and initializations
Expressions and literals
How to string characters together
Java's primitive types
Things You Can Do with Types
Add letters to numbers (Huh?)
Java's exotic assignment operators
True bit
Java isn't like a game of horseshoes
Use Java's logical operators
Parenthetically speaking
Chapter 7. Though These Be Methods, Yet There Is Madness in't
Practice Safe Typing
Widening is good; narrowing is bad
Incompatible types
Using a hammer to bang a peg into a hole
Calling a Method
Method parameters and Java types
Return types
The great void
Displaying numbers
Method overload without software bloat
Primitive Types and Pass-by Value
What's a developer to do?
A final word
Chapter 8. What Java Does (and When)
Making Decisions
Testing for equality
Java if statements
A detour concerning Android screen densities
Choosing among many alternatives
Some formalities concerning Java switch statements
Repeating Instructions Over and Over Again
Check, and then repeat
Some formalities concerning Java while statements
Repeat, and then check
Some formalities concerning Java do statements
Count, count, count
Some formalities concerning Java for statements
What's Next?
Part III. Working With the Big Picture: Object-Oriented Programming
Chapter 9. Why Object-Oriented Programming Is Like Selling Cheese
Classes and Objects
What is a class, really?
What is an object?
Creating objects
Reusing names
Calling a constructor
More About Classes and Objects (Adding Methods to the Mix)
Constructors with parameters
The default constructor
This is it!
Giving an object more responsibility
Members of a class
Reference types
Pass by reference
Java's Modifiers
Public classes and default-access classes
Access for fields and methods
Using getters and setters
What does static mean?
Knowing when to create a static member
What's Next?
Chapter 10. Saving Time and Money: Reusing Existing Code
The Last Word on Employees - Or Is It?
Extending a class
Overriding methods
Java annotations
More about Java's Modifiers
Keeping Things Simple
Using an interface
Creating a callback
How versatile is this interface?
Java's super keyword
What Does This Have to Do with Android?
Part IV. Powering Android with Java Code
Chapter 11. A Simple Android Example: Responding to a Button Click
The First Button-Click Example
Creating the Android app
Making a view available to your Java code
Casting, again
Introducing Inner Classes
No Publicity, Please!
Doing It the Easy Way
I warned you to skip the rest of this chapter
The "no-hassle" way to click a button
Chapter 12. Dealing with a Bunch of Things at a Time
Creating a Collection Class
Java generics
Java's wrapper classes
Stepping through a collection
A cautionary tale
Java's many collection classes
Arrays
Java's varargs
Using Collections in an Android App
The main activity's initial layout
The app's main activity
The app's List Activity
The app's AndroidManifest.xml file
Chapter 13. An Android Social Media App
The Twitter App's Files
The Twitte4J API jar file
The manifest file
The main activity's layout file
The twitter4j.properties file
Getting OAuth codes
The Application's Main Activity
The onCreate method
The button listener methods
The trouble with threads
Android's AsyncTask
My Twitter app's AsyncTask classes
Cutting to the chase, at last
Java's Exceptions
Catch clauses
A finally clause
Passing the buck
Chapter 14. Hungry Burds: A Simple Android Game
Introducing the Hungry Burds Game
The Project's Files
The Main Activity
The code, all the code, and nothing but the code
Random
Measuring the display
Constructing a Burd
Android animation
Shared preferences
It s Been Fun
Part V. The Part of Tens
Chapter 15. Ten Ways to Avoid Mistakes
Putting Capital Letters Where They Belong
Breaking Out of a switch Statement
Comparing Values with a Double Equal Sign
Adding Listeners to Handle Events
Defining the Required Constructors
Fixing Nonstatic References
Staying within Bounds in an Array
Anticipating Null Pointers
Using Permissions
The Activity Not Found
Chapter 16. Ten Websites for Developers
This Book's Websites
The Horse's Mouth
Finding News and Reviews
Everyone's Favorite Sites
Index
Excerpt
Loading Excerpt...
Author Notes
Loading Author Notes...
More Details
ISBN
9781118504383
Staff View
Loading Staff View.

