Friday, December 17, 2010

Emulating... Emulating...

 If you're neither a) fabulously wealthy or b) a terrific shoplifter, at some point you have to use the emulator to test out things on different device sizes. Great.

the AVD Manager lets you create a bunch of virtual devices that you can test your app on. There are built in device targets with self-explanatory names such as QVGA, HVGA and WQVGA. yuck. I prefer a more readable nomenclature:


so for example, an AVD named "low-small-240-320"  is a low-density (120 dpi), small-resolution device that is 240 x 320 pixels. I created a bunch of thest, and just went to town, running my app on each.

Now an app can look great all blown up in the Android emulator with default settings, but how would it look in the real device in your hand? Fortunately the emulator lets you scale to the real device size- you simply have to know 1) your monitor's size, 2) your monitor's current resolution, and 3) your device's diagonal length. For example I have a 15.6" monitor set at 1366x768, and my device is a Samsung Moment (old, I know... see shoplifter/millionaire comment) with a 3.2 inch diagonal screen. Add those settings to the AVD parameters, and you are good to go.

Side note... your desktop monitor is probably further away from your face than your device will be. Before
you pre-judge your app's fonts in the emulator as too small, lean in a bit :-)

Finally, I recommend you test your app in both portrait AND landscape mode: while running the app, enter Ctrl-Fn-F11 to switch to landscape. You might be (un)pleasantly suprised:

aargh... was so perfect before. Now get back to work and fix your app.

Tuesday, November 23, 2010

Screenshots of SweepDodger

If you're at a hotel and you want to sleep in, you can hang a "Do Not Disturb" or "No Moleste" sign on the doorknob so you won't be disturbed. Unfortunately your car's not so lucky, especially in San Francisco. When the street sweeper comes, ready or not your car gets a citation.

So, many citations and $ later, I created SweepDodger, an Android app that combines GPS and the street sweeping schedule (provided by DataSF)  to set a countdown till when your car turns into a free dinner for two city workers:

Start: Click the Location button or type in an address.
Also select a Curb: L(eft) or R(ight). Which curb? Stand
facing the direction where address numbers are
increasing, then indicate which curb you are parked on.
Next, press the 'Park Here Now' button. SweepDodger
calculates the days, hours and minutes till the next
sweeper comes and swipes your money. You can also
map your location with the Map button on the right.
Notice it calculates 1st and 3rd of the month exceptions,
usually a pain to figure out when parking @ 1 in the morn.
Finally when the time elapses, SweepDodger will set off
an alarm and warn you that you're about to get pinched.
You can set a warning to happen at some preset time
before the actual sweep time. Yay!