Tuesday, November 25, 2014

AnDevCon SF 2014

I can't believe this is my fifth AnDevCon already! This time I am living in Colorado, so Burlingame is no longer local. But as luck would have it the GDE Summit is one the same week at the Google headquarters, and I got to combine the two trips. The flip side is that they overlap quite a bit, and I ended up only attending the last two days of AnDevCon, plus the fireside chat Wednesday evening.

Fireside chats

There were two fireside chats / panel discussions at this AnDevCon, both very informative and entertaining:


I didn't go to many sessions, partly because I was only there for two days, but partly because each session is 75 minutes long. After subtracting time for keynotes and sponsor sessions, there was really only time for 3 to 4 sessions a day. Since I was giving two sessions myself, I ended up only going to 5 sessions.

My talks

My two talks were back-to-back on Friday morning. First I had Advanced Android TextView at 8:30am.

I gave the 40-minute talk at Øredev, but the audience reaction was quite different. Here I was among Android developers, and people jumped in with interesting questions pretty much right away. I loved that! I was having a great good discussion off stage afterwards as well, but had to cut it short since I needed to run to another room to give another talk.

My next talk, Fun with Android Shaders and Filters, was in the Regency ballroom. Quite a different experience to present from a stage.

The crowd was a bit larger, not sure if it was 10am vs 8:30am, or people were more interested in graphics. In any case, both talks went very well!


RxJava is quite hot among in Android world, and I am very curious about it. I attended a talk at Droidcon London but didn't quite get what it is, so I tried again with a session at AnDevCon. Alas:

This time I got a bit further: I understood that RxJava builds on the concept of asynchronous sequences, and as a result you can apply many operations on them. That's why there were all these marble diagrams for map, filter etc. I think I should give up on trying to learn it by listening to a talk though, and instead get my hands dirty with tutorials:

Tips on building SDKs

AnDevCon ended on a great session from Ty Smith sharing his experience building the Fabric SDK, filled with tips and insights.

Check out the video for the full talk.

New speakers

I am very happy to see new speakers at AnDevCon, sharing their knowledge with everyone. Do you work on Android? If so, submit a talk!

Tuesday, November 18, 2014

Android Stacked Fractions

I read about a small new feature on TextView in Android Lollipop:

I never heard of CSS font-feature-settings, but a quick internet search led me to a sandbox, where I can play with OpenType font features such as kerning and ligature. Not particularly exciting, but then I scrolled down the list and saw fractions. I experimented with different settings and came up with this:

Stacked fractions! Let's put that in a TextView.

First, I need a font that supports afrc. I chose Nutso2, an Apache 2 licensed font.

I first tried to set font settings on the whole TextView:

Typeface typeface = Typeface.createFromAsset(
    getAssets(), "Nutso2.otf");
textView.setText("1/2 2/5");

Looks good. But then I want to display one and a half. If I set text as "1 1/2" there is a space, and if I use "11/2" it shows eleven over two. What to do?

I went back to the Nutso project for their demo page:

1<span class="afrc">1/2</span>

HTML with span, eh? Why yes, I can do that in Android! We'll need a TagHandler with a custom Span.


The TagHandler is called twice: at the start of the span, again at the end. We mark the beginning of the tag with a Spannable.SPAN_MARK_MARK so we can retrieve it at the end of the span. With that we have the start and end positions of our stacked fraction, and we can apply our FractionSpan to activate the afrc font feature settings.

Now we have mixed fractions, no space. Yay!

Source: https://github.com/chiuki/advanced-textview (FractionActivity)

To hear about this and other cool TextView tricks, come to my Advanced Android TextView talk at AnDevCon this Friday!

Thursday, November 13, 2014

Øredev: a superbly run conference

Technically Speaking

When Cate and I was touring Copenhagen, we talked about how we got into public speaking. One thing led to another, and we decided to publish a newsletter together. We had a little bit of time on Monday before Øredev, so we put together our first issue in the hotel lobby!

Sauna, bus tour, glögg and the city hall

After we prepared our newsletter we met the organizers and other speakers to head to Kallbadhuset, a Swedish bath house perched on top of the Baltic Sea. We had an appetizer (herring!), went into the sauna (hot!), dipped in the Baltic Sea (cold!), and then had dinner (more fish!). My first night in Sweden, and it was definitely super Swedish.

And that was just the start of the speaker activities. Tuesday they organized three things for us, starting with a bus tour of the city of Malmö. I signed up for the 3pm tour so I had the morning free, and grabbed Cate to see the astronomical clock in Lund.

Later in the evening, we had a pre-dinner event with glögg (glüewine) and pepparkaka (ginger bread cookies), and an acapella performance!

Then we moved to the City Hall, where we were addressed by the mayor of Malmö, and dined in this beautiful hall.

The conference

The conference started on Wednesday, with three days, eight tracks, more than 150 sessions total. With so many simultaneous talks, I had to make a choice every hour, and I came up with a strategy. I prioritize talks with:

  1. Great speakers
  2. Props
  3. Technology that I would not look into otherwise

Great speakers

James Mickens definitely falls under the "great speakers" category. His talk was hilarious!

Christian Heilmann explained why we are not using HTML5, with great visuals.


In the "props" category I have The Internet of Things Magic Show and Oculus Rift.

Great insights

Lots of great insights on how we interact with computers:


To top it off, Øredev invited Nile Rodgers for a candid chat!

A superbly run conference

Øredev is the best run conference I have ever been to. The attention to detail is amazing.

A round badge! With a lens in it!

The podium seen through the Øredev lens.

Sign posts pointing to the rooms. Much easier to see than signs on walls, which they also had.

A smoke screen!

Lightweight feedback screen at the door of each room.

Other impressive things:

  • There were at least 20 minutes between the sessions, so even if one session ran overtime it wouldn't eat up time from the next session. Also gave you time to hang out in the hallway and talk to people, grab a coffee etc.
  • Speaking of coffee, there were plenty of food: breakfast, lunch, snacks, and dinner!
  • And they treat their speakers really well. All travel costs are covered, and they pampered us with so many speaker activities.
  • Finally, all sessions are recorded, and uploaded right away. They were so efficient, I don't even know how they did that.

Here are my two talks:

Tack så mycket, Øredev!


After speaking at Droidcon London, I flew to Copenhagen to speak at Øredev.

Even though Øredev is in Sweden, you get there by flying to Denmark. This is because Malmö, its host city, is only 20 minutes by train from the Copenhagen airport. Since I have never been to Denmark before, I spent the weekend sightseeing in Copenhagen. My friend Cate is also speaking at Øredev, and we toured Copenhagen together.

I was sustained by conference high during my two-and-a-half-day stay in London. But come Saturday I crashed hard, and was pretty much unconscious the whole flight from London to Copenhagen. To combat my jet lag, we walked almost 3km the to see the Little Mermaid.

We also went to Kastellet, the star fortress next to Little Mermaid. But it was so foggy and gloomy that I didn't have any good photos.

The sky cleared up a bit the next day so I took more photos.

We walked to the Glyptotek museum to see Degas' ballerina. I really like the indoor courtyard.

Breakfast was really late since I slept in, so when we were done with the museum it was tea time already. And so we went to Conditori La Glace for tea!

Afterwards we went to Tivoli Gardens, the second oldest amusement park in the world.

Normally I don't go to amusement parks when I travel, but I am very glad that we went to Tivoli Gardens. There is the ride which goes really high up, offering a great view of Copenhagen. I don't think you can get that view anywhere else!

The ride from below. I was not crazy enough to take a photo on it.

Without a proper lunch, both of us were craving real food. Cate suggested sushi, to which I nodded enthusiastically. We went on to have this absolutely amazing meal at Sticks'n'Sushi.

I am still thinking about that meal! Too bad they don't have Sticks'n'Sushi in the US.

Monday, November 10, 2014

Droidcon London 2014

I had a great time speaking at Droidcon London 2012, and I am very happy to go back this year.

First thing first: gotta love these super cute icons!


Day 1 is barcamp. Everyone got a chance to get on stage and pitch their session.

There were quite a variety of topics. I was entertained by a hilarious app clinic, killed the refresh button with SyncAdapter, and discovered that you can address any 3mx3m grid in the world with 3 words.

Practical Best Practices

We rounded up the day with a satire talk by Chet Haase: Practicing Practical Best Practices for Software Development Practitioners.


Day 2 is presentations, starting with keynote from Chet the Googler, not to be confused with Chet the consultant from the day before, who wore a tie.

Chet the consultant (Credit: Skills Matter)
Chet the Googler (Credit: Skills Matter)

Chet told us about What's New in Android, followed by Chris and Nick with more Lollipop tips:


Next I learnt about design from Juhani Lehtimaeki and Taylor Ling.

Graphics trilogy

In the afternoon, there were three talks on graphics, including mine.

Mark opened the trilogy with Graphical Magic. And by magic I meant he was setting stuff on fire!

With that great opening, Mark went on to show us how to do image manipulation programmatically.

Next in the trilogy was my talk, Fun with Android Shaders and Filters, where I showed more image processing techniques.

Slides: http://chiuki.github.io/android-shaders-filters

And finally, Sebastiano Poggi covered the Skia pipeline in Framing the Canvas.

Best part: The people

Droidcon London is one of my favorite conferences. The talks are great, but more importantly I get to hang out with really awesome people.

Thank you everyone for the wonderful conference!