I’m making an Android AppWidget to sit on the home screen.
The user’s home screen space is precious, so I want the widget to be small. The ideal size would be 2×1 cells.
- Some documentation suggests you can have any size you like?
- But the AppWidget graphical design guidelines imply that only standard sizes are supported: 4×1, 3×3, 2×2.
- Does that refer to the available PhotoShop templates or is it a limitation of Android itself?
- I’m finding that a 2×1 widget works on my actual device (HTC Wildfire) but expands to 2×2 on the emulator.
- HTC have their own special implementation of the home screen, so maybe my widget will only work at 2×1 on HTC devices?
Is there any way to create a 2×1 widget, or should I use a standard size?
My widget was adapted from the Simple Wiktionary sample.
- The manifest has
android:minWidth="146dip"andandroid:minHeight="72dip". - There’s a RelativeLayout with
android:layout_width="fill_parent"andandroid:layout_height="wrap_content"
I’m just starting with Android, so apologies in advance if this is a silly question. 🙂
It’s definitely not a silly question.
I was under the impression that 2×1 was a legal size, but I have not tried one of that size.
Different home screen implementations might interpret the sizing differently, though I would hope that they would be generally consistent.
You could experiment with smaller
android:minHeightvalues, to see if there is a new threshold you need to convince the emulator to give you a 2×1 app widget. That being said, you may have more consistent results with a 2×2 app widget.