Thursday, December 31, 2015

Mock Application in Espresso for Dependency Injection

I read this great post by Artem Zinnatullin on How to mock dependencies in Unit, Integration and Functional tests; Dagger, Robolectric and Instrumentation. The part I like the best is to use a different application in tests to provide different dependencies, and I decided to try it with Espresso.

Mock application via custom test runner

My current approach to dependency injection is to expose a setComponent function in my application for tests to supply the test component, which is not great because ideally the application should not have test-specific code.

The new approach is to subclass the application in the androidTest folder and load it during tests via a custom test runner.

public class DemoApplication extends Application {
  private final DemoComponent component = createComponent();

  protected DemoComponent createComponent() {
    return DaggerDemoApplication_ApplicationComponent.builder()
        .clockModule(new ClockModule())

  public DemoComponent component() {
    return component;

In the application we initialize a DemoComponent with createComponent() and stash it in a final variable to be used later.

public class MockDemoApplication extends DemoApplication {
  protected DemoComponent createComponent() {
    return DaggerMainActivityTest_TestComponent.builder()
        .mockClockModule(new MockClockModule())

For testing, we subclass our application and override createComponent to supply the test component instead.

To use the mock application in tests, we need a custom test runner:

public class MockTestRunner extends AndroidJUnitRunner {
  public Application newApplication(
      ClassLoader cl, String className, Context context)
      throws InstantiationException, 
             ClassNotFoundException {
    return super.newApplication(
      cl, MockDemoApplication.class.getName(), context);

We give it MockDemoApplication.class.getName() as the class name so the test runner will load the mock application instead of the main one.

Per application vs per test

This approach is slightly different from setComponent because we initialize the test component only once, rather than before each test method. Make sure you clear the state of your test modules before each test so run each test in from a clean slate.

Source code

I have updated two of my repositories to use this approach:

Like this article? Take a look at the outline of my Espresso book and fill in this form to push me to write it! Also check out the published courses:

Thursday, December 24, 2015

Learn to celebrate

Work hard and you shall be rewarded. I don't know where I got that idea, but that was how I operated for a long time. Turns out hard work does not count if nobody knows about it.

This is especially important during performance reviews. How do you let others know the good work you have been doing? To most of us, it is not natural to toot your own horn. But like most skills, it can be learned.

Step one: Reframe. Rather than viewing it as bragging, look at it as celebration. Celebrate your achievements, big and small.


I really like how Lara Hogan does it. She gets herself a donut whenever something awesome happened in her career, and makes its significance known to those around her. Check out her Donut Manifesto!

The boring list

If donut is not your thing, you can do with the good ol' list. Send a weekly summary email to your team with a few bullet points of what you have done.

Or you can take it a notch up and add some prose around it. I have started doing that with my newsletter, sending out about once a month, and it has been a great way to look back and take stock my accomplishments.

Celebrate now

End of year is an excellent reason to celebrate. Here is my list:

Your turn! Write a blog post for your 2015 accomplishments (do it on medium if you don't have a blog) and post a link in the comments. Let's celebrate!

My 2015

End of year offers a great opportunity to take stock at what I have done. Here are my highlights.

Public Speaking

This year I have shifted my efforts from giving talks to enabling others to do so.

  • I started the Technically Speaking newsletter (please subscribe!) last year with Cate Huston, and we continue to publish one issue per week.
  • I ran a grassroot campaign to get more women to speak at Droidcon NYC, resulting in 22% female speakers. I hope this will serve as a blueprint for others, especially conference organizers, to push the limits.
  • In September I gave my very first keynote speech, sharing my tips to blog and speak more. Please watch it and let me know if it helps you get started and level up on your blogging and speaking!

Android Dialogs

I started a YouTube channel with Huyen Tue Dao to interview people in the Android community. It has been really fun picking up video production, and we have been adding more visuals to aid explanations.


This came as a total surprise, as I have always considered myself as someone who cannot draw. Turns out sketchnoting is more about constraint satisfaction than drawing. And as an engineer, I am extremely good at that.

I really enjoyed sharing my learnings from conferences this way. I have scanned all my sketchnotes from 2015 into a PDF collection:

It is free to download, but you can also chip in a few dollars if you'd like to support my work.


I published two classes with Pluralsight this year:

I also drafted a outline for my Espresso book, and wrote a course from it:


A few of these projects were surprises. I never thought I'd be producing one video a week, or be known for taking graphic notes! I have no idea what 2016 will bring, but I am looking forward to it!

Monday, December 14, 2015

Use Quicktime to record your own talk

There are many reasons why you may want to your talk recorded:

  • You can watch it again yourself to look for things you can improve.
  • People at your talk can watch it to refresh their memories and share it with their friends.
  • People not at the event get to watch you talk.
  • Conference organizers get an idea what they are getting when they accept your talk proposals.

However, not all meetups and conferences record their talks. If they don't, you can do it yourself with a screen record. Quicktime is the easiest way to do it on a mac.

Screen record with Quicktime

  1. Select File → New Screen Recording.

  2. Click on the down arrow next to the red button to make sure you are recording the sound.

  3. Press the red button to start recording.

Second camera

If you want to be fancy, you can set up a second camera to record your face. I use a camcorder, but you can also have a friend record you with another laptop.

On the second laptop, choose File → New Movie Recording.

You can either turn the laptop around to use the built-in camera, or attach a USB webcam. Make sure you record the sound as well so you can use it to sync up with the screen capture from your laptop.

You will need to put the two clips together. I use Camtasia as my video editor, but iMovie probably works too.

Here is an example of a talk that I recorded myself:


  • Try it before the actual event to make sure you know how this works.
  • Clear up enough disk space for the video. You will need gigabytes!
  • Put a post-it on your laptop so you don't forget to start recording at the beginning of your talk.
  • From @JakeWharton: Record the screen on which the presentation is being displayed. Don't record presenter display!
  • From +SebastianoPoggi: You can also use VLC for added quality and stability (QT crashes write often). Plus not Mac only :)

Friday, November 27, 2015

Android Dev Summit: Amazing!

Google ran its first Android Dev Summit this November, and I gotta say, it was amazing.

Session Videos

The AV team edited and posted the videos within 2 hours of the talk, so everyone can enjoy the content. My absolute favorite was "Android Studio for Experts". So many tips and tricks!

Check out the playlist for more.


I took many sketchnotes during the summit. Here are a few of them:

I will scan them and add the high-resolution version to this PDF when I get home: Download the current edition to get an email when it is updated.


Android Dev Summit gave us Android developer lots of in-depth technical content and easy access to the team. I hope Google will do it again!

Saturday, November 7, 2015

2016 Speaking Goals

I started public speaking in 2012 with a New Year's Resolution. It was a great way to gather my thoughts on what I want to share, and have grown a lot since then as a speaker. Last year Cate and I started Technically Speaking to help other people to start speaking at technical conferences, and we would like to take advantage of the new year to get more people to set speaking goals.

As a part of our birthday celebrations, Technically Speaking is offering 1-hour mentoring sessions to help people turn ideas into reality.

To get the ball rolling, here are my goals:

  1. Revamp my speaker page
  2. Give a keynote
  3. Help 3 first-time speakers give talks at conferences

Revamp my speaker page

Currently my speaker page is a list of all the talks I have given. I would like to update it to highlight certain talks, embed some videos, and also state my speaking requirements. I really like how Rachel Andrew explains her policy, and would like to create something similiar.

Give a keynote

I gave my very first keynote at Android Summit this year. I prepared a lot more than a tech talk, but it was also a lot more rewarding, because as a keynote speaker I try to motivate people to step out of their comfort zone. I would like to do that again.

Help 3 first-time speakers give talks at conferences

Navigating the speaking scene can be quite daunting, especially if you have never given a talk before. I broadcast tips and tricks on Technically Speaking, but nothing beats 1-on-1 mentoring, both for the mentor and mentee. As a mentor, I get the satisfaction of seeing concrete results.

Help me help you achieve your goals and mine. Post yours!

Friday, November 6, 2015

MVP: The Missing Link

I have been wanting to learn the Model View Presenter pattern for a while, and was super excited to get Michael Cameron to give a talk on it at GDG Boulder last night.

View Interface

I have this vague notion that MVP is good for JUnit testing, and I finally figured out why. The secret, the missing link, is View Interface, which is not a part of the MVP acronym. View Interface defines the contract between the view and the presenter, allowing you to mock one while testing the other.

With View Interface, you can compartmentalize your Android UI code into the view (typically a Fragment or Activity), which communicates with your presenter solely through the View Interface. This separation allows you to mock your View Interface with zero Android code, which means you can test your presenter with JUnit on the JVM.

Mocking via build flavors

Mocking is essential for hermetic testing, but people are often intimated by dependency injection frameworks like Dagger. If you prefer, you can provide mocks to your test using build flavors. An excellent technique!


Mockito is a great mocking framework with a fluent API. One very nice feature is mocking via annotations. To use that, annotate the fields you want to mock with @Mock, and initialize them all with MockitoAnnotations.initMocks() in your @Before function.

private MyThing myThing;

private OtherThing otherThing;

public void setUp() throws Exception {

This is equivalent to:

private MyThing myThing;
private OtherThing otherThing;

@Before public void setUp() throws Exception {
  myThing = Mockito.mock(MyThing.class);
  otherThing = Mockito.mock(OtherThing.class);



Google has published the excellent Android Testing Codelab going through an app with the MVP architecture. You can see JUnit and Espresso testing in action, mocks via build flavors, and various other techniques. Go check it out!

Thursday, November 5, 2015

Google Games: Leaderboard + Achievements

I have a weakness in cute things. I often play cute games, telling myself that I do it to "learn about game mechanics". This time, I actually integrated Google Play Games Services due to inspiration from playing!


My latest addiction is Alphabear. You earn bears while playing a word game, which gives you extra powers. They show you the list of bears you have collected:

I want that for Fit Cat! A catalog, if you will, showing all the cats that you have seen. Initially I was going to do the UI and tracking myself, but then I came across Google Games Achievements. Perfect!


When I started looking into Google Games, I learned about Leaderboards as well, which seems a simpler concept to launch with. I just need to submit the number of steps to Google Games, and everything else is handled for me. Great!

One problem though: Fit Cat is a watch face, and the watch does not have direct internet access. To upload the steps, I transfer the data to the phone using the Wearable Data Layer API and send it to Google Games in a WearableListenerService.

To test that, I needed to pace around the house, because the Data Layer API only syncs when the data changes. If I sit on my chair in front of my computer, the number of steps stays the same, and so I will not get a callback. It was pretty hilarious, me pacing around and rushing back to the computer to check the logs and see if the phone received data.

Placeholder achievements

I was going to publish my game with the leaderboard, but got blocked because Google Games requires at least 5 achievements. This was right before Big Android BBQ, and I did not have a lot of time before flying to Texas. So I added 5 placeholder achievements and made them hidden, and launched.

Actual Achievements

After I launched leaderboard, I wanted to go back to repurpose the hidden achievements to show cats. I want them to be public so that you are motivated to reach a goal level to see a certain cat.

Alas, I cannot switch an achievement from hidden to public once I published them. So I created new achievements for the cats.

While "May appear at 10000 steps" gives people a goal to walk more, "Secret" is just really mean if it is not attainable. I was holding off the launch until I came up with 5 achievements to backfill the placeholders. That took a few days, but I now have some fun ones for people to discover!

Play Games app

The nice thing about integrating with Google Play Games Services is that your game will show up in the Play Games app. Friends can compare achievements with each other, which is really fun.

However, Fit Cat was not showing up, and I was not sure why. Turns out you need to categorize your app as "Game" rather than "Application" on Google Play, so now Fit Cat is a "Sports Game".

Usually you play sports games by tapping your fingers on screen and pretending to be playing sports, but this one you actually play with your feet in real life!

Easy gaming

Google Play Games Services has a lot of built-in UI, making it super easy to add gaming to your app, even for a non-game like Fit Cat. There was a few non-obvious requirements (ahem, minimum 5 achievements), so I'd recommend going through the checklist during planning, not before launch like me.

Overall it's a great enhancement to my app, for very little effort. I hope you like it too!

Saturday, October 24, 2015

Big Android BBQ

Just got back from Big Android BBQ, and it has been super fun!

Korean mall

I arrived the day before the conference to hang out with Virginia Poltrack, my partner on Fit Cat. I needed a pencil case for my Copic markers so we went to the Korean mall in Carrollton.

First stop was H-Mart, where we ate some yummy dumplings and bought Asian fruits and snacks. And then we went to Daiso, my favorite Japanese dollar store.

I found the perfect pencil case! It was actually a water bottle case, but the top-opening zipper let me see the color of all my markers. I love it.

BBQ decor

The Big Android BBQ team did an amazing job on the decor. The keynote stage was a diner set, and there were lots of nice touches everywhere.

Tech talks

To be honest, when I first looked into this conference I was worried that it is more of a party than a technical conference. I decided to go any way, betting on Google Developers to provide a healthy dose of Android on top of the BBQ.

Colt McAnlis opened the conference with a hilarious Texan keynote.

I went to the automatic performance testing codelab, which was really good, albeit the facilitators running it way too fast.

I ended up not going to too many Google sessions because I brought 3 lady speakers from Colorado with me, and they all gave excellent talks!

I also really enjoyed the animation talk by Marie. Love her method of sticky note + stop motion video for prototyping!


I gave my Advanced Android Espresso talk towards the end of the last day. It was my second time giving this talk, so I was pretty relaxed about it. But the projector stopped working in the middle of my presentation! I stood on stage not sure what to do, and literally said, "Help!"

The AV technician came to debug, at which point all the plugging and unplugging crashed my laptop. So I asked to borrow a computer from the audience. After a while the projector was finally working, and what did I do? Accidentally close the browser on my loaner laptop, which had the slides preloaded. The conference wifi wasn't connecting, so a friend set up his Android phone as a wifi hotspot.

With all that, I finally resumed my presentation. I think I stayed quite calm during the whole fiasco, but it totally disrupted the flow of my talk. I was very pleased that the talk was recorded though, and the AV team at Google did an amazing job with the editing. I had to watch it 3 times to find the cut point!

Super friendly crowd

I really enjoyed Big Android BBQ. Everyone is so friendly, and there were many fun little details. The sessions vary in technical depth, but caught quite a few good ones. All in all a great event!

Tuesday, October 6, 2015

Espresso: Save and restore state

Do you save and restore state of your activities, fragments and custom views? Do you test them?

One way to test saving and restoring state is to rotate the screen in your Espresso test.

private void rotateScreen() {
  Context context = InstrumentationRegistry.getTargetContext();
  int orientation 
    = context.getResources().getConfiguration().orientation;

  Activity activity = activityRule.getActivity();
      (orientation == Configuration.ORIENTATION_PORTRAIT) ?

With this helper function, you can write tests like this:

public void incrementTwiceAndRotateScreen() {

      .perform(click(), click());



Source code under rotate-screen

Like this article? Take a look at the outline of my Espresso book and fill in this form to push me to write it! Also check out the published courses:

Saturday, October 3, 2015

How I prepared my keynote

The idea

My speaking buddy Corey Latislaw and I were both speaking at Write/Speak/Code. We talked about taking our speaking career further, and decided that keynote will be the logical next step. We were not sure how people get to keynote, but figured that we can brainstorm ideas and submit them as conference proposals.

Corey ended up keynoting at Droidcon NYC and I gave my keynote at Android Summit, just half a year since that day we brainstormed. Not bad!


This is a fancy word for cutting paper into little pieces, write one point on each, and arrange them on the table. This is how I organize my ideas. I like the transient feeling of pencil and paper. Nothing is set in stone, and I am free to rearrange everything.

Talk it out

Once I organized the storyboard into a linear narrative, I sounded out the ideas i.e. I gave a very early version of the talk to a lovely white wall in my house.

It was horrible. I stumbled in many places, unable to vocalize my thoughts. Normally I just talk to my technical slides without any scripts, but a keynote is very different. I need a strong narrative, and I decided that scripting is the way to go.

Write the script

I started writing my talk as if it was a blog post. Unlike speaking to my pencil-and-paper slides, I can jump from place to place to flesh out the paragraphs. I wrote 5 pages of text, and felt really good about it.

Read the script to time it

Next I read my script aloud to see how long it would be. It was 11 minutes, and I panicked, because my keynote was supposed to be 30 minutes.

Add more material

I knew I needed to add more material, but I was not sure what. At that point I was hosting the Technically Speaking hangout, and after we got off air I told Caroline Goyder that I am short on material. She told me to tell stories. Of course!

I added some personal stories, and also added a section at the end to give some counter points to balance the rosy picture I painted in the early part of the talk.

Make slides

My talk was much more meaty at this point, and it was time to try talk it out aloud to actual slides. That meant I had to make the slides.

My slides had a lot of illustrations. I redrew the pencil-and-paper slides on a drawing app on my tablet and imported them into Keynote, adding drop shadows to make them pop.

You can read more about how I draw the slides here: How to make hand-drawn slides.

Practice with my slides

Once the slides are done, I read my script while advancing the slides. It was 25 minutes long, which was perfect. Next I gave the talk to myself with just the slides, no script or speaker notes, to make sure there were enough visual cues for me to remember the flow. I recorded this version with Quicktime so I can make timing adjustments as necessary.

Live audience via Google Hangout

I want to get some feedbacks for my talk, so I scheduled a Google Hangout with my friends to give it to a live audience. We had quite some technical hiccups, namely, they could not see the slides. As a result some part of the talk was a bit confusing, but overall they liked the content, and gave me some pointers to improve.

Schedule tweets

Finally, I scheduled some tweets with Buffer so the audience can get relevant links as I speak.

I wrote a separate blog post to explain how I did it: Live tweet my own talk.

My outfit

I want to wear a dress for my keynote, but I need somewhere to clip the microphone. A belt wouldn't work since the dress I picked didn't have belt loops, and I didn't want to wear a jacket. I ended up wearing shorts under my dress.

The bad news is that I had to run to the bathroom to clip the microphones onto my shorts and thread them up to my neckline. The good news is that the shorts were robust enough to support the weight of two microphones, one for the sound system in the room, one for the video recording.

Show time

I went to the venue early to test the projector, walking to the back of the room to make sure that the text is readable. I also tried my presentation remote. After that I spoke with the cameraman and AV person to make sure that everything was in order. With that, I was ready for show time!


How to make hand-drawn slides

I have been doodling quite a bit for my sketchnotes, and I wanted to use them to illustrate my Android Summit keynote.

Pencil-and-paper draft

When I organized my thoughts for the talk, I cut paper into small pieces and draw one picture on each. These are the draft illustrations.

Some of them I was not sure how to draw, so I searched on the web for outline images of the concept, and copied it.

Copy pictures from the web

When I first started sketchnoting, I was really hung up on the idea that I was doing art, and copying is a big no no. But I copy code from StackOverflow all the time, and had no problem with that whatsoever. So I started copying drawings, and found that it always comes out as my own style (due to the lack of artistic skills to make precise copies), so I don't feel bad at all about copying.

Elephant I tried to copy

My elephant

I pick images that have simple outlines, and not too many curves. I found it difficult to copy curves, and if the drawing depends on the curvature to convey the idea, my copy will look horrendous. So I just avoid those.

Redraw on tablet

Once I was happy with the draft slide deck, I redrew the slides on my tablet.

I did not have time to investigate which software I want to use, so I just did a search on a drawing app on Android that supports layers. I ended up using MediBang Paint.

I wanted layers because I reuse some components of my drawing. For instance, I have a book icon to describe experts as people who wrote books, and then later I have a "Rant Book" where I jot down talk ideas.

It was much harder to draw on the tablet than on paper. The tactile feedback was very different. Also if I rest my hand on the tablet, it will make marks in unexpected places. Frustrated, I wore a glove to prevent accidental touches.

Also, the export UX flow for MediBang Paint was quite clumsy, so I spent quite a lot of time preparing the image files.

Import to Keynote

After I exported all the images as transparent pngs, I imported them into Keynote. I added drop shadows to make them pop on the page. I then add reveals and animations as appropriate.

My style

It was a lot of work to make my own illustrations, especially since I am a developer by trade and did not have a good workflow. But it was totally worth it. I really like the final look-and-feel, which adds a personal touch to my talk.

Live tweet my own talk

My Android Summit keynote refers to many of my blog posts, and I want to provide links for people to read more. I could stuff all the links in the slide deck, but I decided to try something fun: Live tweet my own talk.


I used Quicktime to record my talk rehearsal, and watch the video with a pencil and note pad to jot down the minute marks that I am on a topic with a relevant blog post.


With the timings, I schedule the tweets to using Buffer so they go live as I speak.

Ask people to follow

I put my twitter handle on every slide, and tell people to follow me so they can get the relevant links as I speak. People were really surprised to get notifications for my tweets while I was clearly still on stage busy speaking!

Thursday, September 10, 2015

Sketchnotes 2015

I started sketchnoting in March 2015, and love how it connects me with people and ideas. Most of these sketchnotes are already posted on my twitter account using my phone, but I thought it’ll be nice to collect the scanned version for easy browsing. They are much higher resolution, and also color corrected.

I was waiting until the end of the year make this collection. Then I realized, hey, we live in the internet age, where things can be updated!

I am hosting the PDF at​ so I can add more sketchnotes until the end of the year, and you will get email notifications when I do.

Download Sketchnotes 2015

Enjoy, and looking forward to your sketchnotes!

Thursday, September 3, 2015

Droidcon NYC 2015

I was really excited about Droidcon NYC, not only to learn the latest in Android development, but also to hang out with my fellow female developers. With 22% women speakers, it was not difficult to bump into them during the conference. And I loved it.

Android Dialogs

Huyen and I flew in a day early to record for Android Dialogs, and we got a lot of footage to edit. Here is a recap video to thank everyone who helped us, especially Yash who booked a conference room at her office for us.


My talk, Advanced Android Espresso, was assigned to a smaller room upstairs. I have to admit I was disappointed when I saw that. However, everything changed when I was actually in the room. It was packed, and people were staying at the back. The energy was way better than the main stage, which can hold all the attendee so by definition will be rather empty during the 4-track sessions. I much prefer to have a full house!

Droidcon NYC talks are 40 minutes each, and I had so much to share on Espresso that I took them all up. At the end of my talk, I said, “I won’t be taking live questions. Please come up to chat off stage.” Afterwards, my friends told me that they were quite impressed that I dared to defy the norm of taking questions after a talk. Hey, it’s my stage, and I get to call the shots :)

Diversity panel

Besides the Espresso talk, I was invited to be on the diversity panel at Droidcon NYC. We got an audience question on how to cope with a misogynist boss. A female panelist replied that sometimes the best thing to do is to walk away, only to be contradicted by a male panelist, who suggested talking to HR.

“Go to HR? That will destroy your career!”, I thought to myself. “Why would he say that? Are we now touting the party line?” I was so shocked that I did not know what to do. Fortunately, Corey jumped on stage and said what I wanted to say: HR is there to protect the company, not the employee.

We had a discussion off stage after the panel, and to my surprise, the men actually did not know the horror stories of women going to HR only to face retaliation! It was so widely circulated in my circle that I assumed everybody knows.

This panel was truly an eye opener.


I started sketchnoting in March, and it was been amazing to see the community pick up on it. There were so many of us sketch noting at Droidcon NYC, including a professional who recorded the keynote by Corey Latislaw.


One of the speakers had an emergency and could not make it to the conference. The other speakers want him to be there in spirit, so they inserted a meme slide to their deck!

Droidcon is a truly special community. We are fun and helpful, always ready to step up and make things happen. So honored to be a part of it!

Monday, August 31, 2015

Speaker outreach: Your turn

I launched a grassroots campaign to bring more women to the stage of Droidcon NYC, because I was sick and tired of conference organizers saying that they tried to diversify their speaker lineup, only to see the same composition over and over again. I did it to prove a point, that it is possible.

Proof of concept

The proof of concept was a great success: we had 22% women at Droidcon NYC. But it was also a lot of work. A LOT of work. I published what I did so others can use it as a blueprint to do the same, because I cannot go make this happen again and again for other conferences. It is not scalable.

I need you to step up.

Up the ante

Conference organizers, you are not off the hook. The fact that I did it as a grassroots effort means that you need to do better. It does not mean that you can now offload the responsibility.

There are so many more things you can do in an official capacity:

  1. Clear guidelines. To diversify your speaker lineup, you need to encourage more first-time speakers, whose default is to believe that they don’t have anything worth talking about. However, if you give a concrete list of topics and provide the schedule and description to previous editions, chances are they will see something that matches what they do, and be more compelled to submit a proposal.
  2. Official feedback. An outside mentor can only guess how the conference curates content. As the organizer, you can work with the potential speakers to tweak their proposals so that they are more appropriate for the audience and avoid clashing with other proposals.
  3. Find more sponsors.To level the playing field for people from underprivileged backgrounds, cover the travel expenses for the speakers. This removes a major roadblock for many people, and is much more difficult for a grassroots effort to provide.

Doing is caring

Lip service is not enough to move the needle. You need to put in the effort, and keep at it. I hope my example at Droidcon NYC motivates you to step up and take action!


Monday, August 24, 2015

Friend Spell with Google Nearby API

Google recently rolled out Nearby API, allowing nearby devices to message to each other. When I saw that, I thought, party game!

Friend Spell

The goal of Friend Spell is to spell different words with the first letters of the names of your friends. In the example, Chris, Amy and Rae spell the word CAR. If you need to spell TAXI but Xavier isn't in the room, you can find any 4 people instead.

Download from Google Play:

Open source

I have decided to open source the game so people can study an end-to-end app, complete with tests.

I did not check in my Nearby API and Google Plus credentials though, so you'll have to add your own in AndroidManifest.xml as well as app/google-services.json file. Refer to the Nearby API and Google Plus documentation for more information.

Technologies used in the project:

Droidcon NYC

Please download Friend Spell and try it out, especially if you are attending Droidcon NYC this week. I'd love to see it in action at a conference!

Tuesday, August 18, 2015

Droidcon NYC: 22% women speakers

I meet a lot of my fellow Android developers at conferences, but I don't see too many women at these events, especially on stage. Organizers claim that they try to get more female speakers, but it is too difficult. So I thought, hey, let's get all the female Android devs I know to submit to a single conference, and see what happens.

Get organized

I got this idea in March, and started a Google Doc to co-ordinate the efforts. We picked Droidcon NYC as the conference for everyone to submit, because it is a good location for people from North America and Europe, and we will have a lot of time to rally people. At that point the conference date was not even announced yet! I invited everyone I know, and ask them to add more people. Corey also did a LinkedIn search to expand the list to folks outside of our social circles.

No excuses

When I asked people to submit a talk, there are a few common concerns:

  • I have nothing to talk about
  • No one wants to listen to me
  • I have no money to travel to the conference

Fortunately I have answers to all of them.

Brainstorming Hangouts

To help people come up with talk ideas, we met on Google Hangout to brainstorm. The funny thing is, most people has come up with an idea or two before showing up at the Hangout, so there wasn't much brainstorming going on. The Hangout is mostly a commitment device for people to set aside some time to think about what they can talk about.

Feedback on the proposals

To convince people that they have something important to say, everyone post their talk ideas on the shared Google doc.

We offer feedback on how to make the abstract better, and also comments on talks that we want to hear. For some reason most people believe that no one wants to hear from them, so it is very reassuring to know that others actually want to learn more.

There are ways to get funding

Money is always a concern. A lot of people just assume that they cannot afford to speak at an out-of-town conference, but us speakers know it is not true.

While a lot of conferences don't have the budget to cover the travel expense for all speakers, many do have a little bit of leeway to help those in need. Ask for help if you need it. There are ways to make it work.

In the case of Droidcon, Intel has set up a female developer sponsorship program. Having a source of funding helped tremendously - people don't immediately dismiss the conference as unreachable.

Q&A with the organizers

To address any other concerns, I arranged a Hangout with the Droidcon organizers:

It is much more convincing when the conference organizer tells you that, yes, we want you to speak!


A huge part of this process is sending reminders: email blast to remind everyone of the submission deadline, but also nagging people individually until they submit. I think this is the part where most conferences fall short.

Announcing call for proposals to mailing lists is only the first step. Most people assume that they are not the target, and you have to repeatedly tell them that you indeed want them to speak, help them along the way, and remind them to take action.

People are busy, and if you want results, you have to insist.


We have 14 out of 64 female speaker froms at Droidcon NYC, making 21.875%. While I was hoping for 50%, this is a respectable result, especially since I was leading a grassroot effort, not an official one.

Also, one of the keynotes will be by Corey Latislaw, who proposed the keynote as a part of this effort!

Lessons learned

  1. Start early. It takes a lot of time to rally and nurture potential speakers.
  2. Provide mentorship. Be ready to answer questions about everything from topic ideas to how to fund the travels. Mentorship can be from experienced speakers, but peer support is very powerful too.
  3. Offer to help. I was not an organizer, yet just by telling people about the Intel sponsorship I was able to ease the minds of many people who thought they will not have the money to travel to the conference. For organizers, even if you cannot cover everyone, stating that travel assistance is available on a case-by-case basis can go a long way.
  4. Keep at it. Most importantly, follow through! Asking once is not enough. Monitor the whole process to make sure no one drops off. Send reminders. Nag!

Follow-up post for conference organizers: Up the ante.

Saturday, August 8, 2015

AT&T IoT Hackathon Boulder

Last week I went to the AT&T Internet of Things Hackathon in Boulder with Brenda, Sepideh and Joan from Android Atelier. After a very intense 24 hours, we won!

A part of Android Atelier is to encourage everyone to document what we do. For this event, we recorded it three ways: blog, sketchnote and video!


Sepideh wrote a very detailed account right after she got back, and then a follow-up on how to control the Harman speakers once our prizes arrived!


I wanted to visualize the ups-and-downs we went through at the hackathon, so I made an annotated graph.


Brenda made a video with our demo, the winning announcement, bloopers and various tidbits from the hackathon.

Source code

The sound only works with Harman speakers, but the NFC part should work as is. I got some NFC tags as swag from conferences. If you don't have them, try hotel key cards or luggage tags. Let me know if they work.

Wednesday, August 5, 2015

Keeping up with side projects

I have so many side projects that I launched a newsletter to track them:
I got some really nice responses:

Well indeed, how do I find the time?


I am a freelancer, and my workload fluctuates a lot. During the slow times I can devote my energy to longer projects like Pluralsight courses.

Work from home

Working from home means I don't commute. That saves me at least an hour day. Also, my clients are all in California, and I work remotely from my home in Colorado. This means I am one hour ahead of them. I start my day at 9am Mountain time, and have one hour to do my own things before they get into the office.

It is quite nice to give myself time first, before I get busy with client work.

Incorporate sharing into my workflow

Many of my blog posts come directly from client work. I encounter a problem, figure it out on client time, and then write my findings on my own time. I often need to isolate the problem into a separate project, which gets shared afterwards. Read more on my workflow.

Taking notes at events

A great way to amplify your efforts is to record everything. You probably go to meetups like me, but do you write about it? If not, you are just an attendee, not a part of the event.

When I go to events, I live tweet or sketchnote, and then share them. For instance, I went to this awesome Bluetooth Beacons talk, made notes on the spot, and posted it:

Looks like I did a lot, right? I was taking notes while the speaker was talking, so no extra time there. I then spend 10 minutes or so when I get home to scan it on my flatbed scanner and run "Colors → Auto → White Balance" on GIMP, but you don't need to. Just snap a photo on your phone.

Alternatively, tweet during the event, snap some photos, then write a trip report. Here is the formula I use.

Go swimming

Taking notes during events is one way I multitask. Another one is swimming. You see, when I am in the pool, I get to think. I can come up with an outline for a blog post, compose a talk proposal, and in general organize my thoughts. By the time I am back at my computer, I can write much more quickly.

Have a schedule

One trick to make sure you allocate time to your side project is to have a schedule. We publish Technically Speaking every Tuesday, which means that I need to find CFPs, links and videos by Monday. It's a mind trick, but having a real deadline makes it much easier to find time to get it done.

Have a conspirator

To maintain that schedule, it really helps to have another person on the project. You feel bad about not putting in the effort, and also, when you are busy the other person can pick up the slack. I work with Cate Huston on Technically Speaking, and Huyen Tue Dao on Android Dialogs. They keep me on schedule, and make it way more fun!


Here are the tricks I use:

  • Allocate time for side projects (for me it's 9am to 10am)
  • Use writing formulae
  • Multitask by taking notes at events and thinking while exercising
  • Have a schedule
  • Have a conspirator