Android: Programming for Developers

Develop your own responsive, reactive, and ready-to-deploy Android applications
Preview in Mapt

Android: Programming for Developers

John Horton, Helder Vasconcelos, Raul Portales

1 customer reviews
Develop your own responsive, reactive, and ready-to-deploy Android applications
Mapt Subscription
FREE
$29.99/m after trial
eBook
$50.40
RRP $71.99
Save 29%
Print + eBook
$89.99
RRP $89.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$50.40
$89.99
$29.99 p/m after trial
RRP $71.99
RRP $89.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


Android: Programming for Developers Book Cover
Android: Programming for Developers
$ 71.99
$ 50.40
Kotlin for Android & Java Developers: Clean Code on Android [Video] Book Cover
Kotlin for Android & Java Developers: Clean Code on Android [Video]
$ 191.99
$ 163.20
Buy 2 for $35.00
Save $228.98
Add to Cart

Book Details

ISBN 139781787123694
Paperback1152 pages

Book Description

Android is the most popular OS in the world. There are millions of devices accessing tens of thousands of applications. It is many people's entry point into the world of technology. The Android: Programming for Developers course will take you on a journey to become an efficient Android programmer by thoroughly understanding the key concepts of Android programming and develop market-ready applications.

The course begins with helping you create Android applications from scratch. The first module, Android Programming for Beginners, introduces you to all the fundamental concepts of programming in an Android context, from the Java basics to working with the Android API. At the completion of this module, you’ll be ready to start building your own custom applications in Android and Java.

After getting familiar with the basic programming concepts, the second module, Asynchronous Android Programming, shows you how to make your applications more reliable. This will be achieved using high-level and advanced asynchronous techniques and concepts. Through this module, you will learn to construct scalable and performant applications to take advantage of multi-thread asynchronous techniques.

With a good grasp on the basics, you move on the final module, Mastering Android Game Development. This progressive module will help you learn to use animations and particle systems to provide a rich experience. By the end of the course, you will create beautiful, responsive, and reusable UIs by taking advantage of the Android SDK.

Table of Contents

Chapter 1: The First App
How Java and Android work together
The development environment
What makes an Android app
Our first Android app
FAQ
Summary
Chapter 2: Java – First Contact
Examining the log output
Improving our app and deploying again
Meet Java
FAQ
Summary
Chapter 3: Exploring Android Studio
The Android Studio guided tour
FAQ
Summary
Chapter 4: Designing Layouts
Exploring Android UI design
Structure of a UI design
Summary
Chapter 5: Real-World Layouts
Building a real-world UI
Summary
Chapter 6: The Life and Times of an Android App
Introduction to the Android lifecycle
A simplified explanation of the Android lifecycle
Lifecycle phases – what we need to know
Lifecycle phases – what we need to do
The lifecycle demonstration app
The structure of Java code – revisited
Summary
Chapter 7: Coding in Java Part 1 – Variables, Decisions, and Loops
Java is everywhere
Syntax and jargon
More code comments
Storing and using data with variables
Changing values in variables with operators
Expressing yourself demo app
Decisions
Repeating code with loops
Summary
Chapter 8: Coding in Java Part 2 – Methods
Methods revisited
Scope and variables revisited
FAQ
Further reading
Summary
Chapter 9: Object-Oriented Programming
Important memory management warning
Introducing OOP
Taking a look at the code for a class
The basic classes mini app
Remember that encapsulation thing?
Encapsulation and static methods mini app
OOP and inheritance
The inheritance mini app
Polymorphism
FAQ
Summary
Chapter 10: Everything's a Class
All Android UI elements are classes too
FAQ
Summary
Chapter 11: Widget Mania
Exploring Android UI objects
Exploring the palette
Android permissions and Marshmallows
The Widget exploration mini app
Summary
Chapter 12: Having a Dialogue with the User
Dialog windows
About the Note To Self app
Building the project and gathering resources
Coding the Note class
Implementing the dialog designs
Coding the dialog boxes
Summary
Chapter 13: Handling and Displaying Arrays of Data
A random diversion
Handling large amount of data with arrays
A simple array example mini app
Getting dynamic with arrays
Entering the nth dimension with arrays
ArrayLists
Arrays and ArrayLists are polymorphic
ListView and BaseAdapter
FAQ
Summary
Chapter 14: Handling and Displaying Notes in Note To Self
Note To Self continued
Improvements in Note To Self
FAQ
Summary
Chapter 15: Android Intent and Persistence
Good Intents
Adding a settings page to the Note To Self app
Persisting data with SharedPreferences
Making the Note To Self app's settings persist
More advanced persistence
Backing up user data in Note To Self
FAQ
Summary
Chapter 16: UI Animations
Animations in Android
The Animations Demo app – introducing SeekBar
Adding animations to Note To Self
FAQ
Summary
Chapter 17: Sound FX and Supporting Different Versions of Android
Supporting multiple versions of Android
Introducing the Spinner widget
Sound FX touches to Note To Self
Deleting a note – introducing OnLongClick
FAQ
Summary
Chapter 18: Design Patterns, Fragments, and the Real World
Introducing the model-view-controller pattern
The imperfections of Note To Self revisited
Android design guidelines
Real-world apps
The device detection mini app
Configuration qualifiers
Using configuration qualifiers – mini app
Fragments
Our first working Fragment mini app
Fragment reality check
FAQ
Summary
Chapter 19: Using Multiple Fragments
Using singletons for the model layer
Inter-Fragment communications – interfaces revisited
The dual-Fragment address book mini app
FAQ
Summary
Chapter 20: Paging and Swiping
Building an image gallery/slider app
Building a Fragment pager/slider app
Summary
Chapter 21: Navigation Drawer and Where It's Snap
Introducing the navigation drawer
The Where it's snap app
Summary
Chapter 22: Capturing Images
Capturing images using the camera
The capturing images mini app
Where it's snap – coding the capture Fragment
Summary
Chapter 23: Using SQLite Databases in Our Apps
Database 101
The SQL syntax primer
The Android SQLite API
The database mini app
Summary
Chapter 24: Adding a Database to Where It's Snap
The Photo class
Handling the SQLite database
Saving a new photo from the capture fragment
Displaying a photo from the database
Coding the communications interface
Coding TitlesFragment
Coding TagsFragment
Coding the fragment communications in MainActivity
Running the app so far
Summary
Chapter 25: Integrating Google Maps and GPS Locations
Global Positioning System
Where in the world – the GPS mini app
The Google Maps mini app
Summary
Chapter 26: Upgrading SQLite – Adding Locations and Maps
Adding locations and maps to Where it's Snap
Updating ViewFragment
Adding location permissions
Testing the new map feature
Summary
Chapter 27: Going Local – Hola!
The Localization mini app
Localizing the Where it's snap app
Summary
Chapter 28: Threads, Touches, Drawing, and a Simple Game
Threads
Problems with threads
Drawing with canvas and paint
Android Canvas demo app
Handling touches
A simple game engine
Building a simple game of Pong
Summary
Chapter 29: Publishing Apps
Preparing to publish
Building the publishable APK file
Publishing the app
Marketing
More to see
Summary
Chapter 30: Asynchronous Programming in Android
Android software stack
Android process model
Android thread model
Concurrency in Android
Android primary building blocks
Service in a separate process
Summary
Chapter 31: Performing Work with Looper, Handler, and HandlerThread
Understanding Looper
Summary
Chapter 32: Exploring the AsyncTask
Introducing AsyncTask
Declaring AsyncTask types
Executing AsyncTasks
Providing indeterministic progress feedback
Providing deterministic progress feedback
Canceling an AsyncTask
Handling exceptions
Controlling the level of concurrency
Common AsyncTask issues
Applications of AsyncTask
Summary
Chapter 33: Exploring the JobScheduler API
Introduction to JobScheduler
Setting running criteria
Scheduling a job
Implementing the JobService
Listing pending jobs
Canceling a job
Scheduling a periodic job
Applications of the JobScheduler
Summary
Chapter 34: Interacting with the Network
Introducing Android HTTP clients
Performing HTTP requests asynchronously
Customizing HTTP timeouts
Communicating securely over SSL sessions
Summary
Chapter 35: Network Interactions with GCM
Introduction to GCM
Setting up and configuring GCM for your application
Receiving downstream messages
Receiving messages from topic
Sending upstream messages
GcmListenerService delivery callbacks
Executing tasks with GCM Network Manager
Summary
Chapter 36: Asynchronous Programing with RxJava
Introduction to RxJava
RxJava setup
Creating Observables
Transforming Observables
Understanding Schedulers
Performing IO operations with Schedulers
Canceling subscriptions
Composing Observables
Monitoring the event stream
Combining Observables
Observing UI Events with RxJava
Working with Subjects
Summary
Chapter 37: Setting Up the Project
The right tool for the right game
The project – YASS (Yet Another Space Shooter)
Game architecture
Putting everything together
Moving forward with the example
Good practices for game developers
Summary
Chapter 38: Managing User Input
The InputController base class
The most basic virtual keypad
Creating a virtual joystick
Physical controllers
Sensors and InputControllers
Selecting control modes
Summary
Chapter 39: Into the Draw Thread
Using GameView
Improving DrawThread
Sprites
Adding a frames-per-second (fps) counter
Spawning enemies – the GameController
Occlusion culling
Parallax backgrounds
Layers
Summary
Chapter 40: Collision Detection
Detecting collisions
Rectangular bodies
Circular bodies
Mixed collision detection
Summary
Chapter 41: Particle Systems
General concepts
Making good particle systems
One shot
Emitters
Summary
Chapter 42: Menus and Dialogs
Custom fonts
Working with backgrounds
The GameFragment
Custom dialogs
Designing for multiple screen sizes
Summary
Chapter 43: To the Big Screen
Project configuration
Testing for Android TV
Declaring a TV Activity
Providing a home screen banner
Declaring it as a game
Reviewing the manifest
Showing controller instructions
Beyond this book
Summary

What You Will Learn

  • Mastering the fundamentals of coding Java for Android
  • Installing and setting up your Android development environment
  • Building functional user interfaces with the Android Studio visual designer
  • Adding user interaction, data captures, sound, and animation to your apps
  • Managing your apps’ data using the built-in Android SQLite database
  • Getting familiar with the android process model and low-level concurrent constructs delivered by the Android SDK
  • Interacting with nearby devices over Bluetooth and WiFi communications channels
  • Creating and composing tasks with RxJava to execute complex asynchronous work in a predictable way
  • Handling user inputs, from virtual joysticks to gamepads
  • Implementing collision detection using different techniques and discover how to optimize it for complex games
  • Building, deploying, and publishing real Android applications to the Google Play marketplace

Authors

Table of Contents

Chapter 1: The First App
How Java and Android work together
The development environment
What makes an Android app
Our first Android app
FAQ
Summary
Chapter 2: Java – First Contact
Examining the log output
Improving our app and deploying again
Meet Java
FAQ
Summary
Chapter 3: Exploring Android Studio
The Android Studio guided tour
FAQ
Summary
Chapter 4: Designing Layouts
Exploring Android UI design
Structure of a UI design
Summary
Chapter 5: Real-World Layouts
Building a real-world UI
Summary
Chapter 6: The Life and Times of an Android App
Introduction to the Android lifecycle
A simplified explanation of the Android lifecycle
Lifecycle phases – what we need to know
Lifecycle phases – what we need to do
The lifecycle demonstration app
The structure of Java code – revisited
Summary
Chapter 7: Coding in Java Part 1 – Variables, Decisions, and Loops
Java is everywhere
Syntax and jargon
More code comments
Storing and using data with variables
Changing values in variables with operators
Expressing yourself demo app
Decisions
Repeating code with loops
Summary
Chapter 8: Coding in Java Part 2 – Methods
Methods revisited
Scope and variables revisited
FAQ
Further reading
Summary
Chapter 9: Object-Oriented Programming
Important memory management warning
Introducing OOP
Taking a look at the code for a class
The basic classes mini app
Remember that encapsulation thing?
Encapsulation and static methods mini app
OOP and inheritance
The inheritance mini app
Polymorphism
FAQ
Summary
Chapter 10: Everything's a Class
All Android UI elements are classes too
FAQ
Summary
Chapter 11: Widget Mania
Exploring Android UI objects
Exploring the palette
Android permissions and Marshmallows
The Widget exploration mini app
Summary
Chapter 12: Having a Dialogue with the User
Dialog windows
About the Note To Self app
Building the project and gathering resources
Coding the Note class
Implementing the dialog designs
Coding the dialog boxes
Summary
Chapter 13: Handling and Displaying Arrays of Data
A random diversion
Handling large amount of data with arrays
A simple array example mini app
Getting dynamic with arrays
Entering the nth dimension with arrays
ArrayLists
Arrays and ArrayLists are polymorphic
ListView and BaseAdapter
FAQ
Summary
Chapter 14: Handling and Displaying Notes in Note To Self
Note To Self continued
Improvements in Note To Self
FAQ
Summary
Chapter 15: Android Intent and Persistence
Good Intents
Adding a settings page to the Note To Self app
Persisting data with SharedPreferences
Making the Note To Self app's settings persist
More advanced persistence
Backing up user data in Note To Self
FAQ
Summary
Chapter 16: UI Animations
Animations in Android
The Animations Demo app – introducing SeekBar
Adding animations to Note To Self
FAQ
Summary
Chapter 17: Sound FX and Supporting Different Versions of Android
Supporting multiple versions of Android
Introducing the Spinner widget
Sound FX touches to Note To Self
Deleting a note – introducing OnLongClick
FAQ
Summary
Chapter 18: Design Patterns, Fragments, and the Real World
Introducing the model-view-controller pattern
The imperfections of Note To Self revisited
Android design guidelines
Real-world apps
The device detection mini app
Configuration qualifiers
Using configuration qualifiers – mini app
Fragments
Our first working Fragment mini app
Fragment reality check
FAQ
Summary
Chapter 19: Using Multiple Fragments
Using singletons for the model layer
Inter-Fragment communications – interfaces revisited
The dual-Fragment address book mini app
FAQ
Summary
Chapter 20: Paging and Swiping
Building an image gallery/slider app
Building a Fragment pager/slider app
Summary
Chapter 21: Navigation Drawer and Where It's Snap
Introducing the navigation drawer
The Where it's snap app
Summary
Chapter 22: Capturing Images
Capturing images using the camera
The capturing images mini app
Where it's snap – coding the capture Fragment
Summary
Chapter 23: Using SQLite Databases in Our Apps
Database 101
The SQL syntax primer
The Android SQLite API
The database mini app
Summary
Chapter 24: Adding a Database to Where It's Snap
The Photo class
Handling the SQLite database
Saving a new photo from the capture fragment
Displaying a photo from the database
Coding the communications interface
Coding TitlesFragment
Coding TagsFragment
Coding the fragment communications in MainActivity
Running the app so far
Summary
Chapter 25: Integrating Google Maps and GPS Locations
Global Positioning System
Where in the world – the GPS mini app
The Google Maps mini app
Summary
Chapter 26: Upgrading SQLite – Adding Locations and Maps
Adding locations and maps to Where it's Snap
Updating ViewFragment
Adding location permissions
Testing the new map feature
Summary
Chapter 27: Going Local – Hola!
The Localization mini app
Localizing the Where it's snap app
Summary
Chapter 28: Threads, Touches, Drawing, and a Simple Game
Threads
Problems with threads
Drawing with canvas and paint
Android Canvas demo app
Handling touches
A simple game engine
Building a simple game of Pong
Summary
Chapter 29: Publishing Apps
Preparing to publish
Building the publishable APK file
Publishing the app
Marketing
More to see
Summary
Chapter 30: Asynchronous Programming in Android
Android software stack
Android process model
Android thread model
Concurrency in Android
Android primary building blocks
Service in a separate process
Summary
Chapter 31: Performing Work with Looper, Handler, and HandlerThread
Understanding Looper
Summary
Chapter 32: Exploring the AsyncTask
Introducing AsyncTask
Declaring AsyncTask types
Executing AsyncTasks
Providing indeterministic progress feedback
Providing deterministic progress feedback
Canceling an AsyncTask
Handling exceptions
Controlling the level of concurrency
Common AsyncTask issues
Applications of AsyncTask
Summary
Chapter 33: Exploring the JobScheduler API
Introduction to JobScheduler
Setting running criteria
Scheduling a job
Implementing the JobService
Listing pending jobs
Canceling a job
Scheduling a periodic job
Applications of the JobScheduler
Summary
Chapter 34: Interacting with the Network
Introducing Android HTTP clients
Performing HTTP requests asynchronously
Customizing HTTP timeouts
Communicating securely over SSL sessions
Summary
Chapter 35: Network Interactions with GCM
Introduction to GCM
Setting up and configuring GCM for your application
Receiving downstream messages
Receiving messages from topic
Sending upstream messages
GcmListenerService delivery callbacks
Executing tasks with GCM Network Manager
Summary
Chapter 36: Asynchronous Programing with RxJava
Introduction to RxJava
RxJava setup
Creating Observables
Transforming Observables
Understanding Schedulers
Performing IO operations with Schedulers
Canceling subscriptions
Composing Observables
Monitoring the event stream
Combining Observables
Observing UI Events with RxJava
Working with Subjects
Summary
Chapter 37: Setting Up the Project
The right tool for the right game
The project – YASS (Yet Another Space Shooter)
Game architecture
Putting everything together
Moving forward with the example
Good practices for game developers
Summary
Chapter 38: Managing User Input
The InputController base class
The most basic virtual keypad
Creating a virtual joystick
Physical controllers
Sensors and InputControllers
Selecting control modes
Summary
Chapter 39: Into the Draw Thread
Using GameView
Improving DrawThread
Sprites
Adding a frames-per-second (fps) counter
Spawning enemies – the GameController
Occlusion culling
Parallax backgrounds
Layers
Summary
Chapter 40: Collision Detection
Detecting collisions
Rectangular bodies
Circular bodies
Mixed collision detection
Summary
Chapter 41: Particle Systems
General concepts
Making good particle systems
One shot
Emitters
Summary
Chapter 42: Menus and Dialogs
Custom fonts
Working with backgrounds
The GameFragment
Custom dialogs
Designing for multiple screen sizes
Summary
Chapter 43: To the Big Screen
Project configuration
Testing for Android TV
Declaring a TV Activity
Providing a home screen banner
Declaring it as a game
Reviewing the manifest
Showing controller instructions
Beyond this book
Summary

Book Details

ISBN 139781787123694
Paperback1152 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Android: Game Programming Book Cover
Android: Game Programming
$ 69.99
$ 49.00
HTML5 and CSS3: Building Responsive Websites Book Cover
HTML5 and CSS3: Building Responsive Websites
$ 67.99
$ 47.60
Learning Android Google Maps Book Cover
Learning Android Google Maps
$ 39.99
$ 28.00
Reactive Android Programming Book Cover
Reactive Android Programming
$ 31.99
$ 22.40
Programming Kotlin Book Cover
Programming Kotlin
$ 35.99
$ 25.20
Learn C# With Windows Forms and SQL Server [Video] Book Cover
Learn C# With Windows Forms and SQL Server [Video]
$ 98.99
$ 84.15