Selective AppWidgets
<p>I have a app which has 2 widgets, lets call them SimpleWidget and ListWidget.
ListWidget makes use of android 3.1 (api level 12) features.  </p>

<p>What I would like to do is register both widgets if the device is 3.1 or above.
If it is not than I would only want to register SimpleWidget.</p>

<p>As the code stands now the widgets are defined in my app's AndroidManifest.xml file. 
I can't figure out how I could filter this by sdk level. </p>

<p>The only solution I have found so far would still display both widgets (in android's add widget page) even on pre 3.1 devices (in which case I relegate ListWidget to a SimpleWidget).</p>

<p>Am I missing something? </p>

<p>For example can I register widgets in Java code (maybe in the app's onCreate method) instead of in the manifest file? (seems unlikely since the info is needed before the app is ever run).</p>
