Annyce Davis

Davis Technology Consulting

  • Home
  • About Me
  • Blog
  • Courses
  • Newsletter

Learning RxJava for Android Devs

December 2, 2015 by Annyce Davis

One of my goals this year was to learn RxJava. Similar to my goal of going to the gym, I procrastinated a bit.

Learning more about #RxJava is actually on my todo list for this year. Can’t wait to watch! 👍 #androiddev https://t.co/P4hF6A553z

— Annyce Davis (@brwngrldev) October 28, 2015


However, I have recently been digging deep into RxJava, especially as it’s used in Android applications. Figured I’d share some of the resources I’ve come upon to help others in their reactive journeys.

Resources:

  • Introduction to RxJava…
  • Grokking RxJava
  • Learning Reactive Programming with Java 8
  • RxJava Essentials
  • Where to Start
  • RxJava Examples
  • RxMarbles Site
  • RxMarbles App
  • Tweet wrong-ish RxJava code, get corrected by dozens of people around the world 😉

Mission accomplished! Using #rxjava in my first #Android app now. 😁 #androiddev #winning pic.twitter.com/FJ4dwjTeS9

— Annyce Davis (@brwngrldev) November 24, 2015

What have you found useful? Share in the comments. Thanks!

Testing Tricks #1: Dealing with “new”

November 24, 2015 by Annyce Davis

As I continue my efforts to get my Android applications under unit and integration tests, I have come across a few tips/tricks to successfully deal with troublesome code. So I decided to start a new blog post series, “Testing Tricks”. I will try to post a new trick each week. So let’s get started…

Problem Code

I wanted to test this code:

public void readDeepLink(String path) {
    new DeepLinkReader().readDeepLink(path);
}
 
Just wanted to make sure the readDeepLink method was being called. The troublesome part is that I didn’t want to create a actual DeepLinkReader because the real readDeepLink method made calls to the network. So what’s the fix?

Solution

Wrap the call to the “new” creation in a separate method. That way I could override the newly created method with a mock. This would avoid creating a real DeepLinkReader object and would allow me to use Mockito to verify the mock’s interactions.

Fixed Code

// in the MainPresenter.java
public void readDeepLink(String path) {
    getDeepLinkReader().readDeepLink(path);
}

DeepLinkReader getDeepLinkReader() {
    return new DeepLinkReader(currentData, events);
}
// in the MainPresenterTest.java
@Mock private DeepLinkReader deepLinkReader;

@Test
public void shouldReadDeepLink() throws Exception {
    MainPresenter mainPresenter = new MainPresenter() {

        DeepLinkReader getDeepLinkReader() {
            return deepLinkReader;
        }
    };

    mainPresenter.readDeepLink("washingtonpost.com");

    verify(deepLinkReader).readDeepLink("washingtonpost.com");
}

Hope you found this useful, until next time!

Talk: Static Code Analysis

October 13, 2015 by Annyce Davis

Studies show that for every 7 to 10 lines of code we write, we introduce one defect. Now often times we can spot these errors before they ever see the light of day, however that is not true in all cases. So what can we use to assist us in leveling the playing field? Well, we can take advantage of Static Code Analysis tools!

Tools

  • Checkstyle
  • Lint
  • PMD
  • FindBugs

Resources

  • Clean Code – http://amzn.to/1DJybxH
  • Effective Java – http://amzn.to/1Ku8Xel
  • Google Code Style – http://goo.gl/8Pf6J3
  • QA Checks – http://git.io/vCMwc
  • Conquering Cyclomatic Complexity – http://goo.gl/lRoPXN
  • Using Android Lint – http://goo.gl/Zl2BPx
  • Static Code Analysis Tools – https://goo.gl/0Hczxn

Conference: Android Summit 2015

October 5, 2015 by Annyce Davis

This is how Android Summit started for me! A delightful dinner for the speakers where I had the chance to make some new friends; including the friendly conference committee lead by folks at Capital One.

The highlight of any conference is the keynote, and I was excited to learn all about becoming an Android “Expert” from Chiu-Ki Chan! She explained how we can use blog posts, public speaking, videos, and books to share our expertise and thus become “experts”.  

The conference consisted of two tracks: Development and Design. I decided to put on my design hat and attend a few sessions.  I really enjoyed the talks on prototyping with Pixate and thinking like an Animator.

 

Learning about App Prototyping using @Pixate with @richiehollins. Pretty slick! #androidsummit2015 pic.twitter.com/lROZoT557b

— Annyce Davis (@brwngrldev) September 30, 2015

After that I had to scurry off and present my talk on developing maintainable apps. I really loved the positive energy from the crowd and the head nods as I explained the annoyances of messy code:-(

Learning about maintainable apps with @brwngrldev !! #AndroidSummit2015 pic.twitter.com/3bdqTUVjYn

— Michael Jones (@jonesmej) September 30, 2015

Considering this is the first time the conference was held, I’d say it was a smash hit. I can’t wait to see what they have in store for us next year!
« 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