Rsync on an Android phone

Every once in a while, there are some files that I want kept in sync between my Android-based phone and one of my Linux (or Mac, or any Unix, or maybe Windows too, but I use Linux…) boxes. Yeah, I can copy them over manually via USB or even something a bit simpler like AndFTP (assuming you can SCP to the target machine). But that’s a real pain for anything like my KeePass (well, actually KeePassX and KeePassDroid) password database, that I might add something to at any time and forget to sync. I also try to occasionally (waiting in line?) backup SMS, call logs, etc. on my phone, and like to have those synced back to the desktop automatically.

Enter the solution: rsync backup for Android, a rsync client for Android that includes Tasker plugins (there are a few things about the app that I don’t like, but it seems to be the only option at the moment), and Tasker, an automation framework for Android.Tasker is one of the few Android apps that I’ve actually bought (i.e. not free/no-cost), and is currently selling for $6.49. It’s an incredibly capable task automator, very much akin to Locale on steroids. On the down side, Tasker can eat up battery life if you don’t configure it intelligently, and it’s not always 100% reliable when interacting with the system. On the positive side, Tasker can identify practically any combination of states in the android system (from hardware and software events to GPS location, time, signal status, etc.) and perform almost any task on the system based on this information. Sure, this specific problem could be solved with a cron replacement (which Android lacks, of course), but Tasker can do things like play specific audio files when you get an SMS from a specific number, mute audio at certain GPS locations, or turn WiFi on when I get home and off when I leave the house. It also has a plugin architecture, and rsync backup for Android happens to have a plugin that works with it.

So, our goal is to have a daily, bi-directional, newest-file-wins sync between a directory on our Android phone and a directory on a computer. I’m not going to go into a lot of the computer-side stuff, mainly because that varies quite a bit between operating systems, and also because my personal setup is a bit paranoid in terms of security. For the computer side, we’ll need a machine that can be SSHed to from the Internet (either a static IP or a known hostname/dynamic DNS), a user that can run rsync over SSH, and a directory that’s writable (obviously).

Setup:

  1. Buy and install the Tasker app.
  2. Install the rsync backup for Android app.
  3. Configure the rsync stuff on the computer. In the simplest form, we’ll just need a user that can login and run rsync, and a directory to sync from/to (note: this should be a directory used only for syncing the phone…).
  4. Open the rsync backup for Android app. Use Menu -> Generate Keys to generate a new pair of SSH keys, and then get the public key setup on the target computer. See the developer’s web site for instructions.
  5. Once keys are setup, create a new profile called “PC-droid”. Set the local directory to a new empty directory (I used /sdcard/sync), enter the remote host address, port, username, and remote directory, and select the private SSH key that you created. Check off “rsync on reverse direction”. As this program is just a GUI wrapper around normal rsync binaries, you can specify additional options to the rsync command; my string ended up being -vHrltDuO --chmod=Du+rwx,go-rwx,Fu+rw,go-rw --no-perms. If it helps, at the bottom of the screen you can see the actual rsync command line that will be run. Save when done.
  6. Save the profile, then long-press it and select “Duplicate”. Change the name to “droid-PC”, uncheck “rsync in reverse direction”, and change your additional options as needed (mine became -vHrltDu --chmod=Dug+rwx,o-rwx,Fug+rw,o-rw --no-perms). Save when done.
  7. Create a test file in the sync directory on the PC, and a different one in the sync directory on the droid.
  8. One at a time, in the rsync backup app, tap on the profile names. If all goes well, the syncs should run, and both files will now be in both places. If there are any problems, the output should help; the most likely issues are probably permissions, rsync command options, or SSH keys.
  9. Long-press each profile, select “Edit”, and check off “Close log window after job is done”. Save profile.
  10. Now fire up Tasker. Click the “+” at the bottom of the screen to create a new profile, call it “sync”, and click the check mark.
  11. On the First Context panel, tap Time, and select when you want the jobs to run; I chose 03:01. Tap the check mark.
  12. On the Task Selection panel, tap New Task. Give it a name, like “sync2″.
  13. On the Task Edit panel, tap the “+” button at the bottom left, tap Plugin, tap “rsync backup for Android”, click the “Edit” button on the Configuration line, and select the PC-droid rsync profile. Tap the check mark in the lower left to save.
  14. Repeat the last step for the droid-PC rsync profile.
  15. Tap the check box in the lower left. This saves the profile.
  16. In the main Tasker screen, make sure there’s a green check to the right of the profile you just added, and that the button at the bottom right of the screen is set to “On”.

Assuming this all went well, the next time the time you specified rolls around, your sync should run. If you gave the task a name in step 12, you can setup additional profiles to run it at other times (or use the repeat logic builtin).

Motorola Droid: Rooted 2.0.1 to Rooted 2.2 (CyanogenMod)

As of this morning, my Motorola Droid was still running rooted 2.0.1 (build ESD56, baseband C_01.3E.01P) with SPRecovery 0.99.2b. Well yesterday I for the random deletion of all SMS bug again, and I decided it’s time to upgrade. I never upgraded to 2.1 – mainly out of laziness. When it first came out, nobody had a patched update.zip yet to preserve root. When I looked back into the situation a few weeks ago (when Froyo/2.2 came out), I found that pretty much the whole community had moved from patched update.zip’s to full ROM images. I didn’t want to lose my apps, data, settings, etc. and couldn’t find any instructions that didn’t include a wipe/reset, so I decided to keep putting it off.

Well, after yesterday’s bug (and after I played with the Camera app on an Incredible and saw how much nicer it is), I decided it was time to bite the bullet and move to CyanogenMod ROMS. I performed the upgrade this morning, and it seems to have worked OK, though I haven’t been using the phone very much since it finished.

Rooted 2.0.1 to CyanogenMod 2.2 procedure:

I’m starting with a Motorola Droid, 2.0.1 (build ESD56), rooted, baseband C_01.3E.01P, with SPRecovery 0.99.2b

  1. Perform full Nandroid backup through SPRecovery.
  2. Run Call Logs Backup & Restore (v1.8) to backup call log.
  3. Run SMS Backup & Restore (v3.4) to backup SMS data.
  4. Run MyAppsList to make a list of all installed apps as HTML, including market links. Save to SD card.
  5. Run Bookmark Sort & Backup Free to backup bookmarks to SD card.
  6. Run ASTRO file manager and backup ALL apps to SD card.
  7. Mount the SD card on another computer and copy all the backups you just made to somewhere safe.

For the rest of the procedure, I more or less followed the CyanogenMod Droid Full Update guide.

  1. Buy & install ROM Manager Premium.
  2. Flash ClockworkMod Recovery.
  3. Use ROM Manager to backup current ROM to SD card, copy the backup somewhere safe on another computer.
  4. ROM Manager – download CyanogenMod 6.0.0 for Droid with AWDLauncher and Google Apps.
  5. Check off “wipe data and cache”, click OK.
  6. Phone reboots into recovery, flashes new image, and boots to CyanogenMod Froyo (2.2, build FRG22D), still has baseband C_01.3E.01P.
  7. Enter your Google account information to begin sync. Your Google data (calendar, contacts, etc.) should be synced as well as all of your Market apps. You will, however, lose all of your app settings.

Post-Upgrade:

After the upgrade, there were a few things I had to do, and a few issues that I wasn’t prepared for. Here’s a list of them, and the solutions I found (if any) in no particular order…

  • Restore bookmarks, call log, SMS backup.
  • All of my per-contact ringtones were gone. As far as I could find, there’s no known good way of backing up and restoring these.
  • I obviously lost the HD-quality video hack I’d applied to the Droid, as well as anything else I’d done in the boot settings file.
  • I apparently lost the following apps (not restored when the phone synced with Google):
  • The following apps were added by CyanogenMod (or are new since 2.0.1):
  • These apps had data associated with them which was somewhat important (I wrote the script below to handle the move):
  • Had to re-set my notification sounds – Flutey Phone for incoming calls, Look at Me for messaging and Highwire for other notifications.
  • Much to my pleasure, my WiFi settings, saved networks, etc. magically came back. Haven’t checked bluetooth yet.
  • I had to change my voicemail number (Settings -> Call Settings -> Voicemail Settings) to automatically wait and enter my password.

At the moment, this script is obviously setup to do one app at a time, hard-coded in the APP variable. It also assumes that the app data directory is stored at /sdcard/restore/$APP.

#!/bin/bash
 
APP="com.vp.alarmClockPlusDock"
 
BIN_PATH="/system/xbin/"
DATA_PATH="/data/data/"
BACKUP_PATH=""
PERMS_PATH="/data/system/packages.list"
 
OWNER=`grep -i "$APP" /data/system/packages.list | awk '{ print $2}'`
 
echo "OWNER=$OWNER="
 
/system/xbin/mv /data/data/"$APP" /data/data/z
/system/xbin/mv /sdcard/restore/"$APP" /data/data/"$APP"
/system/xbin/rm -Rf /data/data/z
 
/system/xbin/chown -R 10069:10069 /data/data/"$APP"
 
/system/xbin/chmod 751 /data/data/"$APP"
 
if [ -e  /data/data/"$APP"/cache ]
then
    /system/xbin/chmod -R 771 /data/data/"$APP"/cache
fi
 
if [ -e /data/data/"$APP"/databases ]
then
    /system/xbin/chmod 771 /data/data/"$APP"/databases
    /system/xbin/chmod 660 /data/data/"$APP"/databases/*.db
fi
 
if [ -e /data/data/"$APP"/files ]
then
    /system/xbin/chmod -R 771 /data/data/"$APP"/files
    /system/xbin/chmod 660 /data/data/"$APP"/files/*
fi
 
if [ -e /data/data/"$APP"/lib ]
then
    /system/xbin/chown -R system:system /data/data/"$APP"/lib
    /system/xbin/chmod -R 755 /data/data/"$APP"/lib
fi
 
if [ -e  /data/data/"$APP"/shared_prefs ]
then
    /system/xbin/chmod 771 /data/data/"$APP"/shared_prefs
    /system/xbin/chmod 660 /data/data/"$APP"/shared_prefs/*
fi
 
echo "DONE."

I’ll update this now and then as I have more to add to it…

My Droid Rooting Dilemma

My Droid is still running 2.0.1 rooted, with SPS Recovery, just as it was the week the 2.0.1 update was pushed out OTA – I’d already rooted it, disabled OTA updates, and performed a simple procedure to update and keep root.

My one complaint is that – as always happens with a new and cool technology that gets widely adopted – it seems like the Android community is being, well, dumbed down. When I first rooted my Droid, it involved using the adb shell. Now, it’s hard to find instructions that aren’t written exclusively for Windows – or even instructions that actually explain what I’m supposed to be doing or why it works.

I know that I haven’t followed the Android world much lately, but it seems to me that this should be really simple. The update.zip OTA updates are just patches. I already have the device rooted on 2.0.1, have disabled OTA updates, etc. So it seems to me that I should be able to just unzip the update file, change whatever needs to be changed to keep root, re-zip it, and upload it. If it wasn’t already done (the HowTo that I followed to update to rooted 2.0.1 doesn’t seem to be online anymore, and I can’t find the URL), I should be able to just change the update verification keys to accept anything.

Well, I guess it’s time to continue my hours of research and see if I can come up with anything. Everything I’ve already found says that I have to backup all of my apps and data and just flash a new ROM, but that seems stupid. Why can’t I just make use of this wonderful patch-based updating and keep root?

Updated Android App List

Here’s the current list of the apps that are running on my Droid and seem interesting (I’m still running 2.0.1, build ESD56). This is an update to my earlier post, My Android Apps, so I left out everything that was already in that post.

This list was generated with MyAppsList, though I did massage it a bit after generation (mainly because it copied text that was all on one line, though it does output HTML with market links and the apps in li elements). The simple script to make the output a little more blog-friendly is:

cat apps.txt | sed 's/<\/li>/<\/li>\
/g' | sed 's/<font style="font-weight:bold">//g' | sed 's/<\/font>//g' | sed 's/<br \/>//g'
  • Adobe Reader (v9.0.1) – full version of Adboe Reader
  • Altitude Free (v1.0.5) – Shows your current altitude from GPS.
  • AndroZip (v1.0.1) – Good all-around file manager and archive manager.
  • arcMedia (v0.24b) – Media (video) player.
  • Barnacle Wifi Tether (v0.5.1) – WiFi tethering for rooted Droids with stock kernel. See my WiFi tether for Droid.
  • Bluetooth File Transfer (v3.40) – Good tool for transferring arbitrary files, contacts, etc. over bluetooth.
  • Bookmarking for Delicious.com (v1.3.2) – Delicious bookmarking, so I can now keep my Droid in sync with all of my desktops, laptops, etc.
  • ConvertPad – Unit Converter (v1.4.2) Simple but full-featured unit converter. Need to know how many twips there are in a fathom? No problem…
  • DriveSafe.ly (v1.3.47) – cool app that reads incoming SMS to you. Can automatically activate when it connects to bluetooth.
  • li>GPS Status (v3.2) – Shows GPS status (like a *real* GPS) including VDOP/HDOP/DOP, battery, geoid height for altitude; altitude is relative to the mean sea level, satellites in view, etc.

  • gReader (v1.6.8) – Good RSS reader with sync to Google Reader and automatic sync of articles for offline viewing.
  • Handcent SMS (v3.2.6) – Just got this, still figuring it out, but appears to be a much nicer messaging app with popups (including reply box) for incoming SMS, nicer view, etc.
  • My Verizon Mobile (v5.0) – Verizon’s app that shows your current monthly minute, SMS, and data usage, as well as other stuff.
  • MyAppsList (v1.4 BETA) – App used to generate this list.
  • Package Tracking (v1.9b) – Simple package tracking for UPS, FedEx, etc. Unfortunately it doesn’t provide any notifications and it only remembers one tracking number at a time.
  • PdaNet (v2.42) – USB or Bluetooth tethering (official client software is Mac and Windows only).
  • Ping (v1.6.9) – Ping app.
  • Python for Android (v0) – Python interpreter for SL4A. So far, it doesn’t seem to be able to do too much in my opinion.
  • ShopSavvy (v3.6.6) – Scan a bar code, see the lowest prices for that product both online and in local stores.
  • SL4A (v0) – Scripting environment for Android with pluggable interpreters. So far, it seems to be missing a lot of Android classes that would make it useful for doing device-specific things (like listing installed apps).
  • VoiceMemo (v1.0.1) – Simple voice memo app. I use it quite a bit, but there’s no simple way to email SMSes, it only titles them by date and time recorded, and it doesn’t keep the phone awake (recordings seem limited to 60 seconds or so).

My Android Apps

Update 2010-08-15 – I’ve also added some new apps to an updated post.

The past 48 hours has been very eventful in my Android world. Thanks to the instructions on rootyourdroid.info (hey, it’s an expensive phone and locked hardware – I’m not fooling around the way I would with something more common), I rooted my droid and did a few minor hacks. Though, I must say, it pains me to see all of the post-rooting instructions based on access via adb, instead of using a terminal emulator on the phone. Also, last night, my mother (definitely not a technical person) for a Droid – and loves it! (My dad got one a month or two ago).

Anyway, in the last 24 hours, I’ve gone app-crazy. I thought I’d share some of my findings here. Unfortunately, while a few of the app/file managers out there do dump a list of applications, I can’t find one that dumps a list including the package names (which are required to create an effective link to the app). If any of you know of one, please enlighten me. For now, I’ll construct this list by hand (using the list from ASTRO 2.2.4), and maybe write an app to do it in the future.

(Note: These links all use the market:// URI scheme, so they’re only useful if clicked on an Android device with the Market app.)

  • AndFTP (1.3) – A good FTP/SFTP client for Android, includes pubkey-based authentication and host storage.
  • Android Battery Dog (0.1.2) – An app that runs as a service and collects detailed statistics on battery usage, including temperature, charge percent, voltage, discharge rate, battery technology and external power status. While it can display a graph or formatted data, its’ real shining point is the ability to export timestamped semicolon-delimited data files for external graphing and analysis.
  • Any Cut (1.0) – Allows you to create shortcuts on your home screen to almost anything, including Android OS Acitvities, direct calls or direct text messages.
  • ASTRO (2.2.4) – File manager that allows copying of files on the device (both internal memory and SD card), image and file viewing, listing/management of apps (including finding out the package name of an App), reading of tar and tgz files, etc.
  • Battery Widget (1.5.2, by mippin) – Very simple widget for the home screen that takes up one square and shows current battery level. When clicked, provides shortcuts to settings screens for display, GPS, WiFi and Bluetooth.
  • Compass (1.1) – Simple compass app. Shows a compass which seems to be accurate, current lat/long and current street address. Has extensive settings and some nice skins for the compass.
  • ConnectBot (1.6.2) – A very good SSH client for Android. Allows storage of multiple hosts, pubkey-based authentication (with a master password), etc. Unfortunately, doesn’t seem to have any way (that I can find) to enter certain characters, such as tab and pipe (|).
  • Dolphin Browser (2.5.0) – An alternate browser for Android. I haven’t used it extensively yet, but it shows multiple tabs at the top of the screen like Firefox (easier to switch between tabs than the stock browser’s Menu -> Windows) and supports iPhone-like multitouch on the Droid.
  • drocap2 (2.07) – Screen capture program (requires root). Allows you to trigger a capture from the notifications bar and stores captures on the SD card.
  • DroidLight (3.0) – Nice twist on the usual flashlight app. By Motorola, this app triggers the camera’s flash LED in a steady burn mode, providing very good light output. Probably a real battery killer.
  • FoxyRing (1.12) – This was an ANdroid Developer Challenge winner and, among other things, it claims to monitor ambient sound levels and adjust your ringer volume to match them. Unfortunately, due to the overly restrictive End User License Agreement (EULA), specifically the strong provisions against reverse engineering and redistribution, I was forced to uninstall the app before even trying it.
  • GPS Status (3.0.3) – Very nice app. Provides a display like a real GPS, showing the location and status of various satellites (in a rotating compass), heading and orientation, number of fixes, estimated error (DoP), signal strength graph for stelites, speed, altitude, pitch/tilt of phone, magnetic field, acceleration, coordinates and time of last fix.
  • iPerf (1.07) – An iPerf client for Android that seems to work fine. How cool! Seems to be a wrapper around the binary, lets you specify CLI arguments, shows console output.
  • Meebo IM (22) – A simple, good, multi-protocol IM application.
  • Metal Detector (1.2-RELEASE) – Maybe not that useful, but way cool. The Droid (and perhaps other phones?) uses the compass to detect magnetic fields to trigger the modes for car dock and multimedia dock. This turns it into a metal detector. Wonderful cool-ness factor.
  • Nagroid (0.0.7) – A Nagios watcher for Android. Can be configured with only one URL, but can do HTTP Basic Auth and handle self-signed SSL certs. Options to hide everything that’s OK, and show only unhandled (un-acknowledged) problems. Also can start a service to poll and alert at regular intervals. Only down side is that it only handles one Nagios URL.
  • Network Discovery (0.2.7.1) – Intersting little app that I haven’t played around with much. Does port scans of IPs and runs a “network discovery” of the LAN, though it doesn’t say whether it is active (ping/port scanning) or passive (ARP). Displays info on devices (IP, MAC address, decodes MAC manufacturer name from address) and a button to run a port scan.
  • OSMonitor (1.1.0) – Good process monitor for Android – shows running processes. load from each process, total CPU usage, network information for all NICs (WiFi, BT, cellular/PPP), active TCP connections, battery status, storage status (of ALL filesystems), and internal log.
  • Ping (1.5.3) – Simple ping app. Lets you enter an IP and select how many pings to send out. Shows console output.
  • Shazam (1.3) – Yup, same thing that was the killer app for iPhone.
  • SMS Backup & Restore (2.1) – Allows backup and restore of SMS data to/from SD card, as an XML file. Good for Droid users who experience the disappearing SMS bug.
  • Speed Test (1.7.0) – A simple speed test app for Android from speedtest.net. Not sure how accurate it is, but it does upload and download tests over WiFi or cellular/PPP.
  • Spirit Level Plus (1.2) – Simple but cool. Spirit level for the phone, using the builtin accelerometer. Seems relatively accurate.
  • StopWatch (1.07) – AWFUL. It’s a stopwatch app, but I could not get it to stop displaying stuff in the notifications bar.
  • Terminal Emulator (1.0.4) – Terminal emulator for Android. It feels so wonderful to be able to pull up an app, pop open the keyboard, and type “su” on my phone. On the down side, once again, I can’t figure out how to enter the pipe or tab characters, and I don’t know what shell the phone has on it.
  • Wifi Analyzer (2.2.9) – REALLY COOL. Vaguely WiSpy like, but I doubt it’s accurate. Shows a graph of spectrum utilization with SSIDs and signal strength, a time-based graph of signal strength per SSID, a simple list of APs with channel number, BSSID, frequency, signal strength and encryption, and a simple “signal meter”. Looks like it could be pretty useful.
  • WifiScanner (1.7) – Simple WiFi scanner app. Shows all detected WiFi APs along with SSID, BSSID/MAC, signal level, channel and encryption.

Android 2.0.1 update

So, I updated my Droid to Android 2.0.1 today. I’ll be honest that it didn’t work the way I’d hoped. When I woke up this morning (December 10th 2009) I had an alert dialog on screen telling me that an update was ready. It gave me three options: “Install Now”, “Install Later” and “More Info”. The More Info screen didn’t show me anything useful. Well, I clicked the “Later” option, figuring that when I got home tonight I’d turn on WiFi, do a packet capture on the router, and save all of the traffic (specifically including the name of the update server). Well, it kept reminding me all day at annoyingly short intervals – probably about every 10 minutes or so. Finally, when I was home and had the WiFi setup, I went to try it again and… yup… when I clicked on the “System Update” button in Settings, the only option I had was “Reboot and Install”.

So… first big bitch about the Droid… Verizon pushed out the update without my consent. I kept hitting “Later” because that was the only way to get the popup to go away. Apparently. after X times of hitting Later (and each time your only real options are Later or Now) it will download the update by itself. Once the update is downloaded, I’m assuming that it *may* just automatically install on the next reboot. That would be a bitch thing to do.

Anyway, the “More Info” screen, which provides (as far as I can tell) the only release notes for the update, states:

This software update includes enhancements to your DROID by Motorola. Approximate install time: 6-10 Mins. You will be unable to use your device or make emergency calls for the duration of the install. The software updates automatically, and your DROID will power off and on as part of this software update. For more information please visit: www.verizonwireless.com/droidsupport

Not too helpful. And pretty cryptic.

Immediately when the phone turned back on, the first thing I noticed is that the spin-style unlock button has been replaced with an iPhone-style slide button, and the same for the mute feature. Maybe it’s just me, but I also noticed that the on screen keyboard seems to react better to quick keypresses – perhaps they’ve enabled multitouch for this?

Unfortunately, I wasn’t able to find much release documentation from Google other than the API changes – no full release notes or changelog like I’d like. And not even a summary of changes that I could find.

At the VZW droid support site, I found a link to a PDF of “Why to Update” (local copy). This sheet lists the enhancements made by the update (“AP:ESD56/BP:C_01.3E.01P”, build ESD56) as:

  • OS stability is improved.
  • Battery life is improved.
  • Camera auto focus functionality is improved, and time between shots is reduced.
  • Enhancements for three-way calling.
  • Audio for incoming calls is improved.
  • When receiving a call on call waiting, the speakerphone now remains on.
  • Bluetooth functionality is improved; background echo is eliminated.
  • Improved Bluetooth phone book transfer of contacts to in-vehicle Bluetooth solutions.
  • After closing a GPS application, the GPS icon will now automatically be removed from the notification panel.
  • Users can now receive SMS and MMS messages after an EMS message is received.
  • SMS and MMS may now be sent to seven-digit addresses.
  • Google contact merging has been updated to accommodate seven-digit numbers.
  • Visual Voice Mail notices now arrive instantaneously.
  • The corporate calendar widget user interface is updated.

This tiny one-page (and very styish – looks like and in-store advertising piece) sheet obviously isn’t anything that could pass for release notes, especially from Google. It doesn’t even mention anything about the changed unlock button!

I’ll keep looking around to find a real feature summary/release notes/changelog, but here’s my running list (I’ll update) of what I’ve found:

  • Changed the unlock slider to a straight line.
  • On screen keyboard typing seems faster.
  • Photo taking is considerably faster, though it’s still painfully slow – it used to take about 10 seconds from shutter button to ready to capture next image, it’s now about 5 seconds.
  • The UI seems to be a bit more responsive overall.
  • I haven’t checked yet, but I’ve seen some forum posts about lost contacts and Facebook sync issues.

Android links – maps, dial a phone number

If you’ve used Google search from an Android device to search for a business, you’ve probably noticed the two interesting “buttons” to the right of the search listing – “Get Directions” and a button for the phone number. It turns out, these are pretty easy to implement.

The “Get Directions” link is a simple link to Google Maps like This One. The links are actually pretty simple:

<a href="http://maps.google.com/maps?daddr=42+Pierce+Ave%2C+Midland+Park%2C+NJ+07432">Get Directions</a>

It just uses a regular Google Maps URL, with the destination address encoded. When the link is clicked in the Android browser, a dialog pops up asking the user whether he wants to open it with the browser or the Maps application. If Maps is selected, it automatically opens with the address from the URL in the destination input box, the phone’s current location as the start input, and gives easy access to directions and navigation.

The telephone links are a bit more interesting. Apparently, the Android browser uses the Phone app to handle the “tel” scheme, as defined by RFC 3966.Therefore, clicking a link like:

<a href="tel:2015555555">201-555-5555</a>

on Android will bring up the Phone app and pre-enter the digits for 2015555555. Luckily, it doesn’t automatically dial the number. If you want to give it a try and are using Android: 201-555-5555.

The final step is how to implement this. I don’t know if most mobile browsers (Blackberry? iPhone?) also support the “tel” URI scheme, or how they’ll handle Google Maps links. But if you’re looking to include Android-specific content, the user agent string from my Motorola Droid (Android 2.0) looks like:

Mozilla/5.0 (Linux; U;Android 2.0; en-us; Droid Build/ESD20) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17

I know that there are a number of PHP classes out there to detect browsers (like Chris Schuld’s browser.php) and some things to detect mobile device capabilities (like WURFL or Tera WURFL, both using the WURFL data). However, if you just need to know whether your user is on Android or not, I’d personally recommend just checking the user agent string for “Linux”, “Android” and “WebKit” until a better browser identification system is found, as these are not likely to change in the near future.

Droid Camera problem solved

Gizmodo – The Real Reason the Droid’s Camera Fixed Itself.

Well, it’s definitely good news to know that the problem with the camera on my beautiful new Droid is only a software issue. However it’s not too reassuring to know that Google (or could it have been Motorola devs?) let code out which obviously has a bit of an issue with a… rather predictable… value.

Weekend of Code (Android)

The Droid is here (literally, sitting in my pocket), and I have the next two days off of work – plus the weekend. Minus personal commitments, that’s about two full (call it 16 hour) days to get some work done. While I have lots of things that could use my attention – a number of neglected projects, my big new PHPsa project, and some server consolidation at home – I’ve decided to dedicate the time to Android development.

I’ve got the ADK installed and running, and the emulator is wonderful (especially with the Droid skin). And I know it’s wrong, but I think I’m going to be developing the first app for Android 2.0 (especially given the new ContactsContract API in 5).

I’m having a few issues with Subclipse, even on the latest OpenSuSE 11.1, and still have a few things I want to do on the phone… but hopefully I’ll have a beta build of the app by the end of the weekend. I’ve already done most of the data modeling and sketched out the storyboard.

I’m not going to say much about what the app is until it’s ready, but it’s something targeted at people like me – SysAdmins with way too many things on their plate for their number of waking hours.

Droid!

I don’t like writing posts with a low useful content quotient, but here goes.

After having only one new (i.e. not used) phone in eight years – and the one new one was a Treo 700p, obsolete when I bought it – I decided to bite the bullet. I bought a Droid! While I was almost dead-set on it before I even held it in the store, my feelings of love at first sight were even more clear when I started to play around with it.

So, here’s a little overview of what I did first, what my plans/questions are, and what’s next.

First minutes/day:

  1. Unpack everything and start to figure things out. Test phone, SMS, data.
  2. Setup IMAP email for my personal account (need to look into IMAP-IDLE).
  3. Go through the entire Settings menu and try to set things up. Find out that the default apps can’t be removed. The app screen, by default, is pretty full…
  4. Export my contacts from my Palm (no sync cable, had to use php-pdb to export a CSV, then manually edit ALL of them in Gmail.

So after having the phone for about 12 hours, here’s what I’ve installed on it:

  • Listen (Google Labs) – Great podcatcher app. The speaker is a bit too quiet for easy listening on the drive to work, so I’ll need to get one of those FM radio interfaces.
  • AnyCut – allows creation of arbitrary shortcuts on the desktop, including direct dial.
  • ConnectBot – full-featured SSH client including key-based auth and storage of multiple user/host settings.
  • Meebo IM – IM client. It does AIM, which is nice, but doesn’t do IRC.
  • Android Battery Dog – App that graphs battery voltage, temperature, capacity over time and also stores a simple CSV log (which I intend to parse out later for historical data).
  • Bookmarking for Delicious – Allows saving of bookmarks to del.icio.us (but not retrieval).
  • To Do List – A very simple To Do list app, until I find something that works with Google Tasks. No syncing.
  • VoiceMemo (JavaCodeLand.com) – A really simple voice memo app.
  • WiFinder (PGMsoft) – Pretty much useless. Shows a scan of WiFi networks, but only shows encryption, channel number, and signal strength in bars.

The few problems I’ve noticed so far:

  • The touch-sensitive buttons along the bottom row (specifically the search button) seem to be right where my thumb wants to rest when holding the phone in landscape mode.
  • As others have mentioned, the camera quality isn’t great, but it’s much better than my Treo 700p.

My list for future research/development:

  • WAP pages for my web-based personal finance app, fuel log, etc.
  • IMAP IDLE
  • Tasks/to do app that syncs with Google Tasks.
  • A Cycle System app.
  • How to quickly mute all sounds on the phone.
  • How to do tones by person or group for not only ringtones (phone) but also SMS, Email, etc. Also, a way to set certain hours of the day when audible alerts will be disabled, other than a specified whitelist (email, SMS, etc.)
  • Verizon Visual Voicemail
  • Do some development with the geolocation JS API.
  • Console on the phone?
  • SCP/SFTP program.
  • TV listings (perhaps a WAP version of my script that pulls from SchedulesDirect (unfortunately, due to their redistribution policy, this is a private, authenticated page).
  • Nagios checker/notifier
  • RSS reader
  • WAP page for PHP EMS Tools callin.
  • How to handle IMAP folders?
  • Script to backup Gmail contacts, other data stored with Google.
  • Thunderbird Gmail contact sync.
  • A wifi scanner/survey software that shows all of the important stuff like signal strength in dbm, noise floor, etc.
  • Something like kismet that integrates the GPS and wifi scanning.