Fork me on GitHub


[Android] Pack 3rd-party shared library .jar/.so into apk by

When building android application package by Eclipse, the shared library placed in libs/armeabi* will be packed into apk automatically.
If the building process is from android source tree, the needs to be written. So, how to pack 3rd-party shared library .jar/.so into apk by
For .jar
# the name is just a name, it will map to real .jar later

# here maps to actual .jar location
                                        refJar2 :libs/xxxx.jar
For .so
# Put .so to out/target/product/***/obj/lib
$(shell cp $(wildcard $(LOCAL_PATH)/libs/armeabi/*.so) $(TARGET_OUT_INTERMEDIATE_LIBRARIES)) 



  1. 在apk裡打包進.so文件的方法:
  2. Android build system分析:
  3. android 內置app編譯方法及Android.mk中的系統變量說明:
  4. Android NDK開發指南---Android.mk文件:
  5. Android Application, Android Libraries and Jar Libraries:


[OpenGL] RedBook example environment setup on Mac

This post records how to setup the OpenGL programming guide source example environment on Mac.

  • Install XCode OpenGL and GLUT come with the OS and Xcode installations. To verify, check for
  • In your OpenGL source files, include the following line

      #include <OpenGL/gl.h>
      #include <OpenGL/glu.h>
      #include <GLUT/glut.h>
  • To make a GLUT application on the command line, use the following linker options:

     -framework OpenGL -framework GLUT

For Ubuntu, you can refer this: Setting up an OpenGL development environment in Ubuntu Linux


[SimpleCV] SimpleCV environment setup on Mac

This post records the process to setup the SimepleCV environment on MacOSX 10.8.2. The source code of SimpleCV is hosted on the Github. Below steps mostly refers to this project.
  • Install Xcode (remember to install Command-Line Tools)
  • Install Homebrew
    $ ruby -e "$(curl -fsSkL"  
    // Add the Homebrew directory to your system path  
    _export PATH=/usr/local/bin:$PATH_ to .bash_profile
  • Install Python
    $ brew install python --framework --universal 
    // Add /usr/local/share/python to your system path   
    export PATH=/usr/local/share/python:$PATH  
    // change Lion's symlink to point at your new Python install  
    $ cd /System/Library/Frameworks/Python.framework/Versions  
    $ sudo rm Current  
    $ ln -s /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/Current  
    // To verify that your installation went as planned, type which python at the command line. You should see /usr/local/bin/python in response
  • Use Homebrew to install git, opencv
    $ brew install git  
    $ brew install opencv
  • Install the dependent libraries
    $ brew install sdl sdl_image sdl_mixer sdl_ttf smpeg portmidi  
    $ ARCHFLAGS="-arch i386 -arch x86_64" brew install PIL
  • Make symbolic links
    $ sudo ln -s /usr/local/lib/python2.7/site-packages/ /Library/Python/2.7/site-packages/
    $ sudo ln -s /usr/local/lib/python2.7/site-packages/PIL /Library/Python/2.7/site-packages/PIL
    $ sudo ln -s /usr/local/lib/python2.7/site-packages/ /Library/Python/2.7/site-packages/
    $ sudo ln -s /usr/local/lib/python2.7/site-packages/ /Library/Python/2.7/site-packages/
  • Install pip (pip installs packages)
    $ sudo easy_install pip
  • Install NumPy, SciPy, IPython
    $ pip install numpy
    $ brew install gfortran
    $ pip install -e git+  
    $ pip install ipython
  • Intall Mercurial
    $ brew install mercurial
  • Install PyGame
    $ sudo pip install hg+
  • Install SimpleCV
    $ pip install 
  • Install readline
    $ sudo easy_install readline
  • Start the SimpleCV shell
    $ simplecv