Book Image

Learning Android Application Development

By : Raimon Ràfols Montane, Laurence Dawson
Book Image

Learning Android Application Development

By: Raimon Ràfols Montane, Laurence Dawson

Overview of this book

The mobile app market is huge. But where do you start? And how you can deliver something that takes Google Play by storm? This guide is the perfect route into Android app development – while it’s easy for new apps to sink without a trace, we’ll give you the best chance of success with practical and actionable guidance that will unlock your creativity and help you put the principles of Android development into practice. From the fundamentals and getting your project started to publishing your app to a huge market of potential customers, follow this guide to become a confident, creative and reliable mobile developer. Get to grips with new components in Android 7 such as RecyclerView, and find out how to take advantage of automated testing, and, of course, much, much more. What are you waiting for? There’s never been a better time – or a better way – to get into Android app development.
Table of Contents (16 chapters)
Learning Android Application Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

Testing logic


Usually, the most straightforward tests you can write for your applications are unit tests. As the name indicates, each unit test should test a single unit or individual piece of the software and should be relatively simple. These types of tests are useful, for example, to check whether the logic or the business logic of your application is working as intended. If done right, logic should be isolated or abstracted from other components and even from Android SDK classes and methods. It could be run directly on the IDE, Android Studio, or even from the command line.

To show how to create some simple unit tests in your application, we will write a small and simple calculator application and write some tests for it. Later, we will add some more functionality so we will see other kinds of test in action.

Simple calculator application

The aim of this calculator application is to provide an example of how to create and run tests, so the functionality aspect will be very limited and we...