Issue
I'm still new to android so this is probably a pretty simple question, thanks.
I've build a widget which currently only support android 3.1+ because it's resizable, and I would now like to make it support earlier android versions too. I know I can create a values folder for e.g. android sdk version 14 be naming it values-v14 ( right?). And I just want to know if I can do this for the xml folder containing the appWidgetProvider file as well?
If so:
I was thinking I would have the 2*2, 2*3, 3*3, etc. widgets for earlier android versions then 3.1, and resizable for 3.1+. So to do this would I then just create a default XML folder for the non-resizable and then an XML folder named like XML-v12 including the resizable widget-properties. And then does this folder apply to all newer android version or just sdk v12?
Thank you very much.
Solution
I've build a widget which currently only support android 3.1+ because it's resizable
This is not true. Setting your appwidget to be resizable does not make it incompatible with earlier versions. Android versions below HC will simply ignore this.
If you want to create widgets in different form factors then you have to create an appwidget-provider
XML file, a receiver and a AppWidgetProvider
for each widget.
Of course you can avoid code duplication by creating a base AppWidgetProvider
and then extending that one to add features, width/height or other customizations to it.
Answered By - Ahmad
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.