Wiki for HOW TO create a scrollable widget.

221 views
Skip to first unread message

Koxx

unread,
Jun 10, 2010, 11:03:16 AM6/10/10
to android-appwidget-extensions
Hi,

Ander and me would like to create a wiki to teach users about
scrollable widget creation.
Any prefered place for this ?

Koxx

unread,
Jun 10, 2010, 5:42:00 PM6/10/10
to android-appwidget-extensions
I think the best place is the Launcher+ Google code page because it
will stay the base project page.

So I create pages :

- How to make your own Home with scrollable and animated widgets
http://code.google.com/p/android-launcher-plus/wiki/HowToHome

- How to make your own Widget with scrollable and animated support
http://code.google.com/p/android-launcher-plus/wiki/HowToWidget

- List of alternative Home support
http://code.google.com/p/android-launcher-plus/wiki/HomeSupport

I hope everybody have write permissions to complete those pages !

Koxx

unread,
Jun 10, 2010, 5:45:25 PM6/10/10
to android-appwidget-extensions
Nop, nobody have write access :(

Finally, may be not the best place :(

any other idea ?


On 10 juin, 23:42, Koxx <kox...@gmail.com> wrote:
> I think the best place is the Launcher+ Google code page because it
> will stay the base project page.
>
> So I create pages :
>
> - How to make your own Home with scrollable and animated widgetshttp://code.google.com/p/android-launcher-plus/wiki/HowToHome
>
> - How to make your own Widget with scrollable and animated supporthttp://code.google.com/p/android-launcher-plus/wiki/HowToWidget
>
> - List of alternative Home supporthttp://code.google.com/p/android-launcher-plus/wiki/HomeSupport

Inermis

unread,
Jun 22, 2010, 7:27:02 AM6/22/10
to android-appwidget-extensions
Hi!

I am missing scrolling widgets like those from HTC Sense on my phone.
Recently I have decided to spend some time and wrote one. Then I find
out that is not so simple because of stock home/launcher does not
support this. I think this initiative to do this framework across many
custom launchers apps is superb.

I would like to see that HowTo make a scrollable widget page -
done :)
It would be great if it will also target newbie android developers
like me. (just installed SDK and did Hello world).

Regards
Inermis

On 10 Cze, 23:42, Koxx <kox...@gmail.com> wrote:
> I think the best place is the Launcher+ Google code page because it
> will stay the base project page.
>
> So I create pages :
>
> - How to make your own Home with scrollable and animated widgetshttp://code.google.com/p/android-launcher-plus/wiki/HowToHome
>
> - How to make your own Widget with scrollable and animated supporthttp://code.google.com/p/android-launcher-plus/wiki/HowToWidget
>
> - List of alternative Home supporthttp://code.google.com/p/android-launcher-plus/wiki/HomeSupport

Francois DESLANDES

unread,
Jun 22, 2010, 7:59:12 AM6/22/10
to android-appwid...@googlegroups.com
Hi,

I already published a very simple example here :
http://code.google.com/p/simplescrollablewidget/

I know that we should publish a How To, but I don't have so much time for this :(
And Launcher devs doesn't seems to have time too.

I you want to write something, I'll be very happy to publish it.
I really think if you start from my simple code sample, you should be able to do something in 5h.

ciao,
Francois


2010/6/22 Inermis <iner...@gmail.com>

Francois DESLANDES

unread,
Jun 22, 2010, 8:00:05 AM6/22/10
to android-appwid...@googlegroups.com
If you send me your email, I can allow you as publisher.


2010/6/22 Francois DESLANDES <kox...@gmail.com>

Adam Becker

unread,
Jun 30, 2010, 11:28:34 PM6/30/10
to android-appwidget-extensions
Francois,
I tried running the example code you posted on here - it runs fine in
ADW but LauncherPro will not run it. The AppWidget will come up but
it stays blank and the listview does not display. Running the same
version of LauncherPro, however, PureCalendar will work just fine
(with scrolling.) Any thoughts or recommendations?

Thanks,
Adam

On Jun 22, 4:59 am, Francois DESLANDES <kox...@gmail.com> wrote:
> Hi,
>
> I already published a very simple example here :http://code.google.com/p/simplescrollablewidget/
>
> I know that we should publish a How To, but I don't have so much time for
> this :(
> And Launcher devs doesn't seems to have time too.
>
> I you want to write something, I'll be very happy to publish it.
> I really think if you start from my simple code sample, you should be able
> to do something in 5h.
>
> ciao,
> Francois
>
> 2010/6/22 Inermis <inerm...@gmail.com>

Adam Becker

unread,
Jul 1, 2010, 9:19:58 PM7/1/10
to android-appwidget-extensions
It looks like the ACTION_READY intent is not sent. What is
PureCalendar doing different to get the ACTION_READY intent to be sent
to it?

Koxx

unread,
Jul 2, 2010, 3:43:12 AM7/2/10
to android-appwidget-extensions
ACTION_READY is normally always sent to every widget by the Launcher
after each Launcher redraw (after a screen rotation or widget
insertion for example).

Be sure that 'scrollable widgets' is enable in your Launcher settings.

If you really don't manage to get it, I advise you to look at the code
of Launcher+ or ADW.

Koxx

unread,
Jul 2, 2010, 3:44:36 AM7/2/10
to android-appwidget-extensions
I advise you to send an ACTION_SCROLL_WIDGET_START when you finish the
widget configuration.

Adam Becker

unread,
Jul 2, 2010, 3:33:56 PM7/2/10
to android-appwidget-extensions
I tried that (in a round about way.) and it seems to have done the
trick. Thanks

Francois DESLANDES

unread,
Jul 2, 2010, 5:15:50 PM7/2/10
to android-appwid...@googlegroups.com
Good !

2010/7/2 Adam Becker <ajbe...@gmail.com>

Florian Sundermann

unread,
Jul 18, 2010, 6:20:30 AM7/18/10
to android-appwidget-extensions
If anyone need another code sample here is my opensource widget.
Thx everyone for the samples

http://code.google.com/p/scrollablecontacts/

Regards
Florian

Koxx

unread,
Jul 20, 2010, 6:07:24 PM7/20/10
to android-appwidget-extensions
Thanks for this new good code sample :p

Stephen

unread,
Aug 11, 2010, 10:21:45 PM8/11/10
to android-appwidget-extensions
Hi and thanks for the great code samples.

I'll admit as a beginner this has been pretty vague, but I have
managed to implement my own scrollable widget.

The only question or should I say problem I have is :

How do you requery your dataprovider so that the listview will be
rebuilt with the new data? i.e. onclick of a button?

I have tried recalling the ListeViewManager.onAppWidgetReady() method
which creates the ACTION_SCROLL_WIDGET_START but I never see the
DataProvider queried again.

I have set my ACTION_SCROLL_WIDGET_START intent Extras to allow
requerying since the cursor I'm returning is an SQLDatabase cursor, as
per the LauncherIntent.java class commenting.

/**
* Allow or not contentProvider requery
* - disable requery for simple MatrixCursor (not handled
by Android)
* - enable requery for SQL database Cursor
*/
public static final String
EXTRA_DATA_PROVIDER_ALLOW_REQUERY = PNAME
+ "EXTRA_DATA_PROVIDER_ALLOW_REQUERY";


So I'm at a loss :(

Florian Sundermann

unread,
Aug 12, 2010, 1:30:20 AM8/12/10
to android-appwidget-extensions
HI,

here's a sample to requery data from my ContactWidget:

public static void notifyDatabaseModification(int widgetId)
{
Uri widgetUri =
CONTENT_URI_MESSAGES.buildUpon().appendEncodedPath(Integer.toString(widgetId)).build();
Log.d(TAG, "notifyDatabaseModification -> UPDATE
widgetUri : " + widgetUri);
ctx.getContentResolver().notifyChange(widgetUri,
null);
}

Regards
Florian

Stephen

unread,
Aug 12, 2010, 11:21:23 PM8/12/10
to android-appwidget-extensions
Hi Florian,

Thankyou for a quick response.

I actually discovered that late last night after trying to compare how
your widget could automatically update and mine couldn't.

I really should have read up on ContentObservers and ContentResolvers
and not just ContentProviders.

My widget is now successfully updating thankyou.

I did notice one funny thing that I couldn't find a solution for from
your example.

It's my understanding that after the ACTION_SCROLL_WIDGET_START is
sent to the Home Launcher (ADW,LP,HPP) , the Home Launcher is
responsible for creating and registering a ContentResolver which
resolves back to my DataProvider.

I've found that the ContentResolver connects to my DataProvider and
everything works the first time I run my app. If I delete the widget
and recreate it the Home Launcher's ContentResolver doesn't find my
DataProvider???

This is the only hurdle I have left.

I really appreciate your help guys :)

Regards,

Steve.

On Aug 12, 3:30 pm, Florian Sundermann <boombu...@googlemail.com>
wrote:

Stephen

unread,
Aug 13, 2010, 12:37:29 AM8/13/10
to android-appwidget-extensions
Solved, but thanks anyway.

I had done something silly in my ListViewManager class.

When I was putting Extra content into my ACTION_SCROLL_WIDGET_START I
forget to append the appwidget Id to make for a unique intent.

Because I hadn't the intent would go out initially and then the second
time around I guess Android OS didn't send it since it was identical
to the one my previous instance of the widget had sent out earlier.

Correct me if I'm wrong as this is all new to me.

Thanks again! I'm scrolling AND updating now!!! WHOOHOO

Next is animation then lookout HTC Sense UI!!!

Stephen

unread,
Aug 13, 2010, 1:37:11 AM8/13/10
to android-appwidget-extensions
Not to keep spamming this discussion I thought I'd offer a link where
I've documented a little on my experience. Nearly like a guide.

http://gadgetsaddicts.blogspot.com/2010/08/android-scrollable-widgets.html

Thanks again to all those who made this possible! :)

Regards,

Steve.

Florian Sundermann

unread,
Sep 13, 2010, 1:44:33 AM9/13/10
to android-appwidget-extensions
Hi @ all

I've updated my scrollable contact widget to use the new API so if
anyone is interested in a sample there it is ;)

Regards
Florian

Paul Ishenin

unread,
Sep 13, 2010, 2:58:17 AM9/13/10
to android-appwidget-extensions
On 13 сен, 13:44, Florian Sundermann <boombu...@googlemail.com> wrote:

> I've updated my scrollable contact widget to use the new API so if
> anyone is interested in a sample there it is ;)

I made a scrollable widget too used your code as a reference:
http://code.google.com/p/stockswidget/

Adam Becker

unread,
Dec 17, 2010, 4:32:37 PM12/17/10
to android-appwid...@googlegroups.com
Steve,
It looks like your link is dead.  Any update?
-Adam

Stephen

unread,
Jan 24, 2011, 10:25:26 PM1/24/11
to android-appwidget-extensions
Sorry for the late reply Adam,

I changed urls to http://www.geekrono.com/2010/08/android-scrollable-widgets.html

Regards,

Steve
Reply all
Reply to author
Forward
0 new messages