Tuesday, 26 April 2011

Using Android widgets

When implemented correctly Android widgets can be very useful to users. Widgets should provide one or more of the following functionalities:
  • Deep link to application functionality.
  • Display relevant and current information to users without them having to open the application.
  • Provide direct controls to app or phone properties.
Widgets should not be just glorified app launcher icons!

Deep linking to app functionality

Google Buzz widget and Evernote's widget are great examples of deep linking into app functionality and hence providing users fast access to the most used features.



Display relevant info

Google reader, weather and öffi stations widgets are good examples of widgets that show current information. Note that widgets cannot automatically update their data more often than every 30 minutes. In many cases that is enough but sometimes more current information is required.

In case of Google reader or weather widget tapping the widget will open corresponding view in the application ie. tapping a Google reader item will open the news item. In the Öffi stations that isn't the case however. The widget displays next public transportation departures from the nearest station. The data needs to be much more current than half hour. The developer has solved the refreshing interval issue by making user tap to refresh the data.





Twitter, Facebook both combine a functionality deep link (post a new status message) with displaying items on user's feed. Foursquare on the other hand separates functional and information widget into two separate widgets.

Note also how all of these widgets have similar left and right arrow for cycling though pages of updates. This seems to be very well established pattern.




Provide system toggles

Flashlight app's widget is extremely simple but one of the most useful widgets I have on my phone. Tapping it turns on the phone's camera flash.

Android's default power control widget is another simple widget that provides direct control to system property toggles like wifi and bluetooth.





3rd party launchers & extended widget APIs

SPB 3D Shell implements their own widgets s part of the home screen replacement. These widgets are seamlessly integrated  and don't have the same limits than normal Android widgets. SPB doesn't have an open API for 3rd party developers yet though.

Some other home screen replacements have APIs for developers. Widgets build against these APIs won't be usable by most of Android users as they require installation of the corresponding home screen replacement first.




4 comments:

  1. I'm curious what do you think of shortcuts function? I see great potential in making shortcuts on home screen to specified (typically most used) category/collection/item, but sadly only few applications utilize it.

    ReplyDelete
  2. pl1987,
    I think the shortcuts are underused but for a reason. It is a feature that is difficult to understand and find. Personally, I use shortcuts for Google Music play lists and Aldiko books but not really for anything else.

    It would be great if apps would support adding shortcuts inside the app (I haven't looked into technical side of this to see it it is possible or not). Ie. for example Google Music could add an option to the play lists quick action "add shortcut to desktop".

    ReplyDelete
  3. To provide few useful existing shortcuts examples:
    - shortcut to specific directory (ES File Explorer)
    - shortcut to specific account inbox (K9Mail)
    - shortcut to specific note (Springpad ~ like Evernote)
    Some more I dream about:
    - shortut to specific bus stop timetable (I travel by bus everyday)

    What is more, there are 2 ways of providing shortcut function:
    - direct action in application UI that will programatically add shortcut to your homescreen
    - "register a shortcut provider" (at least that's how it looks like, haven't looked into technical, probably by special intent filter). End user will be able to create shortcut the same way he adds normal shortcut to app to his homescreen (at least that is true for HTCSense and ADW Launcher)

    ReplyDelete
  4. Lawrence D'Oliveiro19 December 2011 at 20:27

    pl1987 is right. It is very easy to create shortcuts either way—by an in-app action, or by hooking into the standard Launcher create-shortcut activity.

    I have published some sample code illustrating the latter option here:

    https://github.com/ldo/ShortcutCircus_Android

    ReplyDelete