Annyce Davis

Davis Technology Consulting

  • Home
  • About Me
  • Blog
  • Courses
  • Newsletter

My 2015

December 30, 2015 by Annyce Davis


Looking back on 2015, I’d have to say it was my year of “breaking free”. I finally started to do many of things that I had been only dreaming of for the past several years in my career as a Software Developer. Instead of feeling like I still didn’t know enough, I embraced what I did know and used that to increase my visibility in the Android Community. So here’s a recap of some of the highlights.

Public Speaking

With some encouragement from fellow female developers I submitted my first conference proposal. And I’ve been speaking around the world ever since! Below is a recording of my first conference talk at Droidcon NYC.

 

Appearances

I’ve also had the opportunity to make a few appearances speaking about my passion for Android Development on the Android Dialogs YouTube channel and the CodeNewbie’s podcast. This was a lot of fun and pushed me to “go with flow” in an environment that wasn’t so scripted.

YES! 💖 Love this podcast episode with 2 of my favorite role models, @saronyitbarek and @brwngrldev Don’t miss it! https://t.co/lqqvq4OcBa

— Kelly Shuster (@KellyShuster) December 21, 2015

Teaching

I love to share my knowledge with others whether it’s through conference speaking, blog posts, one-on-one, etc. So I was able to try something completely different this year and that was creating my own video course, Developing High Quality Android Applications. This enabled me to learn a new form of engagement through video and I hope to continue to explore this medium in the future.
 

Connections

One thing I never fully anticipated was the number of connections I’d be able to make in such a short time span. Meeting people from different backgrounds has been one of the best parts of this year. I had no idea that there were so many people out there just as passionate about producing quality software as I am, it’s been a great feeling! So I have Twitter to thank for exposing me to so many supportive people that I would have never had the chance to meet.
 
 
So here’s looking forward to what lies ahead for 2016!

Creating Your Own Video Course, Part I: Preparation

December 24, 2015 by Annyce Davis

 

I recently launched my first video course: Developing High Quality Android Applications. It was a significant undertaking for me. But through good planning and execution I was able to create a 2 hour course with over 40 videos in just about 2 months, while still working full-time! So while everything is still very fresh in my mind I wanted to share how I was able to do it. 

This is going to be a three part series where I break down the Preparation, Execution, and then Marketing of the course. Hope you find this information useful and you can use it as a reference for your first course! So let’s get started…

Preparation

First step in creating your own video course is to prepare a rough outline for yourself. It’s good to have a roadmap for what you hope to deliver and the various topics that you plan on covering. I began with the outline you see below. For each video I provided a “guesstimate” of about how long I thought the final product would be. You would want to use a similar structure so you can have a big picture view of the course content.
 
 
 
Next, in order to keep myself organized and make sure I delivered each video during the time promised, I created a Trello board. This is where I would keep track of what still needed to be done and what I was working on currently. It consisted of the following columns: 
 
  • To Do – Upcoming tasks
  • Doing – Tasks I was currently working on
  • Done – Completed Tasks
  • Before Shooting – Reminders for before shooting videos
  • During Prep – Resources for when I was preparing slides
 
 

This really helped me to stay organized and not feel overwhelmed by having to complete so many videos. Then for each section of videos that needed to be created, I would have one Trello card. That card would contain an embedded checklist that allowed me to specify a due date for when all items should be completed. I really liked this feature of Trello because I had a visual reminder of what needed to be done and what I had accomplished already.


I would also put links to references and my notes for that section of videos in the Comments portion of my cards. This was handy for me because I would sometimes come across information that I would need for a future section and I didn’t have to worry about searching through my Browser History to track it down again.

In Part II of this series, I’ll share what I did to create the slides and videos for my course.

Testing Tricks #3: Third Party APIs

December 14, 2015 by Annyce Davis



When you’re writing unit tests for your Android applications, you will often need to handle interactions with third party APIs. In the above image we’re using the Picasso Image Loading library in our classes. Picasso has a very clean API, so it’s relatively simple to work with; but with other libraries you may not be so fortunate. So what can we do to simplify our interactions with those APIs and also set ourselves up for more maintainable code in the future?

We can encapsulate the calls to Picasso (or whatever API) into another class that allows us to control the API and make assertions against it in our tests. So here’s an example:

Initial Code

// MyClass class

public void loadImageFromUrl(String imageUrl) {
    presenter.setCurrentPreviewImageUrl(imageUrl);
    if (showThumbImage) {
        Picasso.with(context)
               .load(imageUrl)
               .into(thumbImageView);
    }
}

So in this method, loadImageFromUrl, we want to make sure that our Presenter is being called and that when the showThumbImage variable is set to true, we call the method to load the image. We want to do this of course, without actually loading the image since we’re attempting to verify this behavior inside of a unit test.

For our use case we will need two new classes: ImageLoader and ImageLoaderImpl. The first will be an interface that we will use to expose the desired API, and the second will be a class that implements that interface and wraps the calls to the third party API.

Updated Code

// ImageLoader interface

public interface ImageLoader {

    void loadImage(String imageUrl, ImageView imageView);

}

// ImageLoaderImpl class

public class ImageLoaderImpl implements ImageLoader {
  
    // fields omitted

    @Override
    public void loadImage(String imageUrl, ImageView imageView) {
        Picasso.with(context).load(imageUrl).into(imageView);
    }
}

// loadImageFromUrl method

public void loadImageFromUrl(String imageUrl) {
    presenter.setCurrentPreviewImageUrl(imageUrl);
    if (showThumbImage) {
        imageLoader.loadImage(imageUrl, thumbImageView);
    }
}

Unit Test

// MyClass

@Mock private ImageLoader imageLoader;

@Test
public void shouldLoadImageWhenShowThumbIsTrue() throws Exception {
    myClass.setShowThumbImage(true);

    myClass.loadImageFromUrl("http://www.myimageurl.png");

    verify(imageLoader).loadImage(anyString(),
                                  any(ImageView.class));
}

@Test
public void shouldNotLoadImageWhenShowThumbIsFalse() throws Exception {
    myClass.setShowThumbImage(false);

    myClass.loadImageFromUrl("http://www.myimageurl.png");

    verifyZeroInteractions(imageLoader);
}
 
So in these two unit tests we are able to successfully verify the interactions with our Image Loader and we don’t have to be concerned with what’s going on inside our third party API. What’s more, if we decide in the future that we would like to use another Image Loading library, we’ve encapsulated those changes in one place!


How do you like to unit test third party APIs? Please leave a comment below.

Testing Tricks #2: Finding UI Views

December 7, 2015 by Annyce Davis

When you’re writing Espresso tests for your Android applications, you will often need to reference the resource id of a particular view in order to make your assertions. Instead of digging through code you can take advantage of the UIAutomatorViewer tool. It’s very simple to use and helps you to visualize the hierarchy of the views in your application. 


Here it is in action:

Espresso Test

@Test
public void clickOnDetailItemShouldDisplayPlayer() {
    onView(withId(R.id.container_list)).check(matches(isDisplayed()));
    onView(withId(R.id.browse_headers))
        .perform(pressKey(KeyEvent.KEYCODE_DPAD_RIGHT));

    onView(allOf(isDescendantOfA(
                     withRecyclerView(R.id.row_content).atPosition(0)),
           withId(R.id.info_field)))
              .perform(pressKey(KeyEvent.KEYCODE_DPAD_CENTER));

    onView(withId(R.id.wapo_player_view))
        .check(matches(isDisplayed()));
}
 
This test is for an AndroidTV application. It makes sure that the D-Pad navigation from the main header to the nested RecyclerView is functioning as expected. All of the ids for the views were found using uiautomatorviewer.


Hope you found this useful, until next time!
« Previous Page
Next Page »

Follow Me

  • Bluesky

Categories

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

Follow Me

  • Bluesky

Copyright © 2025 · All Rights Reserved · Log in