3

I'm trying to implement a code with DownloadManager but I have an import error:

 The import android.app.DownloadManager cannot be resolved

Do i have to add anything to the project in order to use this library??

Thank you very much,

Lucía

Lucia
  • 614
  • 1
  • 9
  • 30

1 Answers1

4

DownloadManager exists only since API level 9 (2.3/Gingerbread), do you use 9 or higher ?

Isshun
  • 101
  • 3
  • OOk!I'm using 7!!Thank you very much!I'm going to try with 9! – Lucia Jan 11 '12 at 11:09
  • Be carefull, if you restrain your application to Api level 9, only 2.3/Gingerbread (and higher) user will be able to use it. – Isshun Jan 11 '12 at 11:11
  • But...the import should not work anyway? even if it doesn't works in the emulator afterwards? – Lucia Jan 11 '12 at 11:12
  • It's depend of your build target, in eclipse you can go to project proprieties > android. And no if you use an api level under 9, eclipse won't let you import inexistent class :) – Isshun Jan 11 '12 at 11:19
  • Ok!Do you think I should look other way of downloading files that don't restrain the Api? Or API 9 is not too high? – Lucia Jan 11 '12 at 11:22
  • 1
    You can use http://developer.android.com/reference/android/os/AsyncTask.html to download your file, but have not DownloadManager specificities, like restore on reboot, display in notification bar... – Isshun Jan 11 '12 at 11:38