I'm Casting Magic Missle!

Google Android Hacking Common Practices for Newbs

MOUNTAIN VIEW, CA - FEBRUARY 02:  Photos of Go...Image by Getty Images via @daylife

First things first you need to know where to go to find help for your self. Usually these sources also act as the place to go for help when you don’t feel you can help your self any longer. These locations are filled with experts who donate their time to give you something for free, because they can and because they care. Don’t take this for granted when you communicate with them. That being said here are those places.

Biggest and best is probably XDA.
http://forum.xda-developers.com
You can find a giant list of devices each with it’s own active sub community. Roms and software are usually found in the “development” sub forums. Be sure you use the search tool because some times solutions to problems are sub sets of larger or different problems. You’ll also get a negative reaction from most folks if you don’t say/show that you made a best effort to think for your self before posing your question.

Most comprehensive general forum seems to be Android Forums.
http://androidforums.com/
These forums seem to be slightly less focused on development and more on general usage. They do have their fair share of brilliant folks. Being less specifically development focused they seem to have support for a larger variety of devices.

Getting gradually less technical but still useful threads and information at Android Central’s forums.
http://forum.androidcentral.com/
Android Central is a pretty well respected Android news website and community. Their forums are less technical than the other two but they still have a great group of people willing to help and some good info to learn from.

Finally the Nook Color specific site Nook Devs.
http://www.nookdevs.com
This site is Nook specific but has some pretty clear concise and useful information and how-to on general Android things like using ADB. It’s also the place to go on information about rooting the Nook and Nook Color.

So here’s the breakdown on how Android is structured, as I understand it. I think I’m pretty astute and seem to have little trouble rooting/flashing and fixing things gone wrong on Android but I’m also not perfect so I could have some things wrong. So if you know more or see something I got wrong please let me know in the comments!


Android devices don’t differ a whole lot from PCs. They have a sort of boot loader often refered to in terms of the recovery console or recovery rom. This is a boot loader that lets you do very base level things like installing custom roms and installing things that make changes to the low level, on device file system. They usually also let you do maintenance things like clearing caches and fixing permissions.

Then you get in to what is basically the OS. This is a small light weight version of Linux. Very very basic with the sole purpose of running the Dalvik Java based virtual machine. Generally you wouldn’t need to care about the Linux base except that it provides access to the file system through software like the Android Debug Bridge or ADB for short. It basically provides command line level access to the file system over USB and/or Wifi. I’ll get more in to that later.

Last you have the Java based apps and user interface. Apps come in .apk or Android PacKage files. There are two sets of these. Those installed to /system/app which are the core Android system apps. Gmail, Navigation, Phone, Market etc. and those installed to /data/data/package_name which are apps added after the fact from the market.

So now that you understand this basic structure it should make it pretty easy to get a handle on things. First you need to root your phone. There’s nothing mysterious about this concept. On Linux systems root is the administrative account that can do absolutely anything. So rooting your phone is just what it sounds like. Gaining root access so you can run/do anything you want.

Most rooting processes will at some point depend on side loading applications. Side loading applications is the process of copying a stand alone .apk file on to your device and installing it outside the market eco-system. To do this you need to enable whats called debugging. It’s a simple check box that says you want to install things outside of the Market. To enable this press Menu > Settings > Applications and check the “Unknown Sources” check box.

So first things first is gaining root access. There are too many devices for me to address all of them and it wouldn’t be useful to address just one so I’ll simply tell you that most devices can be rooted via “one click”. Usually this is an application that you can download from the market, side load or follow some set of instructions(possibly requiring using ADB) to gain that root access. In the case of the Nook Color it’s actually a process of flashing an image file to an SD card and then booting off it. Regardless the process for gaining root on Android is pretty simple as long as you follow instructions. Use the above links to find information for your specific device.

Be aware that from here on out you will be doing things that could potentially wipe your phone or destroy data. I’d suggest you have a second SD card on hand to keep your saved Angry Birds games and your backups on. As you’ll see your recovery software has ways to make and restore backups. Make backups before you make any major changes.

Next you need to replace the default recovery with one that lets you do all sorts of cool things. It seems the most common is Clockwork Mod recovery. The easiest and safest way I’ve found to get this installed is to go the Android Market and download the application called “Rom Manager”. There are two versions, a free and paid version. The free version is all you need to get started and get Clockwork Mod installed. Once you have it installed it’s pretty straight forward. Click the first option at the top of the app that says “Flash ClockworkMod Recovery”. It should detect your phone type and prompt you for the appropriate version of ClockworkMod. If it doesnt detect your phone type properly I’d suggest backing out of the install and start doing some searching for the reason. Now you’ll be able to boot in to a custom recovery that will let you do all the awesome flashing you need. Normally you would get in to this recovery by holding down a button while booting your phone but another neat thing Rom Manager does is provide a button that automatically reboots the phone in to recovery.

Now that you have the ability to boot in to recovery you’ll need a new rom to flash to update your phone. At this point you need to know that 90% of the time if you are flashing a custom rom you will need/want to wipe everything on your phone. The only exception is if you are flashing an update to the rom you are all ready running. Make sure to have a backup(this can be done via the recovery menu or a paid copy of rom manager). Virtually all roms come with instructions. Follow them to the letter.

Most roms do follow the same common set of instructions however. Here’s what you usually see. Download a rom and put it in the root of your sd card. To be sure it’s treated like a normal rom/update leave it as a compressed zip file and rename it update.zip. Reboot the phone in to recovery and choose install rom from update.zip. It can take between 5 and 15 minutes, typically, to install the new rom. You’ll then need to reboot in to the new system.

Some roms come with the Google Apps(referred to as GAPPS) pre-installed but others don’t. Again this should be covered in the instructions. Generally you’ll just need to copy the zip file to the root of the SD card, boot in to recovery and choose install from zip file(this is different than install from update.zip), navigate to the file on the SD card and choose install xxxxx.zip.

I’ve run in to problems where GAPPS wouldn’t install properly with out wiping the Dalvik cache and in some cases as extreme as wiping the system cache. The problem with this is that some programs save info in these caches so you might lose settings or information if you do this on a device you’ve been using for a while.

The final tip I have for those getting started in to this awesome world of making your device truly yours is to have patience. There is always something new and awesome around the corner for Android but when you are dealing with development things aren’t always usable on a daily bases. There are some of us more daring than others out there and they will usually try things first and report back. When something new comes out it’s usually a good idea to wait and let the more daring among us try things first and report back when safe.

Enhanced by Zemanta
Advertisements

One response

  1. Very nice breakdown of the basics of Android hacking. Would love to see some follow up posts on more advanced topics as well.

    14 February 2011 at 8:17 pm