Friday, January 27, 2012

Anyone interested in an Android class?

Whenever other techies know I'm an Android developer, they always exclaim, "I want to learn that too!". So I'm toying with the idea of teaching Android to others.

I want to teach a class where we learn the different Android components by building an app. Currently I'm thinking of a parking companion app. The syllabus will look like this:

  • Session 1: Android basics: Activity life cycle, layout by xml etc. You will not be working on the parking app yet.
  • Session 2: Write down the location of your car. You type "Level 2, Area C" in a text box, and click the save button. You'll learn how to get the text out of the text box, save it, and retrive it when you open the app again.
  • Session 3: Add a picture. Use the camera to take a photo of your car, and store it alongside the note.
  • Session 4: Add GPS location. Get the latitude and longitude to link it to Google Maps.
  • Session 5: Map View. Embed a map in your app to show the location of your car.
  • Session 6: Wrap up. Summary of what we did, how everything relates to each other, pointers for further studies.

Since most people have a busy schedule, I'm thinking of making each session 3 hours long. The first two hours is lecture, and the last hour is lab, where you work on your laptop to code up what we just learned. That way you don't have to find time outside of class to do the implementation as homework.

I want to make sure everyone has the SDK installed at the first class, but I know it is hard to enforce that, so I'm thinking of running InstallFests before hand. People come with their laptops, we install Eclipse and the Android SDK together, and make sure everyone has Hello World running by the end. The InstallFests are useful for people who don't have the time for a structured class as well. I'm hoping that once you have your dev environment set up, you will be more likely to go through some tutorials and get started.

Would you take an Android class like this? How about the InstallFests? Please fill in this form if you're interested: http://bit.ly/wh1JMO.

Update 2012/03/09

I'll be teaching the Android class at Blazing Cloud starting April 18. More info here: Android For Programmer.

Bay Area Systers Dinner

I've been on the Systers mailing list for a while, and I've learned a lot from all the wonderful tech women on the list. 2012 marks the 25th Anniversary of Systers, and there are worldwide meetups in celebration. I volunteered to organize the dinner for the Bay Area, which was quite a ride.

Initially we were going to Amarin Thai for dinner. I was happily watching the RSVP number go up on the meetup page, until it hit 35. That's the capacity of the private dining room at Amarin. At that point I was really torn. On one hand I wanted to meet as many cool women as possible, on the other hand I didn't know how many no-shows I can count on. It would be bad if we had to turn people away at the door, so I started looking into Plan B, which involved asking Amarin to cater to a larger venue. Getting Amarin to cater was easy, but where do I find a place to host the dinner?

The solution came to me after I went for a swim at Eagle Park Pool. On my way out, I saw the Masonic Center, and I remember seeing people going there for a folk dance night some other time. Maybe they have a meeting hall for rent? I checked their website afterwards, and indeed they do! A phone call later I confirmed that the 100-person dining hall was available on Jan 26, so I knew there would be a Plan B.

Once the RSVP number crossed 40 I decided to switch to Plan B. Since the cost of the dining hall was fixed, the more people came, the cheaper it would come out. So I started sending emails to my friends at different companies to invite all the women engineer to join us for dinner. At the end we had 80 RSVPs!

55 Systers showed up for dinner tonight, and we had a wonderful time. Robin Jeffries, Her Systers' Keeper, shared with us the history of Systers, Grace Hopper Celebration, the Pass-It-On Awards, and other interesting tidbits on Systers and women in computing. BJ Wishinsky then told us the different ways we can be involved with the online communities around women in technology.


Robin

I also gave a little speech, but that's because I forgot to include gratuity in the initial calculation of the cost of the food, and came short on money. Fortunately everyone was very generous in chipping in, and we ended up with extra money for the Pass-It-On Awards Program.

I'm exhausted from all the excitement right now, but I'm very glad that I did it! I made some awesome new friends tonight, and I hope that there will be more meetups to come!

Wednesday, January 25, 2012

You can speak at a conference too

As I blogged earlier, my resolution this year is to be a public speaker. One of the difficulties in breaking into the speaking circuits is to be aware of conferences six months in advance to meet the call for participation deadlines, so whenever I hear about one, I share it with others.

Recently I shared the call for participation for FluentConf:

Are you a JavaScript performance guru? Have you got big ideas and mad JavaScript skills? Do you know the ins and outs of future ECMAScript specifications? Are you building or using new languages on top of the JavaScript runtime? Have you tied Node.js into beautiful knots to build out your app’s back end? Are you pushing WebGL to its limits? If so, we strongly encourage you to send in a proposal to speak at Fluent 2012!

Someone responded that she was not guru enough to speak, so she will just attend. This is so not true! I strongly believe that everyone has something to share, and we can all make the world a better place by contributing what we know. Estelle Weyl put it much more eloquently:

Realize that many people speaking at conferences aren't gurus at all. They just feel comfortable enough in a single sub-topic to present on that topic. Realize, if someone knows your topic like the back of their hand, they're not going to attend your session. Instead, they'll attend a session where the material is new.

...

Please, please, please submit talks in the niches you feel comfortable in. If all women wait until they master every nuance of their primary programming language we likely would have even fewer female presenters. If, in general, men waited for complete mastery too, we likely wouldn't have enough presenters to have conferences.

Read the full post here.

I reached out to O'Reilly to let them know that their call for participation is too intimating for first-timers, and they added an extra paragraph in response:

New to the speaking circuit? Never fear, we want to hear from you too! We’re actively seeking new voices and off-the-beaten-path topics to put on stage at Fluent. Any ideas, best practices, challenges, etc. that you’ve encountered and conquered are fair game—if it’s important to you, it’s probably important for others as well.

This captures the spirit of conferences much better - you are there to share your stories. Think through your day. Did you fix a particularly nasty bug? You got a story. Did you scout all over the internet and finally figured out how to implement that feature you wanted? You got a story. Did you chain up two seemingly unrelated tools and came up with a solution to your problem? You got a story.

Take the stage and share your stories. The world will thank you.

Thursday, January 19, 2012

Graphic Design for Engineers

I have always wanted to pick up some basic image editing skills to pretty up my apps, but never managed to stare at the Photoshop interface long enough to achieve anything. I talked to a few of my engineer friends, and they have the same problem, so I decided to organize a workshop. After asking around for a while I convinced my friend Tara to teach the workshop, and announced it to the CodeChix community. Terri saw the announcement and volunteered to teach as well. Super!

Last night was the workshop. Color generously provided the space for the event, which was awesome.

Rupa and Crystie did an introduction on CodeChix, and handed it off to Tara and Terri.


Rupa


Crystie

Tara and Terri prepared a cheatsheet for us with a bonanza of information. We first went over the basic controls, which was very helpful. For instance, I could not find the fill bucket to change the color of my selection. Guess what, it's hiding under the gradient button!


Tara

Terri then taught us something super powerful: Custom Shape Tool. Photoshop has a library of vector graphics, so if you need a cat in your app, head right over to the Animals section and voilĂ , you have a cat. With that, Terri went on to teach us how to make a button:

  1. Select the Rounded Rectangle Tool. Click, hold down the shift button, drag to make a square.
  2. Select the Custom Shape Tool. Choose a shape. Click in the middle of the button, hold down the shift and alt buttons, drag to center the shape in the button.
  3. To change the color, click on the color patch on the layer with the shape. If you want to choose a color from a selection, use Window → Swatches.
  4. To change the size of the shape, press command-T. Holding the shift key, drag one of the corners. The shift key make sure that the shape maintains a fixed ratio. Otherwise you may get a very fat cat.
  5. To make it look like a button, double click on the layer for the button background. Check "Bevel and Emboss" to enable it. Select the item (the background will be highlighted) to change the parameters.

We also went over some other tricks like constraining one shape to be within another, using Kuler to come up with a color scheme etc. Finally, we all used our newly-acquired skills to make a mock up for a mobile app.

Tara and Terri did a really good job in teaching us just the basics so we don't get overwhelmed, but also show us the tricks of the trade so we can put them to use right away. I walk away feeling very empowered. Thank you so much!

Monday, January 16, 2012

Android: Pendulum Animation

I am working on the splash screen for Monkey Write, and I would like the monkey to be swinging on a vine. In Android you can specify all kinds of animations with xml, so it took me a little bit of time to figure out all the perimeters. Here is my final swinging.xml:

<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
  android:fromDegrees="15"
  android:toDegrees="-15"
  android:pivotX="50%"
  android:pivotY="0%"
  android:duration="2000"
  android:repeatMode="reverse"
  android:repeatCount="-1"
/>

I am using a pivoted rotation to implement the swinging effect. The animation goes from 15 degrees to -15 degrees, but instead of pivoting at the center, I want the pivot point to be at the top-middle. This is achieved by pivotX="50%" and pivotY="0%". For non-stop animation, I use repeatCount="-1".

It was fairly straightforward figure out all those parameters. But the monkey swings from the left to right, then jumps back to the left before swinging again. To make him swing back and forth, I need to set the repeatMode to reverse. Now I have a properly swinging monkey!

I have uploaded my code here: http://github.com/chiuki/android-pendulum-animation. Instead of a monkey, I use xml to specify a pendulum, which seems appropriate for the animation.

Thursday, January 12, 2012

Featured on Engadget!

In mid-December AT&T developer relations reach out to me and ask me if I have a landing page for Monkey Write that can be used in their CES promo on Engadget. I did not have a landing page at the point, but said yes anyway, and quickly whipped up a email sign up form for them to link to.

Today, I woke up to a nice surprise: not only that my name is on http://www.engadget.com, it's on the front page, above the fold! So very very exciting!

Monday, January 9, 2012

Android: Square View

In Monkey Write, the character sits in a square. Initially I just hard-coded the width to be equal to the height, but I wanted them to scale with the device dimensions. Today I found an elegant way to do it, with 3 lines of code in my custom View:

public void onMeasure(int widthSpec, int heightSpec) {
  super.onMeasure(widthSpec, heightSpec);
  int size = Math.min(getMeasuredWidth(), getMeasuredHeight());
  setMeasuredDimension(size, size);
}

Since my class extends View, I can reuse all the measurement logic by calling super. After that, I take the measured width and height, find the smaller one, and use it to set the width to be the same as the height.

I made a sample project to test the SquareView. It is set to take one third of the screen width, and the easiest way to try it with different dimensions is to rotate the screen.

Source code: http://github.com/chiuki/android-square-view.

Sunday, January 1, 2012

New Year Resolution: Be a public speaker

When we think of presentations, we often think of slides after slides of bullet points. A few years ago I attended a talk by Prof Lawrence Lessig, which was more like a performance than a presentation. Each slide only has one word or image on it, perfectly timed to emphasize a point.

After the eye-opening talk, I was inspired to do more public speaking myself, to practice the art of speaking. But like most good intentions, I didn't really do anything about it. And here comes the new year, when people dig out the goals of yesteryear and vow to make it happen. So I decided to try the age-old tradition of New Year Resolution. Here is my goal for 2012:

Give 5 lightning talks and 3 full-length lectures.

I am keeping a close eye on public speaking opportunities, but as a newcomer I could really use your help. Shoot me a note when you hear about an upcoming meetup or conference who is looking for speakers. What kind of topics? Glad that you asked. Here is a laundry list:

Android

I started working on Android when I was at Google, on the Google Maps for Mobile team. I can speak on a wide range of topics, from beginner tutorials to advanced tips and tricks. Here are some examples:

  • Layout by xml and code
  • Notification mechanisms: Toast, Dialog, status bar notification and more
  • Persisting data: bundles, sqlite database, sdcard etc
  • Geolocation: getting and using the device location
  • Custom components: measuring, drawing, updating
  • App to app communications: intents, content providers, broadcast receivers etc
  • In-depth adb: testing intents, listing packages, querying system state etc
  • Instrumentation testing

Career Development

During my tenure at Google I was involved with various mentoring efforts. I can share practical tips on:

  • Gaining visibility while staying authentic
  • Negotiation as a habit
  • Getting the most of out networking

Coding for fun and profit

I code as my profession, but I also like to write small programs to play with different technologies. I can share my experience with what I call "hacking on the side".

  • Hackathons tips and tricks
  • Power your application with Freebase
  • Offline app with HTML5 cache manifest and local storage

The media is abuzz with tips and tricks for keeping new year resolutions. Making it public seems to be the number one factor to make it stick. For my goal, it makes perfect sense. After all, I'm trying to be a public speaker. Plus, I get to enlist all of you to help! Next time you hear about an event, think of me, and let me know if you think I should speak there.