In android 4.2, there is a new callback called onWidgetOptionChanged() in which a bundle containing the widget size information is passed back. http://developer.android.com/guide/topics/appwidgets/index.html#AppWidgetProvider
My question is, how do we get the widget size prior to android 4.2?
I need to set a picture to an ImageView in the widget but I need to know the size of the ImageView / Widget to scale the picture accordingly.
Also, the layout used for the widget changes depending on its size. Without onWidgetOptionChanged(), how does one know when to use a different layout depending on the size of the widget?
I'm afraid that you cannot get current widget size on android before 4.2. Only preconfigured widget size through android.appwidget.AppWidgetManager#getAppWidgetInfo
.