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

Download videos (and popup comments) from bilibili.com

Just found a nice website that analyzes the video path and so we could download the videos that are on bilibili.com! As of today when I post this, the webpage ibilibili.com is still alive.

03/12/2017: Some people are wondering about downloading the popup comments in bilibili. Note that ibilibili.com should give you that as well (so Method 1 should be enough). If something is wrong, you can go on and read Method 2, assuming it's alive.

Continue reading Download videos (and popup comments) from bilibili.com

AT&T's 4G LTE on GoPhone

For the experiments, I went to AT&T and got a GoPhone card that carries the 5GB data plan. For those who didn't want to read the rest of the story, just let you know: you won't get true LTE by doing that.

Ok, here is the thing. I brought the Galaxy S3 and Note that both support LTE to AT&T. I told one guy that I need a card that only has LTE data plan on it for data transmission experiments. There was no need to purchase a plan that had unlimited phone calls and text messages. Therefore, I got that weird mix with GoPhone card and a tablet-like data plan.

Well, the LTE does not work. A little background: 4G and LTE are two different things. LTE is a lot faster than 4G, and if you see "H+" sign or "H," that means it is 4G, but not LTE. "H" stands for "HSPA." I tried to change the APN settings, switching back and forth among ATT Phone, ATT Broadband, ATT LTE, etc. The only one that worked was ATT Broadband, and it had only HSPA+. I also tried to change the "Preferred network type," but it will switch back to "GSM/WCDMA" always. The ATT customer service did few tricks, which I don't really know what they were exactly, but that ain't helpful either.

Awkward. I paid for LTE but I only got HSPA+. Originally I thought it was just bad signals but it turns out HSPA+ is the best the phone can get.

Therefore, for those of you experiencing no LTE connections but failed on many possible ways, and you happened to have a GoPhone sim card with tablet data plan, you are not going to get LTE at all, only 4G. And remember, 4G is not the same as LTE.