C++ unit testing with AppCode and GoogleTest

AppCode started to support Google Test since 2.5 EAP. Steps to get it work:

  1. Get Google Test
  2. Open {gtest_path}/xcode/gtest.xcodeproj and build gtest.framework
  3. Create a “Command Line Tool” project or target
  4. Add gtest.framework to project and the new target
  5. Set Up the Executable Run Environment. 3 options:
  6. Make sure your project and google test use the same C++ standard library

    Read More

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.

ActionBar

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.

MainActivity.setupActionBar()link
1
2
3
4
5
6
7
8
View actionBarView = LayoutInflater.from(this).inflate(R.layout.action_bar, null);
((DrawingShapeView) actionBarView.findViewById(R.id.drawingShape)).setup(model, painter);
//...
ActionBar actionBar = getActionBar();
actionBar.setCustomView(actionBarView);
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayShowCustomEnabled(true);

Read More