The Android Platform

Discussion of the T-mobile Android G1, as a phone, PDA, and development platform.


android: Thu Dec 2 02:15:00 2010

Thu Dec 2 02:15:00 2010

I still love the G1 keyboard, but it's now way too underprovisioned for my day-to-day use (TouchDown, the activesync-in-isolation client that actually works with my new employer's Outlook 2007 install, takes up around 1/6th of the available memory all by itself, and that's just not really workable - especially since I treat it as a PDA first and a phone third) so I picked up a second-hand Nexus 1 (no keyboard at all, but it's not like any of the new keyboard-phones have decent 5-row keyboards anyway) and installed CyanogenMod 6 on it (so I get bluetooth keyboard use out-of-the-box, and can use Titanium Backup to get nightly incrementals and weekly full backups...)

In the last couple of weeks, though, I've been running in to a problem - sometimes, after running the battery into the ground (something relatively easy to do, as I leave 802.11 on, and noone is making jumbo batteries like they did for the G1) I'll charge it and power it back up and find that

The only way I've found to recover from this seems to be what the rest of the web has found - hard reset (and restore apps and data from backups.) With 170 apps installed (based on how Titanium Backup counts them, so this includes system apps and cyanogen stuff too) this takes a while, especially as I need to use the "classic" restore mode that requires two button presses per install (due to what appears to be some corrupted apks, something that needs more investigation.) Once I realized that all of the above complaints might be related, I found some useful links, mostly starting from http://code.google.com/p/android/issues/detail?id=4358 though http://groups.google.com/group/android-porting/browse_thread/thread/61baf6058966fe31 was particularly helpful in showing the actual repair technique:

$ adb shell
# sqlite3 /data/data/com.android.providers.settings/databases/settings.db
INSERT INTO "secure" (name, value) VALUES ('device_provisioned', 1);
.quit

and then reboot the phone for it to actually take effect. Apparently device_provisioned is used by inKeyguardRestrictedKeyInputMode in frameworks/base/core/java/android/view/WindowManagerPolicy.java as part of preventing the new phone user from stumbling out of the setup wizard, though a little more digging suggest it's screen-lock related as well; looking through the android tree for DEVICE_PROVISIONED seems to find the relevant code (which tells me it also turns off doing anything with the dock, based on frameworks/base/services/java/com/android/server/DockObserver.java though I can't test that since I've yet to find a source for a real Nexus 1 dock (one that uses the drop-in contacts and not just a generic fidget-with-the-connector microUSB one) and it also looks like it blocks incoming phone calls and SMSes as well.

In the meantime, I should probably write a little SL4A python app to make that change directly, see http://code.google.com/p/android-scripting/issues/detail?id=184#c15 for the first steps in getting the "run python scripts as root" part of the riddle trail. ( packages/apps/Provision/src/com/android/provision/DefaultActivity.java has the bare skeleton of how to do it from java, but doesn't include the root or UI parts at all.)


android: Mon Jun 15 01:09:00 2009

Mon Jun 15 01:09:00 2009

Dug up the python code I used to send zephyr messages from my old Nokia 6630, tweaked it a bit to have a bit of actual UI on ASE:

Discovered that apparently os.putenv doesn't work (or at least os.getenv in the same process didn't see the value.) Also was reminded that socket.gethostbyname(socket.gethostname()) only gets a useful local host on "real" machines, and to make things worse I was behind a NAT... so sending unauthenticated packets failed until I hardcoded the NAT's outside address as the local part of the notice unique id (an anti-harassment feature from ages ago is that unauth packets need to include their real sender IP addr; auth packets can have "privacy" and use a null value.)

Since ultimately I want to subscribe as much as I want to send, I'll need auth eventually. I could port my kerberos-v4-in-raw-perl to python today, but I've avoided that particular sin for long enough that zephyr-with-kerberos-v5 is almost viable... on top of that, since I actually need NAT support in practice, I should start thinking about a zephyr-v5 relay. (That should be of more general use - otherwise I should instead just do an xmpp/zephyr relay and use existing xmpp clients on the phone, right?)


android: Tue Jun 9 12:51:00 2009

Tue Jun 9 12:51:00 2009

Yesterday Google announced and released the Android Scripting Environment - Python, Lua, and BeanShell as a giant blob for Android. Looks like I can finally start using Python on the box - written some simple bits of test code with it already. Cool feature: since python talks to java/dex via an Android Proxy wrapper, using JSONRPC, you can start ASE and then portforward the proxy to a connected system, so you can run python code that manipulates the phone from an interpreter on your desktop...

Very much an early release, lots of stuff missing but what's there works!


android: Thu Jan 1 16:18:00 2009

Thu Jan 1 16:18:00 2009

New feature in aTrackDog - saving the app list to sdcard (or sending it by email.) I really do have 98 apps installed, and that doesn't include MMMRavs (which is still using the not-quite-right mechanism for producing version numbers, which I'll need to fix at some point, especially if I ever put it in the market.)

Note that listing these here is not, per se, a recommendation - some things I keep installed just because I might want them someday, some are "bad implementations of a good idea" that will get flushed when I better one comes along.


android: Sun Dec 21 23:55:00 2008

Sun Dec 21 23:55:00 2008

Followup on the Zebra Crossing barcode app - I realized I wanted a copy of the PDF version of the manual for my camera on my phone. I already had the URL, and the JetCet PDF beta for Android on the phone so I could read it once I got there. A quick googling found the Kaywa qr-code generator, I pasted the url into that, fired up the Barcode app, pointed the phonecam at the laptop screen, beep clicked "open as url", waited for the download, tap and there was the manual. Not quite as smooth as bluetooth, but relatively straightforward...


android: Sun Dec 21 00:37:00 2008

Sun Dec 21 00:37:00 2008

Haven't done any dev in a while (end-of-year has been busy and I still don't have a useful python) but it's been a good phone (and phonalyzr shows this clearly, now that I've had it long enough to accumulate some data), and a good PDA.

One missing piece on the PDA side has been, well, apt-get upgrade :-) A third-party package called atrackdog just hit the Market, and it's exactly what I was looking for (namely it promptly showed me some 20 out-of-date apps, and made it easy to update them via the Market.) I've deleted OI Update - it was a good first try, and has other useful apps, but it never gave reliable answers for more than 4 or 5 packages OpenIntents, and by attempting to have a separate database of metadata, the approach was doomed from the start. (They have other nicely done apps - strictly speaking, I'd even say that OI update was nicely done, it was just doing the wrong thing...)

One upgrade in particular, the Zebra Crossing Barcode Reader app, gained an interestingly clever new feature: it already had support for recognizing and parsing QR-code 2-D barcodes - so they added support to pick a bookmark (or a contact entry) and display that on-screen as a QR-code... instant "optical beaming" as long as the both of you have the app (a quick download from the Market), no need to wait for Bluetooth or deal with OBEX :-)


android: Thu Dec 4 21:22:00 2008

Thu Dec 4 21:22:00 2008

At a BPS Hackathon, decided to try building jythonroid - which isn't going to go in the direction I'm trying for unless I start pushing it that way, the current developer is mostly working on commandline python on the emulator (which isn't really useful for the phone.) I'm looking for writing application code in python - I'm happy to "bundle" it with jython to actually get it running on the phone.

Leads to a bin/util-debug.apk - which visibly runs the code in src/org/classfoo/Jythonroid.java - and crashes, but that's expected, the code is pretty incomplete - but the next step for me is to probably take most of that out and call PythonInterpreter.exec() directly on some code of my own...

Footnotes:


android: Thu Dec 4 02:40:00 2008

Thu Dec 4 02:40:00 2008

Yay - WikiNotes recently got the ability to dump the whole note-set into an XML file on the SD card. I was able to build it with the patches in order to attempt to try it out - except that I couldn't install it, due to Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE] which the web informs me is because there's already a signed version installed, with a key that doesn't match. This seems sort of like the ssh "known_hosts" feature. I'd have to uninstall that one (losing my data, which was the whole point of the exercise) to install my build... fortunately, someone on the team pushed that version out to the App Market so I was able to just install and use it.

This kind of difference between Android and most popular desktop operating systems ends up making the flavor of open source development rather different - in order to share your modified app, you must fork it, otherwise noone can test your modified version - see K-9/Mail for an example of this.

The DTD is pretty simple:

I'll probably throw something together to push a subset of pages out to the web, but for now it's enough for private structured notetaking, since I can get the data out. For now, local:render_wikinotes.py is a trivial script that expands the WikiNotes XML into a directory of linked HTML files...

Footnotes:


android: Fri Nov 14 00:54:00 2008

Fri Nov 14 00:54:00 2008

WikiNotes showed up in the app store - not sure if it's the apps-for-android one, but it's simple and useful and probably replaces my current scribbled-on-paper notes pretty well; the one thing it's missing is live web sync of some kind (but at least I can back it up by rsyncing the micro-SD card, like I do with the rest of the content.)

RingDroid also wins - it's a nice simple visual "clip bits of an mp3 to make ring tones" app, and so I finally have the initial beeps of Feuer Frei as a notification sound - something I've had on my list for years, and the 6630 could have done but I never got around to learning a sound clip editor...

As far as coding, I rewrote MMMRavs to dynamically build the UI in Java instead of using static XML layout. Mostly a learning experience, I'm not sure I want to keep that code path but it's pretty straightforward (learning to use SpannableStrings was particularly likely to have future use.) Of course, what I really want is to specify most of it from a downloaded (and cached) file, and I could write all of that in minutes with a reasonably complete python port... perhaps my next experiment should be to produce the java source for a single instance from a descriptor file, using python, just to think through the data structures. Given examples like Pyjamas and java2python, this might not be as complicated as it sounds...

Footnotes:


android: Sat Nov 8 23:55:00 2008

Sat Nov 8 23:55:00 2008

Had the stereotypical "this is what modern phones are for" experience today... pasta was suggested for dinner, "I passed a new place on the way here..." googled for the name and town, found a menu on a review site, picked a few dishes, tapped the phone number on the page, and dialed the place. It all just worked, from my "phone"...

It's nice to step back from the code every once in a while and see all of it working as a "normal" user...


android: Sat Nov 8 23:07:00 2008

Sat Nov 8 23:07:00 2008

What I'm really missing on the G1 is a todo list as good as the Palm one. QuickNote isn't bad, in terms of allowing scribbling, typing, and checking things off, but it only shows a couple items at once, doesn't have a simple category switch, and doesn't have any sync at all...

A slim Hiveminder client with sync would be great - the hiveminder mobile web interface is doomed to have too much latency, though. I feel a little foolish for not having tried K9 with Hiveminder's IMAP mode, that should be responsive, right?

Footnotes:


android: Sat Nov 8 00:53:00 2008

Sat Nov 8 00:53:00 2008

A bit of a downturn today: I started getting

Plan Required

Your current plan is not compatible with the T-Mobile G1. Please visit T-Mobile.com from your computer, call 611 from your phone, or visit a retail location.

while out of town. The web seems to think this is a new behaviour, though.

I'm still using "Unlimited VPN" service (and a vintage SIM that still identifies it self as "OmniPoint" :-) ... not because it's cheaper, but because

I'll have to give them a call when I'm back in town (I have 802.11 on this trip, too... here I'm getting the "G" icon instead of the "E" one (and I don't generally get the "3" one at all.) I suspect I'll have to upgrade, which is ok if tethered use is still permitted, I may have to get that in writing (the web claims that customer support understands this, though.)

Footnotes:


android: Fri Nov 7 01:36:00 2008

Fri Nov 7 01:36:00 2008

After I clean up MMMRavs a bit, I have a few obvious Android apps to work on:

Of course, what I should really do is see what it would take to get jython (or cpython) working - coding would be so much less tedious either way - but other than some failures during the beta in January, I don't see anything about it...

Footnotes:


android: Tue Nov 4 01:16:00 2008

Tue Nov 4 01:16:00 2008

A handful of third party apps have caught my attention so far:

No links to these because I can't find a real web interface to the android market store - just a pageable showcase... not, say, an RSS feed I could use to tell me when a PDF reader, IRC client, or Jabber client shows up (or an RSS reader :-) I suppose I could use adb to pull over the apk files and parse them for upstream locations...

Footnotes:


android: Tue Nov 4 00:33:00 2008

Tue Nov 4 00:33:00 2008

One of the big points of Android as an off-the-shelf phone platform is that it starts out with a bunch of Google services:

The problem is that while gmail is actually Quite Good, the rest of them are only interesting in that they sync at all - the web side of Google Contacts doesn't even have basic things like merge, let alone custom fields (not that "last updated" should need to be custom...) The phone-side workflow isn't bad - a friend phoned, and afterwards I was able to press-and-hold the phone number in the dialer, scan through the suggested contacts to their "I got mail from you" address, and paste the phone number in - that worked quite smoothly and intuitively. (Of course, if GSM provided caller name instead of just number, like landline based Caller ID does, I wouldn't have even had to do that...)

As for Google Calendar, the UI, even the page layout is entirely outdone by Zimbra or 30boxes. I'd forgive that give the tight integration with google mail - except that I just had it suggest a precise date for an unambiguously phrased appointment mail that was off by an entire week! You wouldn't know to look at it that time parsing in english text was pretty much nailed down in 2002 as part of the TERQAS effort... and that even if you have hard-to-resolve ambiguity, you've got a user pressing a button right in front of you, present it to them!

Having picked up a few screenfuls of websites in my on-phone bookmarks list, I'm ready to organize those too, somehow. Too bad Google Browser Sync was discontinued just this past June, and "Google Bookmarks" is only part of iGoogle. (Of course, it's just a matter of digging through code, I actually expect that one to be fixed soon, or perhaps I'll get to it myself, at least as far as actually backing them up...)

The basics are there, anyhow, and there's no shortage of opportunity for improvement...

Footnotes:


android: Sun Nov 2 01:36:00 2008

Sun Nov 2 01:36:00 2008

Picked up an Android G1 last week. Spent more time than I should have angsting about Google Contacts, ended up cleaning up the SIM in the 6630 and pushing some of the more recent contacts back into it, then pulling that over.

I used to carry a Palm TX (last interesting PDA in a line that goes back to picking up a Palm 5000 at Fry's) and I think the G1 is a big improvement over that:

The TX wins on a few things:

update http://www.expansys-usa.com shows a G1 cradle available for order but not directly in stock...

The phone I used to carry is the Nokia 6630. The critical problem that led to the upgrade is that it's old enough to not have an 850mhz band radio so I have a lot less coverage than I really need, especially on New England road trips. Otherwise, the 6630 actually has some advantages over the G1:

The G1 has some specific advantages over the 6630 as a phone:

Note that I didn't mention 3G - first, the 6630 was one of the earliest "3g" (euro band only) phones anyway - second, I leave the G1 in 2g-only mode, because I live right where 3G service runs out - a block west of here, coverage (on t-mobile's own maps) vanishes completely, so actually doing 3G isn't really a benefit...

All told I'm happy with the G1 as both a new phone and a new PDA. Conveniently they fit in the same pocket :-) My only complaint in that regard is battery life (and it still lasts the day - but if the phone is to be believed, it does so only barely.)

(Next up: advantages of the combined device, google-syncing, and development...)