2014年8月7日 星期四

htop on Android


  1. Need root
  2. Check $TERM is vt100 or not
    1. adb shell 
    2. echo $TERM
    3. Yes then go on, or download other terminal info from http://z4ziggy.wordpress.com/2010/09/17/a-short-guide-to-install-midnight-commander-on-android/
  3. Download htop and libncurses.so for arm, find on web
  4. Run script
# /bin/bash
adb remount
adb push htop /system/bin/
adb shell chmod 755 /system/bin/htop
adb push libncurses.so /system/lib
adb shell mkdir /system/usr/share/terminfo
adb shell mkdir /system/usr/share/terminfo/v
adb push vt100 /system/usr/share/terminfo/v/
adb shell 'echo export TERMINFO="/system/usr/share/terminfo/" >> /system/etc/mkshrc'
adb shell 'echo busybox resize >> /system/etc/mkshrc'
adb remount




2014年6月18日 星期三

"undefined reference to `typeinfo"

I use stl library in my Android project, so I add "stlport_static" in Application.mk.

However, this would cause the link error: "undefined reference to `typeinfo XXXXXX"

So, replace "stlport_static" with 

APP_STL := gnustl_static

Don't know reason, but works.

2014年4月22日 星期二

Handler, AsyncTask and Thread

Sometime confused about the differences between Handlers, AsyncTasks and Threads in Android.
If I have a time time consuming job that without relating with UI thread, should I use which one?

A stackoverflow thread show good answer:
http://stackoverflow.com/questions/6964011/handler-vs-asynctask-vs-thread

I know that:
1. All the things Handler and  AsyncTask can do, it can do with Thread.
2. Use AsyncTask when you are in UI thread.
3. Handler allows you to send and process Message and Runnable objects associated with a thread's MessageQueue <- and="" callback.="" form="" hide="" i="" it="" native="" preview="" show="" span="" surface="" to="" use="">

2013年12月3日 星期二

Wireshark 1.6.7-1 no response bug on Ubuntu 12.04(precise)

Every time I used wireshark on Ubuntu 12.04, its no response kills me.
Finally, find a way to update to 1.10.2

http://ubuntuhandbook.org/index.php/2013/09/wireshark-1-10-2-released-install-in-ubuntu/

1. Uninstall wireshark 1.6.7-1
sudo apt-get remove wireshark
2. Add PPA
sudo add-apt-repository ppa:whoopie79/ppa
3. Install
sudo apt-get update; sudo apt-get install wireshark
4. Remove PPA(maybe no need)
sudo rm /etc/apt/sources.list.d/whoopie79-ppa*.list; sudo apt-get update