But that's not how it works in 2.3.x.

Install the "App (Widget)", say from market. Don't run it when given
the "Open" option in the market after download completes. Don't launch
it from the Launcher either. Just navigate back to the Home Screen.

Long press on home screen and select Widgets. Hey presto, it's there!
No need to "launch" the App for it to be available as a Widget. The
Android install process parses the manifest and places the new widget
in the list of available Widgets without having to be "launched"
first.

And while you need to have the configuration Activity in the manifest
and the widget config file, that Activity does not have to do anything
at all really, you can just return RESULT_OKAY and handle the widget
configuration in your WidgetProvider onEnabled() and onUpdate() when
you get the APPWIDGET_xxx Intents. Has that changed in 3.0+? Am I
missing something here?

As I said before, this approach handles the bad use-cases that Android
does not handle cleanly.

On Feb 3, 9:01 pm, Mark Murphy <[email protected]> wrote:
> On Thu, Feb 2, 2012 at 8:53 PM,DavidRoss<[email protected]> wrote:
> > The Activity WidgetDummyConfiguration is called when the APK has been
> > downloaded from the market and run.
>
> I sure hope not. Nothing is supposed to run in an APK file when it
> "has been downloaded from the market and run". Certainly not the
> MAIN/LAUNCHER activity. You are welcome to provide source code to a
> sample project that demonstrates this effect.
>
> > I guess what you mean is that the system must first run the invisible
> > do-nothing activity of .WidgetDummyInstall in order for the manifest
> > contents to be registered with the system which then means the Widget
> > will be entered into the list of available Widgets?
>
> No, I mean that the user must tap on your WidgetDummyConfiguration
> icon in the launcher so that "the Widget will be entered into the list
> of available Widgets".
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to *Advanced* Android Development_ Version 2.4
> Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to