Wednesday, April 7, 2010

Android Widgets, the Lowest Common Denominator

I should be nicer, modern smartphones are meant to be intuitive and user friendly, but they're more powerful than ever and with that comes complexities. As such, some people just don't know how to use an Android widget. They see them, they may have even used them before, but they don't know how to use yours.

What am I talking about? If you've written a Widget only application for Android, you may have encountered some baffling negative feedback; users complaining that the application just doesn't work. In their defense, it might not entirely work. After downloading an application from the Market, the user may encounter an installation complete screen with a button to launch the newly downloaded application. In the latest versions of Android, if there's not an Activity defined to handle the MAIN intent, the button is grayed out. But in older versions, I've confirmed 1.5, that button is not grayed out. When the user clicks the button, an error is displayed.

Another way the user may encounter the same problem is from the notifications area. A notification is made indicating that the application installed successfully. When tapping on this notification the application is launched. Again, without a main activity, on older versions of Android, this will result in an error.

It may seem obvious to you that you've developed an application, and the user should add it to their home screen by pressing 'Menu' from the home screen and following the menus to add a widget. Unfortunately, it's not obvious to everyone. So here's the easy work-around. Create a basic layout with just a TextView. Fill the TextView with some instructions as to how a user should add the widget to their home screen. Extend Activity and create a dumb Activity class that sets the content view to the instruction layout. Finally, register this new Activity in your AndroidManifest as the consumer of the MAIN intent.

Instead of encountering an error, the user is confronted with obvious, yet helpful instructions. Hopefully you'll encounter a happier commenter as the result of these simple changes.

Thursday, April 1, 2010

San Francisco, CA Muni Bus Locator

The Muni Bus Locator allows you to stay inside until the bus is outside. Select a route, and the route, buses, and stops are drawn on an interactive map. Click a bus to see it's speed and status. Zoom in to see individual stops. Select a stop to see the predicted next arrivals. Press the menu button to select another route, or change map mode mode from Map to Satellite.

Search the Market for: Muni Locator

Or... Click/Scan the QR code below: