Sunday, July 1, 2012

Public speaking mid-year score card

Can you believe it's July already? I started the year with a resolution to be a public speaker, with the specific goal of giving 5 lightning talks and 3 full-length lectures. Let's see the mid-year score card!

Lightning talks

  1. April 2, 2012: Ignite Where 2012, San Francisco, CA
  2. June 28, 2012: Ignite Google I/O, San Francisco, CA

Full-length lectures

  1. April 6, 2012: Fluid Android Layouts, WindyCityGo, Chicago, IL
  2. April 11, 2012: Caching Strategies for Mobile Apps, Philly ETE, Philadelphia, PA
  3. April 17, 2012: Mobile Caching Strategies, Twitter Engineering Submit, San Francisco, CA
  4. May 16, 2012: Reusable Custom Components, AnDevCon III, Burlingame, CA
  5. June 8, 2012: Progressive enhancement for Android web apps, Dutch Mobile Conference, Amsterdam, the Netherlands

Looks like I'm coming short on the lightning talk side, which is quite surprising. I thought it would be more difficult to get accepted to give lectures. Also interesting that all my lightning talks were in Ignite talks, which is way more challenging than the speak-at-a-meetup quick talks I had in mind when I came up with the goals.

Ignite at Google I/O

Ignite talks are challenging because it follows a very specific format: 5 minutes, 20 slides, auto advancing. The auto-advancing slides is the trickiest bit, since you don't control the rhythm any more. I rehearse way more for Ignite than my full-length lectures, because I need to internalize the timing to sync my speech to my slides. It's almost like lip-syncing!

The first time I gave an Ignite talk was at Where 2012, to a crowd of 30 people or so. I was rather scared of the auto-advancing slides, but I found that I just need to wait until the next slide to appear before transitioning to a new topic.

Ironically, because I felt I did pretty well at my first Ignite, I was more nervous when preparing for my second one. I kept thinking that it was not quite as good. I mentioned that to my friend Julia, and did a practice run with her. She loved it! I notice that I really feed off the energy from the audience, even if only one person was listening. So the practice run was all I need to get back my confidence.

Ah, confidence is such a fragile thing. I walked into the room, and wow, it's big! It probably seats a thousand people. A thousand people! Plus the event was live streamed. I never spoke to such a large crowd, and I was so ridiculously nervous while waiting for the show to start. Fortunately once I got on stage I was back to my elements.

Here is the recording of the Ignite show at Google I/O. Let me know what you think!

Tuesday, June 19, 2012

How to be a confident speaker

Zach Holman posted an excellent article on tips and tricks for public speaking, which got me thinking about my own experience. I have given a few speeches now, and I'd say the most important thing is to be confident. I know, that's like saying you need to breathe in order to stay alive. So here are some practical tips.

Practice until you are comfortable, but not more

I have heard many contradicting advice on practicing: practice until you memorize your speech, don't memorize your slides because the presentation will be stiff, record your speech to find things to improve, etc etc. Truth is, everyone is different, so the rule of thumb is practice to the point you feel comfortable.

Personally I never write down what I plan to say, for I fear that I will miss a sentence when I'm on stage. Instead I use my slides as guidelines and talk over them. This gives spontaneity to my talks, makes them lively. I also don't do speaker notes, but some people swear by them. Again, do what's comfortable for you.

Have a mock session

Now, how do you make sure you don't over-practice until you beat the life out of your speech? Schedule a practice session! With a solid deadline you will have to stop practicing and actually give your speech.

When you give your mock session, do it for real: hook up your laptop to a projector, and speak to a live audience. This serves many purposes:

  • Time your speech. How many minutes do you take to go over a slide?
  • AV issues. How do you change the resolution of your laptop? If you are playing video, where does the sound go? How is the contrast on the images? Font size OK?
  • Learn to look at your audience. Connect with them, speak to them, clarify if they look confused. Chances are, you will feel encouraged by their approving nods, and forgot that you were nervous.
  • Stumble onto random problems, and recover from them. There is never a perfect speech, but knowing that you can get yourself out of a situation is very reassuring.

Most importantly, the practice session proves one thing: you can talk!

The audience assumes you know more than them

You've done your practice session, now you're ready for prime time. It's natural to be nervous, but remember, once you stepped on that stage, you are the expert. People come to listen to you because they want to learn from you. They could go to another talk, chat in the hallway, or stay home to watch TV. But no, they chose to come to your talk, because they believe you can teach them something.

The scale is tipped in your favor because you are on stage. Everybody wants you to shine, so whenever you have self-doubt, remember that.

It is okay to say I don't know

You gave your speech, and now comes the terrifying time: questions! I used to feel like if I don't know the answer I would disgrace myself in front of a crowd. But guess what, it's not a test! You are there to share what you know, not to be a walking encyclopedia. If you don't have a ready answer, just say so. Turn the question to the audience and ask if anyone knows. Usually an interesting discussion will unfold. If not, have them contact you afterwards, and promise to follow up.

Just do it

You cannot learn to ride the bicycle by reading a book. Start small, give a short talk at a local meetup. Be yourself, and go with the flow. You will be alright.

Tuesday, June 12, 2012

Dutch Mobile Conference

Ladies and gentlemen, I am proud to announce that I am now an international public speaker, for I just came back from Amsterdam after giving a talk at Dutch Mobile Conference.

Proposal

Since I just got started in public speaking this year, I had no idea how conference proposals are selected, and I was submitting to pretty much every conference that I have something to share. Android conferences are obvious, but I even submitted something to Fluent Conf, a javascript conference. Now, the normal thing to do is to propose a javascript talk, since I did work on web development for a year and a half. But no, I ended up drafting a talk on embedding a WebView in an Android app and writing a javascript bridge to call native Android functions from a web page. I wasn't expecting it to be accepted, but I thought I'd try anyway.

Fast forward a few weeks, and I was browsing Lanyrd for Call for Speakers, and stumbled upon the call for Dutch Mobile Conference two days before the submission deadline. DMC focuses on mobile web apps, so a talk on bridging web and Android with a javascript bridge sounds pretty relevant. Copy-and-paste I went, submitting my Fluent Conf proposal. On a fine morning in February I got an email from the organizer for DMC. They accepted my proposal!

Preparation

I did not prepare my talk until May, a few weeks before the conference. At the point I was panicking a little, because I don't use WebView in my day-to-day work, and I didn't feel comfortable giving a talk about it. I was speaking at AnDevCon III around then, and Stephan Branczyk asked me to repeat my session at his Android meetup. I told him that I'd rather give the DMC talk since I wanted to rehearse, and he liked the idea.

As I prepared the slides, I discovered that I am actually describing the Android implementation for PhoneGap. More panic ensued. After all, they could just use PhoneGap, so why bother listen to me explaining how to roll your own? I thought about not giving the talk at all, but flights and hotel have been booked months in advance, and I really couldn't get myself to give up the chance to see Amsterdam. I went ahead and give my talk at the Alameda Android meetup, and the audience found it interesting. One of them was using PhoneGap, and he was happy to learn the inner workings. That gave me back my confidence, knowing that I am still sharing valuable information.

Talks

Comes June, and off to Amsterdam I went. DMC ran alongside DPC, Dutch PHP Conference. The same conference pass was good for both conferences, and I ended up going to quite a few sessions on the PHP side. They were not strictly PHP talks though, but rather related technologies that are useful to PHP developers.

Scalability talk
Scalability talk

For instance, Thijs Feryn gave an overview of scalability, and many of the same technologies can be used for a Django or Rails server.

Frontend and backend
Frontend and backend

My talk was in the afternoon on the first day.

I reviewed my slides the night before my talk, and realized that I prepared it for the Android meetup, but this audience probably little or no experience in Android development. I did not really have time to prepare more slides to give an Android overview, so I just added a slide with the Android logo, and talked over it.

At the beginning of the session I warned the audience that it was going to be very heavy on the Android side, and invited them to ask me to clarify if anything was not clear. I was very happy when the questions got raised, because it meant people were following along. And they seemed to like the talk, according to feedbacks on joind.in. Yay!

Socials

The organizer took great lengths to make sure that everyone enjoyed the conference. There was a social gathering for all the attendees at a bar after the first day, and I stayed until 3am, chatting with everyone.

As a speaker there were even more events. The day before the conference we met in the hotel bar to get to know each other, then went to dinner at a restaurant next door. On the first night there was a speaker dinner, where we were presented our speaker gift - an Arduino!

Arduino Uno
Arduino Uno

That was the perfect gift for techies like me. I have wanted to tinker with Arduino for a while, but didn't get around to order one. So I am very excited about this gift.

Overall the organizers took really good care of the speakers, and I had a wonderful time. A big thumbs up to the everyone running the conference!

Monday, May 28, 2012

Sony SmartWatch as name tag

As I mentioned earlier, I got a Sony SmartWatch at AnDevCon. I have been trying to come up with app ideas, but most of them didn't pass the "I can just pull out my phone" test. I was chatting with some friends, and one of them unclipped the watch from its strap and clipped it on his shirt. Now that's an awesome name tag!

I decided to write an app that reads images out of a folder on the SD card and show them on the watch as a slideshow. I first wrote a widget, but that did not work well because there was a loading screen between each refresh. I looked into the SDK some more, and decided to write a control instead. I refactored my widget code to add a control, but the control simply would not show up on the watch. I was studying the sample code very carefully and just could not figure out why. So I went to bed.

The next morning I started a fresh project to write the control. That worked. I then added a widget. Now the widget would not show up. It suddenly occurred to me that perhaps the LiveWare manager stored the app properties in a database, and did not reset the state when I reinstalled the app, so it did not recognize the additional control/widget.

To test that theory, I went to "Manage Applications" and cleared the data of the LiveWere manager. Well well, now it didn't even know about the SmartWatch! I uninstalled the SmartWatch app and reinstalled it from Google Play. And then I did the Bluetooth pairing again. Finally I installed my extension, and indeed, now my control showed up. That was really difficult to debug!

At this point the control was just displaying some hard-coded images. I swapped in a MediaStore query to get images from the phone:

String[] projection = {
  MediaStore.Images.Media._ID,
  MediaStore.Images.Media.DATA,
  MediaStore.Images.Media.ORIENTATION
};
Cursor cursor = mContext.getContentResolver().query(
  MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
  projection,
  MediaStore.Images.Media.DATA + " LIKE ?",
  new String[] { folder + "/%"},
  MediaStore.Images.Media.DATA);

A few notes here:

  • I use ORIENTATION to rotate the image before displaying.
  • The "where" part of the query is specified by data binding. It is a safe way to say MediaStore.Images.Media.DATA + " LIKE '" + folder + "/%'"

The SmartWatch dims the screen to save battery, but a dimmed name tag is a bit useless, so I added an option to leave the screen on.

setScreenState(alwaysOn ? 
  Control.Intents.SCREEN_STATE_ON : 
  Control.Intents.SCREEN_STATE_AUTO);

After adding the option to change the slide duration, I was ready to deploy. Very curiously, I got a fatal lint error, complaining that I did not localize my app to zh-rTW and ja. I could disable the lint, but as luck has it I speak both Chinese and Japanese, so I decided to localize the app!

The extension is now available on Google Play:
https://play.google.com/store/apps/details?id=com.sqisland.smartwatch.slideshow

You can also check out the Chinese and Japanese descriptions. I got lazy for Japanese, so I did not talk about selecting a folder or using it as a name tag. If you have a good translation, let me know!

The extension took me 2 days end to end. Overall it was a pretty good experience, except the part where I needed to clear data from the LiveWare manager when adding a control to an installed extension.

If you are an Android developer and you would like to get a SmartWatch for writing your own apps, you can submit a request to Sony using this link: https://www.surveymonkey.com/s/VT9D25X. If you do, ping me. I'm curious what you'll do with the SmartWatch!

Friday, May 25, 2012

Monkey Write: Now with pronunciations!

When I showed Monkey Write to new users, 8 out of 10 people would ask me, "why doesn't it pronounce the character?" My philosophy has always been "launch early, launch often", so I put Monkey Write on the market even though it was missing this obvious feature. Not any more - the latest version of Monkey Write includes pronunciations!

I recorded the characters over the weekend:

See the fancy microphone? My friend does voice-over for videos as a hobby, and I spotted the microphone when I went over to his place for board games. I borrowed it for the recording, and the sound was wonderful.

For software, I used Audacity. It was fun to see the sound wave of the characters. Look like tropical fish to me!

I sounded out all the characters in a workbook, usually twice per character, and then exported each character as a separate ogg file. Audacity made that pretty easy, which was a relief, since I always ended up yelling at iMovie whenever I needed to edit videos. A media editing UI that makes sense! Such a pleasure. If you know any one who worked on Audacity, please give them a pat on the shoulder from me.

Monkey Write pronounces the character automatically when you enter this screen. If you want to hear it again, press the sound button on the top right corner. When you are done writing the character, you will hear the character one more time.

The pronunciation-enabled version of Monkey Write is now available on Google Play Store, Amazon Appstore and the NOOK shop. Grab a copy, and let me know what you think. Will be great if you can write a review on the store too!

Thursday, May 17, 2012

AnDevCon III

When I decided to get onto the speaking circuit, my very first acceptance was my proposal to AnDevCon, way back in January. Four month later I suddenly realized that the conference was coming up in a week, and got really excited. The anticipation reminded me of the way I felt when I was going to visit an amusement park. But instead of roller coasters and free fall machines I was looking forward to tech talks and new gadgets. And AnDevCon did not disappoint.

Great talks

The speaker lineup was quite impressive:

  • My favorite talk was by Jake Wharton, the author of ActionBarSherlock. He showed us some powerful design patterns, each with a dead simple drop-in library for implementation. On top of that he was very candid, so his talk felt more like a friendly chat than a stiff lecture.
  • SaÅ¡a Gargenta is so knowledgeable about the Android stack that my head was spinning just after a quick glance at his architectural diagrams. I learned a lot from his session.
  • I have watched Romain Guy and Chet Haase on video, but I had no idea that they are so funny in a live show!

My talk

I'm very honored to be speaking among such luminaries. Last month I read Confessions of a Public Speaker, and the author suggested bringing books as presents to encourage audience participations. I have not written any books, so instead I baked some Android cookies to give away.

I gave them to people who asked and answered questions, and I think that lightened the mood quite a bit. As the crowd warmed up we had a pretty good dialogue going, and I really enjoyed giving the talk.

Great discussions

Throughout the conference I got to geek out with my fellow Android developers, share our common frustrations over loading bitmaps, swap tips and tricks about xml declarations, and support each other in making outstanding applications. I am very happy that there was ample time between sessions for coffee breaks, where most of these conversations happened.

Great swags

The exhibition hall was a treasure trove. I got many t-shirts and fun little toys, but the exhibitors were also very generous in handing out devices to aid developers. I submitted a few app ideas to Sony and got a SmartWatch to develop them. The Blackberry folks was so impressed with Monkey Write that they gave me a Playbook to port it over. And on top of that, I won a Sony Xperia Arc S in the raffle!

Conclusion

Much like a visit to an amusement park, I am still abuzz with excitement from AnDevCon. I have quite a few new things to try for Monkey Write, and I may write an app or two for the SmartWatch too. I highly recommend AnDevCon to all Android developers.

More AnDevCon III coverage

Saturday, May 12, 2012

Popcorn.js with html5 slides

I heard about popcorn.js for a while, but did not have a chance to try it out. When the video of one of my talks became available, I knew I found a nail for this lovely hammer: I'll use popcorn.js to synchronize my slides to the video!

It only took a minute to embed the vimeo video. Next I wanted to change the size, so I added style="width: 160px; height: 120px" to the div container. No video. Baffled, I scoured the web for popcorn.js demos, and compared the source code with mine. By process of elimination I discovered that my html5 slides was to blame. The body tag has display: none so the unstyled articles tags do not show, but this means when popcorn.js cannot measure the size of the div container, it got zero width and height. As a work around, I added document.body.style.display = "block" after the html5 slides are initialized, but before I create the popcorn object.

Next I annotated the slides with timings from the video. I extracted the timings and use the Code plugin to update the slide. The first jump worked. But when I added a second one, the slides were no longer moving.

My code looked like this:

for (var i = 0; i 

After a lot of experimentation, I finally got it to work:

for (var i = 0; i 

Notice how I stash away the value of i in the hash as slideNumber and grab it from the options inside the onStart callback. What happend was that when I use the variable i directly in the callback, its value has been changed by the for-loop when the callback is executed, so it ended up calling gotoSlide(article.length), which is not valid.

My slides now have a small video playing in the top right corner, which auto-advances the slides when you start watching. Have a look and let me know what you think!

http://www.sqisland.com/talks/fluid-android-layouts