Android app Draw Shapes

My first Android App Draw Shapes, which is actually my first assignment of android programming class, is now on Google Play. The code is shared at GitHub.


I want to show the user what they are drawing on the action bar. So I put a DrawingShapeView in action_bar layout, and set it up in my MainActivity class.

View actionBarView = LayoutInflater.from(this).inflate(R.layout.action_bar, null);
((DrawingShapeView) actionBarView.findViewById(, painter);
ActionBar actionBar = getActionBar();

Read More

TDD Demo GameOfLife with Android Studio

On my Java class the teacher used Conway’s Game of Life as an example for TDD and I found it a really good example. So I made some videos to demonstrate how I tried TDD on it. In the videos when I say “grid” or “gred” it should actually be “cell” (And I pronounced “live” wrongly). Sorry for my poor English. If the videos are not clear please try to change quality to HD by the settings button.

For each step I also posted new or changed code below, and links of full code after each step on GitHub. I posted some keyboard shortcuts as well. I don’t know what they are on windows but you can find them (and change them if you would like) in “Keymap” section of Android Studio’s preference (or settings) panel.

1. Create GameOfLife Project

The first step simply create a new project on Android Studio. Android Studio is still in beta (I’m using 0.8.6) but I am very happy with it so far. On the GDG Auckland September Meetup, Julius Spencer said his team (JSA) has already been using Android Studio on production for one year now. So give it a try if you haven’t yet. It’s so much better than eclipse!

Read More