Posts

Showing posts from January, 2012

Sun JDK on Ubuntu

Thought it would be simple, but apparently not. These are the instructions I followed first and the installer seemed to get stuck at 99% for some reason: sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" sudo apt-get update sudo apt-get install sun-java6-jdk To get it to work, replaced the last 2 lines by: sudo apt-get install sun-java6-jre sun-java6-plugin sudo update-alternatives --config java

Comparing directrories using diff

diff -qr --exclude=".svn" --exclude=".git" --exclude="STATIC_LIBRARIES" dir1 dir2 q is for brief, which means output only if the files differ r is for recursive since we are comparing directories. we exclude certain directories using the exclude option

Dynamically allocating 2d arrays in C++

http://www.codeproject.com/KB/cpp/arrayDinamic.aspx

Debugging an android crash

Image
So lets say one of your android app crashes and you get something like this in your logcat: Here #00 tells us the address in the program counter. But this information is pretty useless. To translate into actual file and line numbers we can use a tool called addr2line. For NDK4 it is located at android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin. For NDK5 it is at a different location. So we go to this location and run the tool: addr2line -f -e mydroid/gingerbread_2.3.3_GINGERBREAD/modified/out/target/product/crespo/symbols/system/lib/libmedia.so 0004853a This gives us the file and line numbers we are looking for. We use the code in the symbols directory because that has the unstripped version of the libraries.