Android: Is there a way to get the size of a RemoteViews object? Android: Is there a way to get the size of a RemoteViews object? android android

Android: Is there a way to get the size of a RemoteViews object?


The app widget meta data XML file determines the overall size of your widget; you must design your layouts with that size in mind. If you are implementing multiple size widgets, you will need a separate meta data and layout for each one.

The app widget system uses an abstract "grid units" that you can turn into DP, see this page for details. If you set the size incorrectly, it will just "truncate" to the nearest grid size on your behalf (and your layout will look "bad").

Android 3 and 4 give you more possibility for sizing.