2

My Android app has a android:minSdkVersion="8" which I want to keep, but at the same time, for users running Android 3.0 and above, I want to create a widget backed up by a collection.

Following the steps here http://developer.android.com/guide/topics/appwidgets/index.html#collections I run into a compilation error, because I need to use classes from API level 11 (RemoteViewsService).

So is there a way to do this? To keep the app available for people with Android 2.2+ but in it build a widget for people with Android 3.0+? It should be possible. GMail does it, it's available for earlier versions of Android but also provides this kind of widgets for Android 3.0+ users.

Thanks

Ionut Bilica
  • 424
  • 1
  • 5
  • 11
  • Set targetSdk="11", minSdk="8". But then you should test the application on Android 2.2 more carefully, because there will not be any compile-time checking. – vortexwolf Dec 28 '12 at 21:08

1 Answers1

0

I think perhaps the following answer on SO can provide some insight:

Android Min SDK Version vs. Target SDK Version

In essence, you have two variables you can define: Min SDK and Target SDK. The above link will explain in great clarity how to use them.

Community
  • 1
  • 1
cklab
  • 3,761
  • 20
  • 29
  • True, there is an annotation that makes the compilation error go away, **'@TargetApi'** This link explains more: [link]http://tools.android.com/recent/lintapicheck – Ionut Bilica Jan 10 '13 at 12:56