开发者

Scrolling list in Android home screen widget

I am trying to teach myself the basics of Android dev. At th开发者_如何学JAVAe moment I am experimenting with home screen widgets. I would like to create a simple widget that lists all my bookmarks. Somewhere in my googling I read that ListView is not usable in a widget. What's the best way to display a scrolling list in a widget? An example would be fantastic, but otherwise point me in the right general direction and I can research further.

Thanks in advance, Dany.


ListViews are supported in Custom Launchers that support the scrollable-widgets extension or in the Launchers since Android 3.0 (Honeycomb). Take the Android Agenda Widget for example, this supports scrolling in Custom Launchers, or the GMail-widget on Honeycomb.

Scrolling widgets in Custom Launchers is described here: http://www.geekrono.com/2010/08/android-scrollable-widgets.html

Scrolling widgets in Honeycomb and up is described here: http://developer.android.com/guide/topics/appwidgets/index.html#collections

You can finnd the sources for good working example except for Honeycomb at http://code.google.com/p/scrollablecontacts/


I've only seen a huge list widget on phones with HTC Sense - example. HTC Sense has a widget like that for Stocks, Twitter, etc. I don't think it's a good idea to develop huge widgets like that, because they take up too much space and some phones are limited to 3 screens (screens that you can put your app shortcuts, widgets and etc).

This is a good article on Widget UI Patterns: Widget Design Guidelines

Seesmic for Android has a 'list' widget with latest tweets:Seesmic Blog Widget Screen

There's also an article on UI Patterns, based on the new Twitter app, hope that helps you - Link and a video (Android UI design patterns).

Re: user controls (like in .NET), Android Views and in your case 'ListView' is what you might use for your app. You also mentioned .NET (Visual Studio), you might be interested in MOTODEV Studio. It's basically a better version of Eclipse (with Android SDK) that has common code snippets and other cool stuff.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜