Blog | Tech Blog | Secure Coding | Twitter | RSS Feed | Get Email Updates

We all know that Android does not allow the camera LED to be controlled directly from apps and hence, you cannot use the camera LED as a Torch or Flashlight unless you are rooted. There are many flashlight apps on the Android Market Place but none of them will work for you if you don’t have a rooted phone. BUT this changed recently. I use a brilliant app called “quick settings” which keeps an icon in the notification bar and I can pull it down and change any settings without leaving other apps. It has a flashlight function but so far it used to work by turning on the screen with a white screen, which was a less than ideal solution. I upgraded to the latest version a few days ago (1.9.4 p1). While messing around with the settings, I wandered across the flashlight settings which allows you to choose what kind of flashlight you want. Now, I’m not sure whether this setting was present earlier or not but I decided to give it a try and chose LED instead of screen (Screenshot below):
Android Quick Settings Flashlight LED Settings

Once done, I went back to the main screen and pressed the flashlight icon in the top right (Screen shot below) and voila! my camera LED switched on. I’m a happy camper now as this is a life saver many times. Try this out for yourself by searching for “Quick Settings” in the market and let me know if it works on your phone too (mine is a nexus one).

Android Quick Settings

Blog | Tech Blog | Secure Coding | Twitter | RSS Feed | Get Email Updates

Recently I came across a weird error while trying to run firefly itunes server (mt-daapd) on my router (Asus wl-500w). It had something to do with sqlite and gave a vague message “Unable to open database file”. After going bonkers for a short time, I solved it and this is how.

One of my hard disks crashed recently and unfortunately it was the one I had connected to my router to serve media to me all over the house (through PS3/laptop) or when I travel (through laptop/phone). I had all the data backed up but somehow didn’t preserve the firefly server. I rebuilt the server from source using my own guide (Thank God I did it. I wouldn’t have been able to preserve my sanity finding all that out the hard way again.). But after doing all the installation and reconfiguration, it gave me a weird error “unable to open database file” every time and exited. I checked the permissions on the songs3.db file (in /opt/var/cache/mt-daapd for me) and made it writable by all but the issue persisted. I changed its ownership to the user under which firefly was running but the issue was still there. Finally I found that the server (or maybe its an sqlite thing) was trying to create a temp file in the cache directory for the transactions and since the user with which it was started, didn’t own the directory it wasn’t able to create the file in it.

So, the fix: I did a “chown <username> /opt/var/cache/mt-daapd” on it and voila! the problem was fixed. I am a happy man now since I own a new android phone since last time and now able to stream all my music to my phone through itunes (daap protocol) server over an ssh tunnel :)

Blog | Tech Blog | Secure Coding | Twitter | RSS Feed | Get Email Updates

Update: Made a minor update for a small bug that can make wi-fi keep reconnecting in quick succession.

Pushed out a new update to my Android App Wi-Fi Keep Alive today. This update brings in another work around for the issue where the wi-fi is alive on the phone and it is also connected to the network but is somehow unable to send/receive any packets to the network. The new work around will automatically re-associate your phone with the wi-fi router if it detects such a situation. This seems to make it work properly again for sometime. When it fails again, the workaround kicks in automatically again. This is not an ideal “fix” as such because streaming apps like Pandora radio etc might have a hiccup because of this but it is unavoidable as of now and atleast the notifications for mails and other things etc will work fine because this state stops even the mobile data network from taking over since the phone perceives that wi-fi is connected but is not working actually.

The other things include support for small screen devices like Xperia X10 mini, some optimizations for size and speed, some icon sizes and UI tweaks for compatibility with different screen sizes and android versions. Please try it out from the market as usual and let me know how it goes. You can find the details and QR code for downloading etc here: Wi-Fi Keep Alive

Blog | Tech Blog | Secure Coding | Twitter | RSS Feed | Get Email Updates

Recently I found an issue with my asus wl-500w wi-fi router that I wasn’t able to change the channel on which it was transmitting. I moved to a new location which was totally jam-packed with other wi-fi networks using same channel as mine which was hampeing my connection. I tried for umpteen number of times. Changing the channel through the web configuration did not give any error but I found that it was still transmitting at channel 1. I confirmed by checking on the “Status & Log” page, checking the logs, and running “wl status” command through ssh and they all confirmed that it was transmitting at channel 1 only, no matter what I set it to in the configuration. I even opened an issue in the firmware project for the custom firmware (by oleg and lly) that I am using but they weren’t able to help me as the wi-fi drivers are binary only.

But by sheer chance, I stumbled upon the solution finally by trial and error. The solution is that you should set the “Bandwidth” to 20 MHz in wi-fi configuration if you are using 802.11 G. If you set it to 40 MHz then it gets stuck somehow but as soon as I changed it to 20 MHz, I was able to see the channel change immediately after reboot. Here is the screenshot of the page where you can find this setting.

Skype on linux works great but the problem that I faced was that it does not handle the buttons on the bluetooth headsets. My wife uses skype to call into her work related conference calls and was pretty frustrated that she had to keep sitting in front of my laptop (her laptop didn’t allow to [...]

If you are creating a custom Dialog for Android, and following the Android Developers’ Creating Dialogs tutorial, then most likely you would have faced a Force Close with this exception showing up in logcat. I did too. Although I figured it out quickly, it might not be easy to find out for many, so posting [...]

Just finished uploading the new version 1.2.0 of my android app Wi-Fi Keep Alive to the Android market. This version has a lot of optimizations and also a few workarounds to overcome the issues few guys were facing with Android’s in-built handling of wi-fi sleep policies. Please check out the Wi-Fi Keep Alive Home Page [...]

I just wrote my second Android App. This again was to scratch an itch of mine but it seems to have become a bit popular already (My first app “Quick Sync Settings” did around 400 downloads in 20 days but this one has already surpassed that in less than one day). This app basically allows [...]