1

I'm using DragShadowBuilder in my application. http://developer.android.com/reference/android/view/View.DragShadowBuilder.html

In AndroidManifest, I've set the minimum supported API level to 8. However, DragShadowBuilder was introduced with API 11. Eclipse usually warns me when something is below the minimum API level, but it seems fine with me using DragShadowBuilder. Should I be included some support library or something along those lines to ensure that the code runs on older versions of Android?

Fergusmac
  • 3,447
  • 4
  • 18
  • 21

3 Answers3

2

No your code may not run in older version of Android. You may want to write Drag logic of your own using AbsoluteLayout, if at all if you want to achieve drag feature in older versions. Hope it helps

Alex Lockwood
  • 81,274
  • 37
  • 197
  • 245
cutebug
  • 475
  • 4
  • 10
1

I just looked through the published contents of what is in the library and I didn't see anything about DragShadowBuilder. You can check the contents of what's in there at http://developer.android.com/tools/extras/support-library.html

I also looked in the source some and didn't see anything mention about it. How do I attach the Android Support Library source in Eclipse?

If there is no backwards support then you are basically on your own for this. You can also look at the source for DragShadowBuilder and try to recreate that in your application.

Community
  • 1
  • 1
Frank Sposaro
  • 8,203
  • 4
  • 39
  • 63
1

I believe this is a bug with Eclipse. I would suggest that you simply make the minimum supported API level to 11. AFAIK, you could always create it to support API 11 first, and then try to recreate it with a new project and by adding the library you want.

I have tried this and if you were to create a new project, set it to a lower API, import a "Drag and Drop" like library, and try to write the code for it, you will most likely get an error saying that it won't work and/or that the Drag and Drop function is set for API's 11. If you Clean the project after, the error might "disappear" go away but once you try to run the application, it will reappear and say that it can't run with errors.

It is weird even though you have the library embedded with the code. Perhaps you could try renaming the classes and such if the machine can not differentiate which "DragEvent" you are trying to call forth.

Kurty
  • 455
  • 2
  • 16