Annyce Davis

Davis Technology Consulting

  • Home
  • About Me
  • Blog
  • Courses
  • Newsletter

Testing Tricks #5 – Using Screen Robots with Espresso

April 18, 2016 by Annyce Davis

In this presentation by a developer at Square: “Software Quality/Automation Testing”, he discussed how they take advantage of Robots to make it easier to update tests whenever UI elements change, as well as a few additional benefits. This is a very useful abstraction technique for when you’re writing large numbers of tests in Espresso. So let’s look at an example of using a Screen Robot to test a simple login flow.

Before Using a Screen Robot

So the above code is how you would typically make use of Espresso, where you have multiple calls to onView() and reference the resource ids directly in each test. Two main drawbacks of this approach is that 1) if you need to change the ids in the future you have to update multiple tests, and 2) it’s not very clear from first glance what you’re attempting to accomplish in a given test due to the Espresso calls. So now let’s look at the same example, this time using Screen Robots.

Notice how the test method is more succinct and more easily conveys what we are trying to do, namely login with a given username and password and then make sure that it was a success. This includes the code for our LoginScreenRobot. This allows us to have a thin abstraction layer over the Espresso calls by extending our base ScreenRobot class. Hope you found this short testing tip helpful!

Fragmented Podcast Chat

March 30, 2016 by Annyce Davis

I was recently a guest on one of my favorite podcasts, Fragmented. It’s a podcast that focuses on tips and tricks for improving the Android Development experience. 

We talked all about Gradle, the build system that is used for running, testing, and packaging Android applications. I wanted to share some of the highlights.

Highlights


[02:31]: Kaushik attempts to discover if my time at The Washington Post was as exciting as the Spotlight movie.

[04:35]: Talking about my new work at Off Grid Electric.

[06:50]: We starting digging into some of the benefits of the Gradle build system.

[09:15]: We discuss build flavors and how they allow you to have different variations of your application.

[10:20]: Donn asks a question many have wondered: Why do we have some many .gradle files when we start a new Android application?

[12:22]: We discuss how the settings.gradle file is used.

[13:35]: How does the Gradle plugin structure benefit Android developers.

[16:40]: Donn introduces us to Gradle tasks. Then we talk about how they’re connected to plugins.

[24:10]: We do a quick overview of Creating a Custom Gradle Plugin. 

[31:00]: We start talking about improving the Gradle build times. 
Then as an extra bonus, Chiu-Ki Chan, fellow Android GDE, made an awesome Sketchnote of the entire episode.

Talking @Gradle with @brwngrldev on @FragmentedCast https://t.co/neRPu12nEc #Sketchnotes pic.twitter.com/u4fBIj3Evn

— Chiu-Ki Chan (@chiuki) March 30, 2016



Joining In on Twitter Chats

February 1, 2016 by Annyce Davis

A great way to connect with others in the tech community is by means of joining in on a Twitter Chat. So what’s a Twitter chat? 

“A tweet chat is a live Twitter event, usually moderated and focused around a general topic. To filter all the chatter on Twitter into a single conversation a hashtag is used. A set time is also established so that the moderator, guest or host is available to engage in the conversation.” — Forbes


Ok, so here’s the Twitter Chat basics: 

  1. Find out the start day and time (i.e. every Wednesday at 9pm EST)
  2. Use the chat’s hashtag in all tweets (i.e. #CodeNewbie)
  3. I use Tweetdeck to follow the conversation (just create a column with the desired hashtag)
  4. Wait for the Moderator to announce the question (i.e. Q1: What did you learn this week? #CodeNewbie)
  5. Respond with “A” and then the answer number (i.e. A1: I learned about JUnit Rules #CodeNewbie)
  6. Interact with other’s tweets that you find interesting (favorite, retweet, respond, etc.) 
TweetDeck


Some of the benefits: 

  • Meet people who are interested in a similar topic
  • Expand your network of tech professionals
  • Help encourage others who are just getting started
  • Learn new strategies for dealing with the unique challenges in the tech sector
  • And do it all from the comfort of your own computer 😉


Another benefit of participating in a Twitter chat is that often times the chat is captured via Storify and you can continue to have others engaging with you and your tweets long after the chat has ended.


What’s your favorite Twitter chat? Please share in the comments!

Talk: Gradle Plugin Goodness

January 19, 2016 by Annyce Davis

If you find yourself copying and pasting code from your application’s build.gradle file every time you start a new project, then it’s time you learn about creating Gradle plugins. In this presentation you will learn what it takes to create a custom Gradle plugin for use in your Android/Java applications. 

It covers: Plugin Structure, Key Plugin Components, Testing, and Publishing

Materials

  • Slides
  • Sample Project
 
If you would like to learn more about creating high quality Android applications, I encourage you to check out my video course.
« Previous Page
Next Page »

Follow Me

  • Bluesky

Categories

  • AI (3)
  • Android (62)
  • Career (7)
  • Communication (5)
  • Flutter (1)
  • Git (4)
  • Gradle (4)
  • Grails (23)
  • iOS (1)
  • Java (8)
  • JavaScript (6)
  • Kotlin (17)
  • Leadership (3)
  • Life (5)
  • Public Speaking (26)
  • Revenue (2)
  • RxJava (1)
  • Software Development (15)
  • Twitter (3)
  • Uncategorized (11)
  • Video Course (5)

Follow Me

  • Bluesky

Copyright © 2026 · All Rights Reserved · Log in