Tips and Tricks for Android Users
Posts tagged hacks
Using Your Android Phone as a Remote Control
Feb 14th
What I initially set out to do was find a program for my G2 that would allow me to use it as a Bluetooth trackpad and keyboard with the Mac mini I have hooked up to my television. I use it as a media PC, but it’s also a general purpose system. Every now and again it’s convenient to be able to control it using a full keyboard and mouse.
I haven’t yet run across the right tool to get my phone to work as a Bluetooth HID device for my computer. But there are some decent VNC clients that do interesting things. I’ve started using AndroidVNC as my default. I wish I could turn off the screen on the device completely. As is I turn the color depth all the way down. Because I’m sitting in front of the computer I can watch the pointer onscreen, transferring the video data over my G2 just cases it to lag.
The essential part to making it work well is to go into the settings and swap the pointer mode to trackpad. That way you can use the touchscreen on the device as a trackpad instead of having to pan around and touch directly (or use the tiny directional trackpad). You still need a VNC server on your PC, but I’m running one anyway so it’s not much of an issue for me. Still, would be nice to be able to use the Bluetooth HID version for other cases. Surprised at the lack of Bluetooth based Android hackery.
Pirate Boot Logo
Jul 25th
Every proper hacked device needs to boot up with a pirate theme. Fortunately the boot animation is trivial to replace on a Nexus one. I’m currently running CyanogenMod6, but I believe this will work other places. I replaced the boot animation with just a single image of a skull and crossed swords:
There’s plenty of info out there about replacing the boot logo and what the files do. Here’s how to get it up and running through:
- Download the pirate boot animation zip file to your system
- Remount the system partition read-write: adb shell mount -o rw,remount /dev/block/mtdblock3 /system
- Push the file across to your device: adb push pirate_bootanimation.zip /system/media/bootanimation.zip
That’s it, reboot and enjoy! If you want to poke around and change it, it should be pretty easy. There’s a writeup of what the contents of the bootanimation.zip are, which is very useful. Supposedly, also, the zip needs to be uncompressed to work. But that just means setting compression level to 0 when you run zip. This is the command I use on my OS X machine: zip -0 pirate_bootanimation.zip desc.txt part0/boot_00003.png”. That should make it easy to swap in any other picture to customize.
Commodore 64 Emulation
Jul 24th
I was happy to see there’s a Commodore 64 emulator in the Marketplace for Android, the Frodo emulator. I played around with a bit, but what I really wanted to do was hack around a bit with some old school basic. This is one of the computers I grew up with, and I get nostalgic for the old days every once in a while. However, I was having a really hard time figuring out how to get the version of Frodo under Android to create a new disk for me to save stuff to. If you can’t save the stuff you’re playing with what’s the use? I could save out the whole state, but I figured there had to be a better way.
So I downloaded a version of VICE for my desktop system. That has a much richer set of controls, one of which is creating and attaching a fresh image (it’s a ‘file’ menu item). I figured if I was lucky the image created with VICE would work to at least get me started on Frodo on my device. And lucky me, yes it does! Actually, now I can push the d64 images back and forth, use the emulator on my desktop to do a little poking around and push the file over to my device to take with me. Very nice! Just remember, save with replace is ‘SAVE “@0:FILENAME”,8′. Otherwise an attempt to overwrite a file will just silently fail. Ahhh, nostalgic.
Screenshot on a Rooted Device
Jul 20th
In addition to capturing a screenshot with a computer using the Android SDK there’s also a screenshot application (available on the market, called simple ‘screenshot’, I’m not sure how to find out the package name to create a market link for it. It only works on rooted devices, but all of mine are. One nice feature is the “shake to capture a screenshot” option. So that instead of having to keep hopping into the screenshot app to setup a shot, back to the app, wait, hop back to setup another time delayed shot, back to the app, etc. Just setup screenshot to capture when you shake and go through whatever set of screens you want.
Battery Graph Application
Jul 13th
I’ve started using an app called Battery Graph (marketplace link) by Morgan H to try to monitor changes in my battery drain. It’s a background app that collects battery charge info over time and displays a graph on device. That makes it easy to spot major changes to discharge rate. Say if you install a new widget some time early afternoon, and later that evening you see the discharge rate increased some time after lunch, you know the widget is doing something heavy and impacting your total battery life.
In the menu area there’s even an option to export the set of data to CSV so you can suck it into a spreadsheet or use it to drive some of your own tools. Would be great actually if there was an option to record a list of running processes along with the battery status info, so that it could attempt to spot which processes are sucking up the most resource.
Keeping Recovery Image After Reboot
Jul 11th
I’ve been trying lots of custom images on my N1 and G1 recently. One minor annoyance was that after installing a custom recovery image like Amon Ra to flash different base images I seemed to revert back to the default recovery image after a reboot. It wasn’t too annoying cause I kept the recovery.img on my sdcard and just did a flash_image before rebooting whenever I wanted to apply updates. But still, annoying.
Then I ran across this description of replacing the recovery partition, which explains that part of the boot process is writing the recovery.img from /system/recovery.img. That explains a lot! That page also describes how to replace the /system/recovery.img so that you keep your new recovery image after each boot. Ahh, now I have my full set of menu options whenever I hit recovery.
How To Unlock and Root a Nexus One
Jul 8th
I have a Nexus One that I’ve been fooling around with. It normally doesn’t have a SIM in it, I’m just using it to fool around with. So I’ve muddled my way through installing Froyo on it manually and taking it through a few updates. Generally I’ve been brute forcing my way through the processes based on following forum posting after forum posting.
Finally tonight I took some time to actually search around some and try to find “the right info” to get a rooted version of a custom firmware onto the device. The wiki area of the Cyanogenmod site is definitely the right place to go. They have some “Full Update Guides” linked from the front page which walk through step by step the different processes you need to go through, including a process for installing a Cyanogenmod firmware starting from a stock Nexus One. Exactly what I was looking for. It walks you through all the complementary processes too, like unlocking the bootloader and installing a recovery image.
I went with the stable Cyanogenmod release, so I’m slightly downgraded in terms of the Google release this bases off of. But there’s a bunch of capabilities in the new recovery image as well as root access to weigh that against… and right now root access is definitely winning.
Downloading Marketplace Info
Jun 2nd
One of the annoyances of the Android Marketplace (for developers at least) is that there’s no easy way to get the info to use in your own applications. Fortunately some folks have reverse engineered the protocol used by the marketplace app to create an open source project that queries the marketplace servers. I’ve been fooling around with android-market-api, great project. I actually had issues with the latest latest code from the svn repo. But if I pull from the 0_3 tag I can compile my own programs that do things like run through the categories. Nice!
Finding Great Apps
May 5th
Now that there are more than 50K apps in the market, there are a bunch of interesting services out there to help you find the best ones. Of course, some of the services are better than others. Here are a few of my favorites:
- http://www.appolicious.com/ – has an Android area
- http://appboy.com/ – includes Android apps
- http://101bestandroidapps.com/ – good listing of apps
- http://getjar.com – set your phone type to one of the Android handsets
Other great places to find apps? Leave me a comment.
Android Scripting Environment
Jun 9th
Google has recently released a scripting environment for Android that allows you to write Python, Lua, or BeanShell scripts that interface with Android functionality. From the project page:
- Handle intents
- Start activities
- Make phone calls
- Send text messages
- Scan bar codes
- Poll location and sensor data
- Use text-to-speech
