Learning Java by building Android games : get ready for a fun-filled experience of learning Java by developing games for the Android platform /
If you are completely new to either Java, Android, or game programming and are aiming to publish Android games, then this book is for you. This book also acts as a refresher for those who already have experience in Java on another platforms or other object-oriented languages.
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Birmingham, UK :
Packt Publishing,
2015.
|
Colección: | Community experience distilled.
|
Temas: | |
Acceso en línea: | Texto completo (Requiere registro previo con correo institucional) |
Tabla de Contenidos:
- Cover; Copyright; Credits; About the Author; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Why Java, Android, and Games?; Is this book for me?; If you just want to learn pure Java; If Android is your focus; Where this book will take you; Why build games to learn to program?; Why Android and Java?; Android is the fastest evolving and growing OS ever; Android developers have great prospects; Android is open source; Java is here to stay; Java is not just for Android; Java is fast and easy to use; A summary of Java and Android
- Setting up our development environmentInstalling the JDK; Android Studio; Installing Android Studio; Summary; Chapter 2: Getting Started with Android; Our first game project; Preparing Android Studio; Building the project; Exploring Android Studio; Using the Android Studio visual designer; Android UI types; TextView; Layout elements; ImageView widgets; ButtonView; Using the sample code; Making our game menu; Structuring our code for Android; Life cycle phases
- what we need to know; Life cycle phases
- what we need to do; Dividing our game into activities; Our first look at Java
- Cleaning up our codeBuilding and installing our game; Emulators and devices; Creating an emulator; Running the emulator; Running our game on the emulator; Building our game; Installing the setup to a device; Future projects; Self-test questions; Summary; Chapter 3: Speaking Java
- Your First Game; Java syntax; The compiler; Making code clear with comments; Storing data and using it with variables; Types of variables; Reference types; Declaration; Initialization; Expressing yourself in Java; Math game
- asking a question; Creating the new game activity; Laying out the game screen UI
- Coding a question in JavaLinking our game from the main menu; Decisions in Java; More operators; Decision 1
- If they come over the bridge, shoot them; Decision 2
- Else, do this; Switching to make decisions; Math game
- getting and checking the answer; Self-test questions; Summary; Chapter 4: Discovering Loops and Methods; Looping with loops; While loops; Breaking out of a loop; The continue keyword; Do-while loops; For loops; Random numbers in Java; Methods; The structure of a method; Modifier; Return type; Name of a method; Parameters; Getting things done in the method body; Using methods
- A working methodExploring method overloading; Enhancing our math game; Enhancing the UI; The new Java code; Amending GameActivity; The methods; The setQuestion method; The updateScoreAndLevel method; The isCorrect method; Calling our new methods; Finishing touches; Going full screen and locking orientation; Adding a custom image (instead of the Android icon); Self-test questions; Summary; Chapter 5: Gaming and Java Essentials; Java arrays
- an array of variables; Arrays are objects; A simple example of an array; Getting dynamic with arrays; Dynamic array example