The Opus codec provides superior audio quality over codecs such as AAC, MP3, and Vorbis. Android has supported Opus since Android 5.0 (Lollipop). However, when I tried playing Opus files on my LG G4, it wouldn’t recognize the file as a media file at all. It turns out that the default .opus extension is not recognized by Android. The workaround is to change the extension to .ogg. Generally speaking, this is technically correct, as most Opus streams are encapsulated in an Ogg container; however, .opus is the recommended extension (but apparently not for Android).
Tag: Android
Galaxy S2 – Clearing Logs on an Unrooted Phone
I have a Samsung Galaxy S2 using an unrooted stock ROM. Lately, I couldn’t update any of my apps or install new ones, as every time I tried, it would complain about Insufficient storage available. This was weird, as according to my phone, the apps took less than 600 MB, and yet I had barely 200 MB of free space in my device memory.

Using CyanogenMod’s Apps on Official ROM
Ever since I switched back from using CyanogenMod ROM to the official ROM (due to modem problems), I missed some of the custom apps. It turns out to be really easy to install those apps. You just need to download CyanogenMod and extract the relevant APKs from system/app/ and copy them over to the phone. To install them, you’ll need to enable installation of apps from unknown sources in Settings->Security. It’s best to get a CyanogenMod version that corresponds to your ROM’s version, but I successfully installed apps from newer CyanogenMod releases as well.
Manually Install SSL Certificate in Android Jelly Bean
Apparently it’s pretty easy, but there are some pitfalls. The first step is to export the certificate as a DER-encoded X.509 certificate. This can be done using Firefox (on a PC) by clicking the SSL lock icon in the address bar, then More Information -> View Certificate -> Details -> Export. The exported certificate needs to be saved in the root directory of the phone’s internal storage, with a *.cer extension (or *.crt). Other extensions will not work.
Afterward, on the phone, click on “Install from device storage” under Settings -> Security -> Credential Storage. If you did everything correctly in the previous step, it will display the certificate name and ask you to confirm its installation. If you’ve exported the certificate in the wrong format, given it the wrong extension, or placed it somewhere other than the root of the internal storage, it will display the following error:
No certificate file found in USB storage
If you see it, just make sure you are exporting the certificate correctly and saving it in the right place.
More details: Work with certificates (geared toward the Galaxy Nexus, but should apply to any Android 4.0 and above).
Updated Aug 2015: Fixed a broken link.
WiFi won’t connect on Samsung Galaxy S2 with CyanogenMod 9 (ICS 4.0.4)
After upgrading to CyanogenMod 9 (ICS 4.0.4), I’ve experienced problems connecting to WiFi networks. Most of the time I’ve tried to connect to a WiFi network, it would try to connect and then fail. Often it would also show the network I’ve just tried to connect to as “Not in range.” This was extremely irritating, as I could stand by my router and have the phone report that there was no signal, while another Galaxy S2 phone would connect immediately; the only difference was that the other phone was running Android 2.3.7. Needless to say, I hadn’t made any major (or minor) changes to my WiFi equipment, and the problem wasn’t confined just to my home. Sometimes, it would connect after being idle for a day or so.
Back when I was using CyanogenMod 7, I had no problems with the WiFi on my phone, and I could also replicate this behavior on another Galaxy S2 I’d upgraded to CyanogenMod 9. Initially I thought it was some bug in CyanogenMod, but I came up with nothing. Over the weekend, I figured maybe the bug wasn’t specific to CyanogenMod, and I found this bug report WiFi freeze on Samsung Galaxy S2 with ICS 4.0.3. For some reason, many people have problems with WiFi on the Galaxy S2 with ICS. While the report relates to the WiFi freezing, which I didn’t experience, I decided to sift through the comments. Some people mentioned the “Wi-Fi frequency band” feature available in Wi-Fi settings -> Advanced (available by pressing the menu button), so I decided to try playing with the different settings there.
This setting allows you to choose the WiFi operating frequency between three options: 5GHz, 2.4GHz, and “Auto,” which, as you can guess, automatically figures out the right frequency: 5GHz (802.11a and 802.11n) or 2.4GHz (802.11b/g/n). However, it seems the phone (probably due to a problem in the driver) fails at the “Auto” thing. Instead of guessing the right frequency, it fails to connect. So I changed it to 2.4GHz, which is still a more popular choice in routers than 5GHz, and instantly my phone connected to my router.
For conclusion: If you have trouble connecting to WiFi on Samsung Galaxy S2 with ICS, you should probably set the phone to use 2.4GHz only (or 5GHz only) instead of the default “Auto” mode.
Some Thoughts About Android’s Full-Disk Encryption
One of the new features touted by ICS is full-disk encryption (actually, it was first available in Android 3). At first look, it is promising. The Android developers went with dm-crypt as the underlying transparent disk encryption subsystem, which is the de facto way to perform full-disk encryption in Linux nowadays. This ensures both portability of the encrypted file systems and a tried-and-tested implementation. The cipher itself is 128-bit AES in an ESSIV mode, and the encryption key is derived from the password using PBKDF2 (actually, it’s the key that encrypts the actual encryption key, allowing fast password changes). So where do I think it went wrong?

Continue reading Some Thoughts About Android’s Full-Disk Encryption

