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 the UI


Now that we have the mechanisms to test our application logic, and at the same time we're sure nothing was broken when we added new functionality or modified the already existing features, we could add some more tests to check whether the UI behaves as it should.

Writing UI tests with the Espresso framework is quite similar to writing plain instrumentation tests; the difference is in navigating and performing checks and actions on UI views and the elements on the screen. When a UI test is executed, the emulator or real Android device will show the changes and actions in real time as if somebody was triggering those actions.

Setup

To set up the Espresso framework, we will not require additional work if we have configured our project for instrumentation tests already. We have to be sure that our build.gradle file contains the Espresso dependencies:

androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2' 
androidTestCompile 'com.android.support.test:runner...