Without using a set value in the layout. On my Nexus 5 lockscreen, the widgets resize, and can detect what resolution they're at. I'd love to do that, but right now I have to have the user enter the resolution in themselves to support resizing properly.
I've got the data, but it's in a bundle. I can't figure out how to get the data out of the appWidgetOptions bundle...
StartingIntent.ExtrasToString = Bundle[{appWidgetId=7, appWidgetOptions=Bundle[mParcelledData.dataSize=272]}]
public static final String OPTION_APPWIDGET_MAX_HEIGHT
Added in API level 16
A bundle extra that contains the upper bound on the current width, in dips, of a widget instance.
Constant Value: "appWidgetMaxHeight" public static final String OPTION_APPWIDGET_MAX_WIDTH
Added in API level 16
A bundle extra that contains the upper bound on the current width, in dips, of a widget instance.
If we could get those somehow, that'd be a lot of help.
Dim jintent As JavaObject = StartingIntent
Dim widgetOptions As JavaObject = jintent.RunMethod("getBundleExtra", array As Object("appWidgetOptions"))
Log(widgetOptions.RunMethod("getInt", Array As Object("appWidgetMaxHeight")))
I recommend rewriting the widget guide to include that one guy's instructions for handling multiple widget types in a single program (or including it in the next version of Android) as well as this, cause these are really handy.