September 2009


Hi all.

These days I have been hacking with my Android phone. It is a great device to play with. Yesterday, I got enough time and I couldn’t stop myself in flashing the default OS with a customised android ROM.

Android is an Open Source Operating System. Hence anyone who loves to play with it can modify the OS and release their on firmware builds. Currently two types of HTC G1 are available. They are Google Dev phone1 and retail phones available with T-Mobile in US. Developer phone is a fully free(dom) phone and is for experimental purposes by build. Other ones are meant for users. Hence they vendor locks the Root access and restricts the users freedom to play with its internals.

Luckly no software is bugfree :) Android hackers made use of some bugs to exploit and get the root access on the phones. Several rooting methods can be found at xda-developers forum. The methods varies according to the firmware version.

Android also has got GNU/Linux distros like flavour effect these days. You can hear the names Cyanogen, Huykuro, JacX ROMS in the community. These are popular android hackers who releases their own improved android builds.

I used a simple method to root my phone. It is recovery image flashing method.? I downloaded the Recovery Flasher package and installed it. http://zenthought.org/system/files/asset/2/flashrec-1.1.1-20090908.apk

Ran it. and flashed the the recovery image with new cyanogen’s recovery image.

The phone rebooted and I got a bootloader like menu. (Recalls GRUB ).

So the phone got Rooted. It exploited some bug and could managed to get ROOT access. Now that I can install any custom ROM on it.

I prefered Cyanogen’s ROM. Get it from http://www.cyanogenmod.com/

I connected the USB cable and mounted the sdcard. Copied? the firmware image I downloaded from Cyangen’s site and placed it in root of SD Card and renamed it to update.zip

From the recovery flasher I rebooted to recovery mode. Then I selected apply sdcard:update.zip option. I didnt wipe out the ROM to factory settings. The installation went fine. I did a reboot.

Here comes the panic. The phone became stuck at T-mobile G1 splash screen nothing in progress. I waited for around 15 mins. I got tensed whether my phone will get bricked. If the Flashing of the ROM gets corrupted somehow, the phone will get useless like a ‘Brick’.

I went to IRC channel, #android-root and the folks at community helped me out to recover the stuff. God I am saved :)

The problem was that I didnt wipe out to factory settings. I removed the battery manually. After holding the Home Button, inserted the battery. It straight away went to recovery mode.

Did Alt+w to wipe out. After wiping out, I went for flashing the firmware. It went fine.

It took a couple of minutes to boot for the initial time.

Android has an great SDK with a set of utilities ADB is such a great utility. Download the SDK from here, http://developer.android.com/sdk. I connected the USB datacable and ran the command

slynux@slynux-laptop:~/android-sdk/tools# ./adb logcat | head
* daemon not running. starting it now *
* daemon started successfully *
W/System.err( 1150): ?? ?at com.rechild.advancedtaskkiller.AdvancedTaskKiller.getRunningProcess(AdvancedTaskKiller.java:207)
W/System.err( 1150): ?? ?at com.rechild.advancedtaskkiller.AdvancedTaskKiller$5.run(AdvancedTaskKiller.java:157)
W/System.err( 1150): ?? ?at java.lang.Thread.run(Thread.java:1060)
I/AdMob SDK( 1150): AdMob SDK version is 20090331-ANDROID-cc0d740c1b8c3da5
D/AdMob SDK( 1150): Publisher ID read from AndroidManifest.xml is a14a6ac7fd9f387
I/AdMob SDK( 1150): Publisher ID set to a14a6ac7fd9f387
D/dalvikvm( 1150): GC(2) freed 2368 objects / 164776 bytes in 148ms
I/AdMob SDK( 1150): The user ID is 490BCF661AA5AB2645C71F147068194C

It printed out the background stuffs going on on android. When I did logcat during the first boot after flashing Cyanogen’s ROM I could see some applications installs were going on. That is why it took lots of time for the boot.

We can also get the Root shell on our development machine using,

root@slynux-laptop:~android-sdk/tools# ./adb shell
#
# ls
cache                 init.goldfish.rc      root
data                  init.rc               sbin
default.prop          init.sapphire.rc      sdcard
dev                   init.trout.rc         sqlite_stmt_journals
etc                   lib                   sys
init                  proc                  system
# cat /proc/cpuinfo
Processor	: ARMv6-compatible processor rev 2 (v6l)
BogoMIPS	: 245.36
Features	: swp half thumb fastmult edsp java
CPU implementer	: 0x41
CPU architecture: 6TEJ
CPU variant	: 0x1
CPU part	: 0xb36
CPU revision	: 2

Hardware	: trout
Revision	: 0080
Serial		: 0000000000000000
# cat /proc/meminfo
MemTotal:          97880 kB
MemFree:            2760 kB
Buffers:             416 kB
Cached:            22584 kB
SwapCached:         1292 kB
Active:            36848 kB
Inactive:          38540 kB
Active(anon):      25188 kB
Inactive(anon):    27736 kB
Active(file):      11660 kB
Inactive(file):    10804 kB
Unevictable:         252 kB
Mlocked:               0 kB
SwapTotal:         24464 kB
SwapFree:          13516 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:         52148 kB
Mapped:            15852 kB
Slab:               6044 kB
SReclaimable:        820 kB
SUnreclaim:         5224 kB
PageTables:         4112 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:       73404 kB
Committed_AS:    1125304 kB
VmallocTotal:     811008 kB
VmallocUsed:       57508 kB
VmallocChunk:     676860 kB

Now I have cyanogen’s ROM running on my phone. It is a very nicely customized rom with good performance. The improvements in the ROM includes Multitouch support, better camera options, Faster applications, 5 desktops etc. Anway I am addicted to Android. Trying out more and more hacks these days.

Thinking of trying, HERO ROM for G1 :P

HTC Dream G1

Finally my dream full filled by owning an HTC Dream aka HTC G1 powered by Android Open Source operating system. I have been playing around it for the last two days and I have become absolutely an addict.

I got an unlocked T-mobile G1 which was linked to someone’s Google Account. I did a master reset. After that it required to connect to the internet for linking the phone with a google account.? It requires a GPRS/EDGE connection. It cannot be configured with Wifi during this stage. Afterwards I could use the phone with all features. The biggest advantage of Android is that it has Google account integration. We can sync our phone contacts to the Gmail contacts. Also we have access to all gmail contacts. Also Google Calender is very helpful in synchronising events and tasks. G1 has got excellent sound quality as I felt. Youtube player is another interesting application, which is very optimised for the G1 screen so that videos look awesome.

Android market has got plenty of free applications. I spent most of the time surfing the android market. Found lots of nice applications. The GPS device which comes with the G1 can identify the location where we are standing and it will show the position on map. It can also post entry to the google maps. G1 has a poor battery backup. That is the negative point I have noticed.

g1
Innovative keypad unlocking using patterns

It suits me well for to be connected with Gmail, Twitter, Orkut, gtalk, IRC and lot more.
I will update with more Android hacks and experiments..

I am getting more busy these days with lots of work which ranges from coding to college and hostel life and as a result I am getting more and more lazier to blog :P

I have successfully completed my Google Summer of Code 2009? programs with Pardus project. The Pardusman is now ready to build custom pardus distros through web. Some of the work remaining is to? setup the server configuration files at pardus server. I will be looking forward to setup it in a couple of weeks. Once it is setup, it would be able to build distros through the web interface at http://pardusman.pardus.org.tr. Waiting for the official Summer of Code T-Shirt to be shipped. :P

The ExcelX, the 10th edition of our college techfest is coming soon during Oct 9-11th of 2009. I am one of the co-ordinators and I have been working on it. Had a good time coding in Google Appengine. It is cool web framework to work with. Hats off to Google. I would come up with a Online Shell Scripting contest web application within 5 days of coding. Feels awesome.

appengineGoogle appengine is a mix of several web frameworks bitten by python. it derives most of the things from Django 0.96. Django 1.0 is the latest release and I have been working on it. Hence backward compatibility was an issue while coding. Some features are missing. It eated up some of my time finding out what the issue is.

Suppose you are guy who is familiar with Django 1.0 and never used 0.96, I might be trapped tracing the issue while coding. So I suggest you to verify whether that feature is available in Django 0.96 while coding with Google Appengine.

An example,

In template system, we cant use dictionary traversal in the following manner

{% for key,val in dictionary.items %}

<!-- some html tags -->

{{ key }} : {{ val }}

{% endfor %}

instead you have to use 0.96 style,

{% for item in dictionary %}

{{ item.0 }} : {{ item.1 }}

{% endfor %}

Try out. Have a good time with GAE :)