Writing Automated UI Tests

Book Description:

Write Android user interface (UI) tests using Google Espresso for Android. You’ll cover all the major topics of writing functional UI automated tests using the Espresso testing framework, including different ways of running automated tests, architecting test projects in an easy and maintainable way, and using tools which help to implement automated tests with less effort.

Android Espresso Revealed explains the basics of using Espresso to write automated UI tests, and how to customize the framework for advanced functionality. The author provides examples in both Java and Kotlin, and includes dealing with network operations in UI tests, testing application accessibility, implementing supervised monkey tests, and more.

What You Will Learn

  • Write Espresso tests with both Kotlin and Java including test project migration from Java to Kotlin
  • Test web views inside the application under test
  • Use Espresso to set up test devices or emulators to minimize test flakiness and run tests in Firebase Test Lab
  • Verify and stub intents with Espresso-Intents
  • Move test projects to AndroidX
  • Test notifications or operate on third-party apps during Espresso test execution
  • Apply different test architecture approaches to the test project to reduce maintenance effort
  • Implement supervised monkey tests using Espresso and UIAutomator
Who This Book Is For

Engineers with experience of Android test automation will benefit from this book

Book Description:

In Starting Out with App Inventor for Android, Tony Gaddis and Rebecca Halsey teach the fundamentals of programming while simultaneously showing students how to create fun, useful, and imaginative apps. Because App Inventor allows students to create apps and see them running on a phone, programming becomes a personally meaningful skill.

Book Description:

Outsmart your new Android

Getting a smartphone or tablet can be intimidating for anyone, but this user-friendly guide is here to help you to get the most out of all your new gadget has to offer! Whether you’re upgrading from an older model or totally new to the awesome world of Androids, this book makes it easier than ever to get up and running with the latest technology.

From setup and configuration to taking advantage of all those intricate bells and whistles, Android Phones & Tablets For Dummies helps you unleash everything your Android can do for you. If you’re looking to use your phone or tablet for texting, emailing, accessing the Internet, or anything in between, you’ll want to keep this go-to reference close by every step of the way.

•    Make sense of the phone features

•    Find your way around with navigation

•    Capture moments on the camera

•    Seamlessly sync with a PC or Mac

Who needs a headache when dealing with a new device? This book makes it totally pain free!

Book Description:

The comprehensive developer guide to the latest Android featuresand capabilities

Professional Android, 4th Edition shows developers how toleverage the latest features of Android to create robust andcompelling mobile apps. This hands-on approach provides in-depthcoverage through a series of projects, each introducing a newAndroid platform feature and highlighting the techniques and bestpractices that exploit its utmost functionality. The exercisesbegin simply, and gradually build into advanced Androiddevelopment. Clear, concise examples show you how to quicklyconstruct real-world mobile applications.

This book is your guide to smart, efficient, effective Androiddevelopment.

  • Learn the best practices that get more out of Android
  • Understand the anatomy, lifecycle, and UI metaphor of Androidapps
  • Design for all mobile platforms, including tablets
  • Utilize both the Android framework and Google Playservices

Book Description:

With more than a million apps available from Google Play, it is more important than ever to build apps that stand out from the crowd. To be successful, apps must react quickly to user input, deliver results in a flash, and sync data in the background. Multithreading is the ability of an operating system to execute different parts of a program, called threads, simultaneously. It is one of the major techniques used for parallel computing and concurrency.

This book provides a step-by-step tutorial which will explain how Asynchronous Tasks and Handlers are used for performing multithreading with Android to improve the performance of Android applications. This book also guides you through the concurrency constructs provided by the Android platform, illustrating the applications, benefits, and pitfalls of each.

In this book, you’ll learn how to use AsyncTask correctly to perform operations in the background, keeping user interfaces running smoothly while avoiding treacherous memory leaks. It will also help you discover Handler, HandlerThread, and Looper, the related and fundamental building blocks of asynchronous programming in Android.

This book will help you to build well-behaved applications with smooth and responsive user interfaces. By the end of this book, you will be able to delight your users with speedy results and data that is always fresh.

What you will learn from this book

  • Understand Android’s process model and its implications on your applications
  • Exercise multithreading to build well-behaved Android applications that work with the platform
  • Apply and control concurrency to deliver results quickly and keep your applications responsive to user input
  • Discover Android-specific constructs that make asynchronous programming easy and efficient
  • Learn how to apply Android’s concurrency constructs to build smooth and responsive applications

Create Mobile, Sensor-Aware, and VR Applications Using Processing

Book Description:

Learn how to use the Processing programming language and environment to create Android applications with ease. This book covers the basics of the Processing language, allowing users to effectively program interactive graphics in 2D and 3D. It  also details the application of these techniques to different types of Android devices (smartphones, tablets, wearables and smartwatches).

Processing for Android walks you through the steps of taking an initial idea to a final app. With this book, you will be able to write engaging apps with interactive visuals driven by motion and location information obtained from the device’s sensors; including health data from the wearer, like step count and heart rate.

An advantage of Processing for Android over more complex programming environments is the ability for users to focus on the interactions and visual output of their code rather than in the implementation details of the Android platform. This book goes through a comprehensive series of hand-on projects, ranging from simple sketches to more complex projects involving sensors and integration with larger apps. It also covers important aspects such as exporting your Processing projects as signed apps are ready to upload to the Google Play store and be share with the world!

What You’ll Learn

  • Write apps and live wallpapers for smartphones and tablets
  • Design and implement interactive watch faces
  • Create Virtual Reality experiences for Cardboard devices
  • Integrate Processing sketches into larger apps and Android Studio
  • Export projects as completed apps ready to distribute through Google Play Store
Who This Book Is For

Artists, designers, students, researchers, and hobbyists who are not necessarily Android experts, but are looking to write mobile apps that make creative use of interactive graphics, sensor data, and virtual reality.

Develop mobile virtual reality apps using the native Google Cardboard SDK for Android

Book Description:

Google Cardboard is a low-cost, entry-level media platform through which you can experience virtual reality and virtual 3D environments. Its applications are as broad and varied as mobile smartphone applications themselves. This book will educate you on the best practices and methodology needed to build effective, stable, and performant mobile VR applications.

In this book, we begin by defining virtual reality (VR) and how Google Cardboard fits into the larger VR and Android ecosystem. We introduce the underlying scientific and technical principles behind VR, including geometry, optics, rendering, and mobile software architecture. We start with a simple example app that ensures your environment is properly set up to write, build, and run the app. Then we develop a reusable VR graphics engine that you can build upon. And from then on, each chapter is a self-contained project where you will build an example from a different genre of application, including a 360 degree photo viewer, an educational simulation of our solar system, a 3D model viewer, and a music visualizer.

Given the recent updates that were rolled out at Google I/O 2016, the authors of Cardboard VR Projects for Android have collated some technical notes to help you execute the projects in this book with Google VR Cardboard Java SDK 0.8, released in May 2016. Refer to the article at https://www.packtpub.com/sites/default/files/downloads/GoogleVRUpdateGuideforCardbook.pdf which explains the updates to the source code of the projects.

Who This Book Is For

The book is for established Android developers with a good knowledge level of Java. No prior OpenGL or graphics knowledge is required. No prior experience with Google Cardboard is expected, but those who are familiar with Cardboard and are looking for projects to expand their knowledge can also benefit from this book.

What You Will Learn

  • Build Google Cardboard virtual reality applications
  • Explore the ins and outs of the Cardboard SDK Java classes and interfaces, and apply them to practical VR projects
  • Employ Android Studio, Android SDK, and the Java language in a straightforward manner
  • Discover and use software development and Android best practices for mobile and Cardboard applications, including considerations for memory management and battery life
  • Implement user interface techniques for menus and gaze-based selection within VR
  • Utilize the science, psychology, mathematics, and technology behind virtual reality, especially those pertinent to mobile Cardboard VR experiences
  • Understand Cardboard VR best practices including those promoted by Google Design Lab.

A hands-on guide to Android forensics, from setting up the forensic workstation to analyzing key forensic artifacts

Book Description:

Many forensic examiners rely on commercial, push-button tools to retrieve and analyze data, even though there is no tool that does either of these jobs perfectly. This book will introduce you to the Android platform and its architecture, and provides a high-level overview of what Android  forensics entails. You will see how data is stored on Android devices and how to set up a digital forensic examination environment. Next, you will go through the various physical and logical techniques to extract data from devices to obtain forensic evidence. You will also learn how to reverse-engineer applications and forensically analyze the data with the help of various open source and commercial tools.

By the end of this book, you will have a complete understanding of the Android forensic process.

What You Will Learn

  • Understand the Android system architecture and its significance for Android forensics
  • Build a forensically sound workstation
  • Utilize ADB to acquire data
  • Bypass Android security such as PINs and passwords
  • Perform both logical and full physical extractions to retrieve data
  • Reverse-engineer applications
  • Analyze data from many popular applications including Gmail, WhatsApp, and Snapchat
  • Discover free and open source tools to aid in data acquisition and analysis

The Big Nerd Ranch Guide

Book Description:

Android Programming: The Big Nerd Ranch Guide is an introductory Android book for programmers with Java experience.

Based on Big Nerd Ranch’s popular Android bootcamps, this guide will lead you through the wilderness using hands-on example apps combined with clear explanations of key concepts and APIs. This book focuses on practical techniques for developing apps compatible with Android 4.4 (KitKat) through Android 7.0 (Nougat) and beyond.

Write and run code every step of the way, using Android Studio to create apps that integrate with other apps, download and display pictures from the web, play sounds, and more. Each chapter and app has been designed and tested to provide the knowledge and experience you need to get started in Android development.

Book Description:

Take your Android programming skills to the next level by unleashing the potential of Android Studio

Expert Android Studio bridges the gap between your Android programing skills with the provided tools including Android Studio, NDK, Gradle and Plugins for IntelliJ Idea Platform. Packed with best practices and advanced tips and techniques on Android tools, development cycle, continuos integration, release management, testing, and performance, this book offers professional guidance to experienced developers who want to push the boundaries of the Android platform with the developer tools. You’ll discover how to use the tools and techniques to unleash your true potential as a developer.

  • Discover the basics of working in Android Studio and Gradle, as well as the application architecture of the latest Android platform
  • Understand Native Development Kit and its integration with Android Studio
  • Complete your development lifecycle with automated tests, dependency management, continuos integration and release management
  • Writing your own Gradle plugins to customize build cycle
  • Writing your own plugins for Android Studio to help your development tasks.

Expert Android Studio is a tool for expert and experienced developers who want to learn how to make use of the tools while creating Android applications for use on mobile devices.

Discover an all in one handbook to developing immersive and cross-platform Android games

Book Description:

Gaming in android is an already established market and growing each day. Previously games were made for specific platforms, but this is the time of cross platform gaming with social connectivity. It requires vision of polishing, design and must follow user behavior. This book would help developers to predict and create scopes of improvement according to user behavior.

You will begin with the guidelines and rules of game development on the Android platform followed by a brief description about the current variants of Android devices available. Next you will walk through the various tools available to develop any Android games and learn how to choose the most appropriate tools for a specific purpose.

You will then learn JAVA game coding standard and style upon the Android SDK. Later, you would focus on creation, maintenance of Game Loop using Android SDK, common mistakes in game development and the solutions to avoid them to improve performance. We will deep dive into Shaders and learn how to optimize memory and performance for an Android Game before moving on to another important topic, testing and debugging Android Games followed by an overview about Virtual Reality and how to integrate them into Android games.

Want to program a different way? Inside you’ll also learn Android game Development using C++ and OpenGL. Finally you would walk through the required tools to polish and finalize the game and possible integration of any third party tools or SDKs in order to monetize your game when it’s one the market!

What You Will Learn

  • Learn the prospects of Android in Game Development
  • Understand the Android architecture and explore platform limitation and variations
  • Explore the various approaches for Game Development using Android
  • Learn about the common mistakes and possible solutions on Android Game Development
  • Discover the top Cross Platform Game Engines and port games on different android platform
  • Optimize memory and performance of your game.
  • Familiarize yourself with different ways to earn money from Android Games

Explore every nook and cranny of the Android OS to modify your device and guard it against security threats

Book Description:

With the mass explosion of Android mobile phones in the world, mobile devices have become an integral part of our everyday lives. Security of Android devices is a broad subject that should be part of our everyday lives to defend against ever-growing smartphone attacks. Everyone, starting with end users all the way up to developers and security professionals should care about android security.

Hacking Android is a step-by-step guide that will get you started with Android security. You’ll begin your journey at the absolute basics, and then will slowly gear up to the concepts of Android rooting, application security assessments, malware, infecting APK files, and fuzzing. On this journey you’ll get to grips with various tools and techniques that can be used in your everyday pentests. You’ll gain the skills necessary to perform Android application vulnerability assessment and penetration testing and will create an Android pentesting lab.

What You Will Learn

  • Acquaint yourself with the fundamental building blocks of Android Apps in the right way
  • Pentest Android apps and perform various attacks in the real world using real case studies
  • Take a look at how your personal data can be stolen by malicious attackers
  • Understand the offensive maneuvers that hackers use
  • Discover how to defend against threats
  • Get to know the basic concepts of Android rooting
  • See how developers make mistakes that allow attackers to steal data from phones
  • Grasp ways to secure your Android apps and devices
  • Find out how remote attacks are possible on Android devices

Plan, design, and build engaging user interfaces for your Andriod applications

Book Description:

Great design is one of the key drivers in the adoption of new applications, yet unfortunately design considerations are often neglected in the face of “will it work,” “can we make it quicker,” or “can we get more people using it”?

This book seeks to redress this balance by showing you how to get your PM to start treating the design phase of your project seriously. This book is focused entirely on the development of UI features, and you’ll be able to practically implementing the design practices that we extol throughout the book.

Starting by briefly outlining some of the factors you need to keep in mind when building a UI, you’ll learn the concepts of Android User Interface from scratch. We then move on to formulate a plan on how to implement these concepts in various applications. We will deep dive into how UI features are implemented in real-world applications where UIs are complex and dynamic.

This book offers near complete coverage of UI-specific content including, views, fragments, the wireframing process, and how to add in splash screens-everything you need to make professional standard UIs for modern applications. It will then cover material design and show you how to implement Google’s design aesthetic in a practical manner. Finally, it ensures the best possible user experience by analyzing the UI using various tools, and then addressing any problems they uncover.

By the end of the book, you’ll be able to leverage the concepts of Android User Interface in your applications in order to attract new customers.

What you will learn

  • Develop a user interface that adheres to all the core material design principles
  • Transform your initial app idea into a concrete and detailed plan
  • Add Views, ViewGroups, layouts, and common UI components to your own Android projects
  • Use fragments and various strategies to gather user input
  • Create a new Android Studio project and develop it into a prototype
  • Identify and solve problems with your app’s UI to deliver a better user experience

Book Description:

Android Best Practices by Godfrey Nolan shows you how to make your Android apps stand out from the crowd with great reviews. Why settle for just making any Android app? Build a brilliant Android app instead that lets your users praise it for ease of use, better performance, and more.

Using a series of example apps which gradually evolve throughout this book, Android Best Practices brings together current Android best practices from user interface (UI)/user experience (UX) design, test-driven development (TDD), and design patterns (e.g., MVC) to help you take your app to the next level.

In this book you’ll learn how to:

• Use Android design patterns for consistent UI experience on many devices

• Use agile techniques such as test-driven development, behavior-driven development, and continuous integration

• Improve the speed and overall performance of your app

• Organize an Android app using design patterns such as MVC/MVP

• Create and consume REST and SOAP web services

Designing and developing an app that runs well on many if not all the leading Android smartphones and tablets today can be one of the most daunting challenges for Android developers. Well, this book takes much of the mystery out of that for you.

Over 100 recipes to help you solve the most common problems faced by Android Developers today

Book Description:

The Android OS has the largest installation base of any operating system in the world; there has never been a better time to learn Android development to write your own applications, or to make your own contributions to the open source community!

This “cookbook” will make it easy for you to jump to a topic of interest and get what you need to implement the feature in your own application. If you are new to Android and learn best by “doing,” then this book will provide many topics of interest.

Starting with the basics of Android development, we move on to more advanced concepts, and we’ll guide you through common tasks developers struggle to solve. The first few chapters cover the basics including Activities, Layouts, Widgets, and the Menu. From there, we cover fragments and data storage (including SQLite), device sensors, the camera, and GPS. Then we move on more advanced topics such as graphics and animation (including OpenGL), multi-threading with AsyncTask, and Internet functionality with Volley. We’ll also demonstrate Google Maps and Google Cloud Messaging (also known as Push Notifications) using the Google API Library.

Finally, we’ll take a look at several online services designed especially for Android development. Take your application big-time with full Internet web services without having to become a server admin by leveraging the power of Backend as a Service (BaaS) providers.

What You Will Learn

  • Along with Marshmallow, get hands-on working with Google’s new Android Studio IDE
  • Develop applications using the latest Android framework while maintaining backward-compatibility with the support library
  • Master Android programming best practices from the recipes
  • Create exciting and engaging applications using knowledge gained from recipes on graphics, animations, and multimedia
  • Work through succinct steps on specifics that will help you complete your project faster
  • Keep your app responsive (and prevent ANRs) with examples on the AsynchTask class
  • Utilize Google Speech Recognition APIs for your app.
  • Make use of Google Cloud Messaging (GCM) to create Push Notifications for your users
  • Get a better understanding of the Android framework through detailed explanations

Get started building apps for the Android platform

Book Description:

Get started in creating marketable apps for the burgeoning Android market. Begin your journey by learning the essentials of programming for phones and tables that are built around Google’s wildly-successful Android platform. Beginning Android, Fifth Edition is fresh with details on the latest iteration of the Android 5 and earlier versions.

Google’s Android operating-system has taken the industry by storm, going from its humble beginnings as a smartphone operating system to its current status as a platform for apps that run across a gamut of devices from phones to tablets to netbooks to televisions, and the list is sure to grow. Smart developers are not sitting idly by in the stands, but are jumping into the game of creating innovative and salable applications for this fast-growing, mobile- and consumer-device platform. If you’re not in the game yet, now is your chance!

Begin at the beginning by installing the tools and compiling a skeleton app. Move through creating layouts, employing widgets, taking user input, and giving back results. Soon you’ll be creating innovative applications involving multi-touch, multi-tasking, and more! You’ll be drawing data live from the Internet using web services and delighting your customers with life-enhancing apps. Not since the PC era first began has there been this much opportunity for the common developer. What are you waiting for? Grab your copy of Beginning Android and get started!

Build intensively tested and bug free Android applications

Book Description:

Adroid Application Testing Guide is a highly detailed book which gives step-by-step examples for a great variety of real-world cases, providing professional guidelines and recommendations that will be extremely valuable for optimizing your development time and resources. In the chapters you will find an introduction to specific testing techniques, and tools for specific situations. If you are an Android developer looking to test your applications or optimize your application development process, then this book is for you. No previous experience in application testing is required.

Efficiently automate test cases for Andriod applications using Robotium

Book Description:

Automation testing on mobile devices has been around for a number of years, although it has really taken off with the advent of the Robotium Framework. With the help of automating test cases, business components are extensively reused and complex test cases are executed. Due to a number of different key features added to the Robotium Framework, it has become the world’s leading Android test automation framework and most of the industry experts and professionals are using this framework for testing their Android business applications.

This practical guide will help you to create and execute automated test cases. You will also learn how to take advantage of the real power behind the Robotium Framework and all of its features, while being provided with a good grounding in how to use it in your Android test project.

Starting with learning how to set up an Android environment for using Robotium, this book will then look at the various features of the Robotium framework, and take you through numerous examples that will help you to take advantage of the new features in Robotium, quickly and painlessly.

This book will guide you through setting up the Android environment that is necessary to create a test project. You will also learn the benefits of using Robotium over other test frameworks, as well as solutions to the most common issues faced by users in this domain.

What you will learn from this book

  • Get to grips with the Robotium Framework
  • Create a test project using Robotium
  • Get acquainted with Robotium API calls and their usage
  • Access web views in Android via Web Support in Robotium
  • Compare Robotium with other testing frameworks
  • Utilize the remote control feature in Robotium
  • Implement different Robotium utilities
  • Use Robotium with Maven

Best Practices for Professional Developers

Book Description:

There’s a downside to Android’s amazing openness and versatility: it’s easy for developers to write code that’s inefficient, unreliable, insecure, or hard to maintain. In Android Development Patterns , enterprise Android developer Phil Dutson helps you leverage Android 5.0+’s amazing power without falling victim to those pitfalls. Dutson presents today’s most comprehensive set of patterns and procedures for building optimized, robust apps with Android 5.0+.

First, Dutson guides you through establishing a highly efficient development environment and workflow, and testing your app to ensure that your code works just as you expect. Then, he walks through the modern best practices for structuring apps, using widgets and components, and working with views.

You learn how to build apps that are easy to manage and update, deliver accurate and up-to-date information without wasting precious battery power, and take advantage of new hardware, such as Android Wear and Android TV. Dutson concludes by presenting powerful strategies for optimizing your apps and packaging them for distribution.

Coverage includes

  • Using testing to build more trustworthy, dependable, maintainable apps
  • Understanding subtle but critical differences between Android and traditional Java programming
  • Building consistent, modern user interfaces with views and layouts
  • Leveraging the proven MVC pattern to cleanly organize logic
  • Creating rich visual experiences with 3D graphics, animation, and media
  • Simplifying capture and use of location data with the new Locations API
  • Integrating optional hardware, such as Bluetooth, NFC, or USB
  • Building better apps with Google Play Services
  • Creating Android Wear notifications and apps
  • Tuning and improving apps with Google Analytics
  • Designing Android TV apps for the “ten foot view”