Tuesday 29 November 2011

Upgrading Android ROM


The process of upgrading android ROM consists of over all 4 basic steps.
  • Root your Android device, i.e. get root permissions for your android device.
  • Flash Andriod recovery image on the ROM.
  • Getting Right Android ROM for your device.
  • Flash Android ROM on the device using the recovery tool at the startup.



  1. Rooting Android Device

Android is Linux based and hence has root account which is set as a super user. Rooting is a mechanism to get root access on your android device. There are 2 mechanisms of rooting an android device.

Easy Mechanism :
  • Download android application for rooting the device from AndRoot link or Alternate AndRoot link. (The downloaded file should have ‘.apk’ extension)
  • Plug in your android device with the computer and transfer this file to the sdcard of your phone.
  • In your phone go to Android Market and install AndExplorer (or any good File Explorer).
  • Open AndExplorer after installation and go to sdcard, click on the AndRoot application file that you transferred earlier. You will see a prompt to install the application AndRoot. Go through the steps and install AndRoot.
  • Once installed open AndRoot application, Select the android version of your device and select the button that says anything about rooting the device.
  • It will take some time and viola you are done with rooting your device.


Advance User Mechanism:


  1. Flashing Android Recovery Image

Recovery Image is a 3rd party recovery tool that lets you load up a utility at the device startup i.e. before android loads. By using this tool you can create and restore the backups of your android device, Wipe out data of your device and most importantly Flash an Android ROM on the device (i.e. Upgrade Android OS). You can flash the recovery image by following these steps:
  • Go to android market from your phone and install “ROM Manager” by CLOCKWORKMOD.
  • Open the application and select the first option of “Flash ClockworkMod Recovery”.
  • It will try to detect ur phone set and asks to confirm your phone model. confirm your phone model. It will then flash the Recovery Image on your device in around 10 - 15 secs.
  • Now you are ready to boot your device in the Recovery Tool by starting your device by holding “power” & “Home” keys. But you obviously need to get the Android ROM image before booting into this revover tool. Other wise its point less in roaming around the recovery tool when you don’t have any Anroid ROM to flash.



  1. Getting Right Android ROM For Your Device

Probably one of the most important part of this whole process is to have an authentic/popular Android ROM for your device. For this purpose you are totally dependant on Internet Community. XDA Developers is a great place to search for the Android ROMs for your device. In my case, I needed Android’s Froyo (i.e. Android 2.2) ROM image for HTC hero. After searching Over the web  this great link for HTC hero ROMS was found, out of which this (from ‘Froyo ROM’ option) one ROM with the highest ranking was picked.
Make sure you download the ‘.zip’ ROMs mentioned in the links in this post via a relaible download manager. Downloading the ‘.zip’ ROM via a browser could be risky because the download can be interrupted and you will be left with the broken ROM.

NOTE: If the link from where you downloaded the ROM also gives you the info of the MD5 hash of the ROM then to make sure that the downloaded ROM isn’t corrupted, Take MD5 hash of the ‘.zip’ ROM file that you downloaded and compare it with the MD5 hash value given on the download page. If it matches then you are good to go to the step 4 other wise try re-downloading  the ROM with a reliable download manager.


  1. Flashing Android ROM / Upgrade Android OS

The Last and most important step is to Flash the Android ROM (downloaded in step 3) on your device. Follow these steps to Flash the new Android ROM on your device:
  • Plug in ur android device with your computer and transfer the downloaded Android ROM on ur SD Card’s root i.e. right on the sdcard and NOT in any folder inside the sdcard.
  • Rename the ROM file to update.zip
  • Power off your device. Power it back On while holding both “power” & “home” keys.
  • The device will now boot in the recovery tool. Once in the recovery tool first of all take the backup of the device by going into “backup and restore” -> “Backup”. This backup could be used to restore your device (via “backup and restore”->”Restore” option) if anything goes wrong in the process of upgrading the ROM.
  • Now select “wipe data/factory reset”.
  • Select “wipe cache partition”.
  • Go to “advanced” and select “Wipe Dalvik Cache”.
  • Now go back to the main recovery tool menu by pressing back button.
  • Select “install zip from sdcard” , Now select “choose zip from sdcard”. You will now see a list of files on the sdcard, Select the “update.zip” on the sdcard that we transferred earlier.
  • recovery tool might ask for u to confirm the action and then will flash the new ROM on your device. Once done select the “reboot system” from the main menu of the recovery tool.
  • Hurrraaaaaaayyyyyyyyy !!!!!!  your device will now boot in the new Android ROM.


Great References:

http://theunlockr.com/2010/09/27/how-to-load-a-custom-rom-on-the-htc-hero-2/
http://theunlockr.com/2010/09/27/how-to-root-the-htc-hero-androot-method/
http://theunlockr.com/category/roms-2/android-roms-2/htc-hero-roms/
http://theunlockr.com/2011/04/22/froyo-rom-3/
http://forum.xda-developers.com/showthread.php?t=767886


http://forum.xda-developers.com/wiki/HTC_Hero
http://www.pocketables.net/2011/06/how-to-manually-root-almost-any-android-device.html
http://www.pocketables.net/2011/06/what-is-root-and-why-do-i-want-it.html

Handling Driver Malfunction in Ubuntu - Fixing broadcom driver malfunction in ubuntu.

In Ubuntu 11.04 many drivers come in already installed with the OS. Sometimes they can malfunction causing your kernel headers to get corrupted and as a result you will neither be able to boot into normal / recovery mode nor will you be able to do any fresh installation using ubuntu live. Now this is quite frustrating situation, however one can get rid of it by following these steps:
  1. Locating the exact driver that could have malfunctioned. Now this is the first and most important step that needs to be done. You can either go through the system log dump or you can try to recall your last actions after which your ubuntu fell into the limbo. In my case it was disabling my wireless adapter, hence i simply searched over the net for the name of drivers that could have been used on ubuntu for broadcom wireless adapter. 
  2. Black list the driver. This can be done by appending “blacklist driver_name” in the “/etc/modprobe.d/blacklist.conf”. 
  3. Restart the system and in grub menu select recovery mode. Once in the recovery mode select “dpkg” option i.e. recover broken packages. This will list kernel headers as a broken package along with other broken packages. Download and re-install these packages. 
  4. Restart the system and boot in to normal Ubuntu 11.04 environment.

Puzzled han ??? thinking Easier said then done. well perhaps a personal example of mine can help you map my issue on yours. As i mentioned earlier, In my case disabling wireless adapter (from the dedicated key) simply froze my OS. So it was quite probable that the driver of my wireless adapter was responsible for all of this. So i searched over the internet to find this very useful link, which helped me decide the driver name of broadcom wireless adapter. 
Following is the step by step recovery when broadcom wireless adapter malfunctioned on my system:
  • The broadcom driver was identified as  brcm80211.
  • Edit the black list: At system startup and at the grub menu select the “previous version” and select the recovery mode. In the recovery mode select the root shell. Once in the root shell edit the black list by using following command “nano /etc/modprobe.d/blacklist.conf” and append blacklist brcm80211 at the end of the file.
  • Restart the system, go in the recovery mode and select the package repair option. restart the system again and this time boot normally.
  • Once you have logged in you will see that enabling or disabling the wireless adapter won't freeze the OS any more as its driver has been black listed.
  • But you are not done now, as you have not only put the malfunctioning driver in the blacklist but also made your system handycap of using any driver for the wireless adapter. Hence Now in order to use the wifi adapter you will have to install proprietary driver for the wifi card. To do this first type the command "sudo apt-get install broadcom-sta-common"
  • Remove "blacklist brcm80211" from the end of "/etc/modprobe.d/blacklist.conf" and append it at the end of "/etc/modprobe.d/broadcom-sta-common.conf"
  • Append "lw" at the end of "/etc/modules". Restart the system.
  • Once the boot is completed, open "additional driver tool" and it will show you that your system can use proprietry drivers for broadcom wifi adapter. Install the drivers and reboot the system. 
  • Now you will be able to use the wifi adapter via proprietary drivers to connect to the available wifi access points :)

Prologue

Hi everybody, Finally i have gathered the courage and time to create a blog of mine where i can share my knowledge with the Internet community. My motivation for creating a blog to share my knowledge with others, comes mainly from my experience of last 2 years in software development. Over this time i have had strong feeling of responsibility towards me to pay back the Internet community for all the help they have provided me in getting the knowledge in various fields.
It has occurred to me so many times that i wanted to share something on the Internet but the thought of taking time to create and manage the blog always held me back BUT not anymore :)
As the name of my blog clearly shows, i am planning to keep this blog as my knowledge dump i.e. I want to share stuff related to any field either its development in linux, android, symbian, engineering or even hacking. So lets see what i can come up to share with you guys :)