Compile tshark/wireshark for Android



  • libpcap
  • glib
  • libiconv
  • libffi
  • gettext


Samsung Galaxy S8 Update Issue with Project Fi




Settings > Connections > Mobile Networks > Access Point Names


Everything now gets back to normal. 😀

Google Updates When They Stop Supporting Pixel and Nexus Phones





Turn on/off Theater Mode on Android Wear Programatically

The simplest way is to leverage the adb shell to run settings put global theater_mode_on.

  • settings put global theater_mode_on 1 will turn on theater mode
  • settings put global theater_mode_on 0 will turn off theater mode

And the following is the java code to turn on theater mode.

Process su = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(su.getOutputStream());
os.writeBytes("settings put global theater_mode_on 1\n");

So we can automated the theater mode through scripts.

Notice that the total time to get it effective is about 2 seconds, and it will pop up a long toast, followed by the dark screen. The whole takes around 10 seconds. Afterwards, if ambient mode is on, the device will get into ambient mode.

Know the underlying architecture of Android device

It can be done by either simply look at the "About" in Android Settings, or by the following command using adb:

cat /system/build.prop /default.prop | grep -m 1 "ro.product.cpu.abi="

Using Valgrind and Callgrind on Android

Lately we want to understand the cpu utilization of an Android app we wrote. We tried a few things like android-ndk-profiler and easy-performance-analyzer but they did not provide a very detailed results in terms of system calls. They are easy to use but don't tell the details we want to see. Valgrind is a very powerful profiling tool in Linux and we wondered to use that in Android. There are few topics in compiling that using Android NDK (mostly here). The answer contains detailed scripts, which is great, but there are certain confusions during the compilation. In short:

  1. There are a few bugs in the script
  2. Android-21 has a bug (issue of redefinition), but android-19 certainly works
  3. In our case, we need to analyze standalone Android binary executions

Therefore, here is my entry.

Continue reading Using Valgrind and Callgrind on Android