Learning Java by Building Android Games

Extend your game development skills while learning Java – follow this book and learn Java for Android to enter the world of Android games development with greater confidence

Learning Java by Building Android Games

This ebook is included in a Mapt subscription
John Horton

4 customer reviews
Extend your game development skills while learning Java – follow this book and learn Java for Android to enter the world of Android games development with greater confidence
$26.99
$44.99
RRP $26.99
RRP $44.99
eBook
Print + eBook
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781784398859
Paperback392 pages

Book Description

Android is the fastest growing operating system (OS) with one of the largest installed bases of any mobile OS. Android uses one of the most popular programming languages, Java, as the primary language for building apps of all types. So, you should first obtain a solid grasp of the Java language and its foundation APIs to improve the chances of succeeding as an Android app developer.

This book will show you how to get your Android development environment set up and you will soon have your first working game. The difficulty level grows steadily with the introduction of key Java topics such as loops, methods, and OOP. You'll then use them in the development of games. You will learn how to build a math test game, a Simon-like memory game, a retro pong-style game, and for the grand finale, a Snake-style, retro arcade game with real Google Play leaderboards and achievements. The book has a hands-on approach and is packed with screenshots.

Table of Contents

Chapter 1: Why Java, Android, and Games?
Is this book for me?
Why build games to learn to program?
Why Android and Java?
Setting up our development environment
Summary
Chapter 2: Getting Started with Android
Our first game project
Exploring Android Studio
Using the Android Studio visual designer
Structuring our code for Android
Our first look at Java
Building and installing our game
Self-test questions
Summary
Chapter 3: Speaking Java – Your First Game
Java syntax
Storing data and using it with variables
Expressing yourself in Java
Math game – asking a question
Decisions in Java
Math game – getting and checking the answer
Self-test questions
Summary
Chapter 4: Discovering Loops and Methods
Looping with loops
Methods
Enhancing our math game
Finishing touches
Self-test questions
Summary
Chapter 5: Gaming and Java Essentials
Java arrays – an array of variables
Timing with threads
Beeps n buzzes – Android sound
Life after destruction – persistence
The memory game
Self-test questions
Summary
Chapter 6: OOP – Using Other People's Hard Work
What is OOP?
Our first class and first object
Encapsulation
Inheritance
Polymorphism
More about OOP and classes
Self-test questions
Summary
Chapter 7: Retro Squash Game
Drawing with Android Canvas
Android Canvas demo app
Detecting touches on the screen
Preparing to make the retro squash game
The four implementation phases in detail
Self-test questions
Summary
Chapter 8: The Snake Game
Game design
The coordinate system
The code structure
Animation, sprite sheets, and the Snake home screen
Implementing the Snake game activity
Enhancing the game
Self-test questions
Summary
Chapter 9: Making Your Game the Next Big Thing
How to publish your app
Marketing your app
Adding leaderboards and achievements
What next?
Self-test questions
Summary

What You Will Learn

  • Set up an efficient, professional game development environment in Android Studio
  • Build your very own Android UI using easy to-use tools in Android Studio
  • Add real-time interaction with Java threads and implement locking/handling screen rotation, pixel graphics, clicks, animation, sound FX, and many other features in your games
  • Explore object-oriented programming (OOP) and design scalable, reliable, and well-written Java games or apps on almost any Android device
  • Build and deploy a graphical pong-style game using advanced OOP concepts
  • Explore APIs and implement advanced features such as online leaderboards and achievements using Google game services
  • Make your game compelling to be the next big hit on Google Play market with a content update strategy and in-game marketing

Authors

Table of Contents

Chapter 1: Why Java, Android, and Games?
Is this book for me?
Why build games to learn to program?
Why Android and Java?
Setting up our development environment
Summary
Chapter 2: Getting Started with Android
Our first game project
Exploring Android Studio
Using the Android Studio visual designer
Structuring our code for Android
Our first look at Java
Building and installing our game
Self-test questions
Summary
Chapter 3: Speaking Java – Your First Game
Java syntax
Storing data and using it with variables
Expressing yourself in Java
Math game – asking a question
Decisions in Java
Math game – getting and checking the answer
Self-test questions
Summary
Chapter 4: Discovering Loops and Methods
Looping with loops
Methods
Enhancing our math game
Finishing touches
Self-test questions
Summary
Chapter 5: Gaming and Java Essentials
Java arrays – an array of variables
Timing with threads
Beeps n buzzes – Android sound
Life after destruction – persistence
The memory game
Self-test questions
Summary
Chapter 6: OOP – Using Other People's Hard Work
What is OOP?
Our first class and first object
Encapsulation
Inheritance
Polymorphism
More about OOP and classes
Self-test questions
Summary
Chapter 7: Retro Squash Game
Drawing with Android Canvas
Android Canvas demo app
Detecting touches on the screen
Preparing to make the retro squash game
The four implementation phases in detail
Self-test questions
Summary
Chapter 8: The Snake Game
Game design
The coordinate system
The code structure
Animation, sprite sheets, and the Snake home screen
Implementing the Snake game activity
Enhancing the game
Self-test questions
Summary
Chapter 9: Making Your Game the Next Big Thing
How to publish your app
Marketing your app
Adding leaderboards and achievements
What next?
Self-test questions
Summary

Book Details

ISBN 139781784398859
Paperback392 pages
Read More
From 4 reviews

Read More Reviews