There's actually another way to do it, that GEOS and webOS's Enyo framework did. Actually, even Windows Mobile's implementation of .NET did this to an extent, IIRC. Android half-asses it, but it at least tries - there's separate phone and tablet UIs in the same application.
Don't let programs draw their UI, make them give a list of tasks to the OS, and make the OS draw the UI that's appropriate for the device you're on. (GEOS, at least, had hinting of sorts, IIRC, to note the priority of tasks.)
Use the same binary across all devices.
So, on a phone, you get a simple UI that lets you do stuff that's appropriate for doing on a phone.
On a tablet, you get a more fully fleshed UI, but still touch-friendly.
On a desktop, you get a full desktop UI.
The added benefit of this is, the UI can never be inconsistent with system standards.