0

I am trying to download an xml file a server that requires basic authentication on android. Someone please help as i need to get this done today. I have tried multiple ways but none of them works.

I have tried the async method from this tutorial here Download a file with Android, and showing the progress in a ProgressDialog

it gives me a 404 error and am sure the url works fine because me chrome browser can download the xml file fine

Community
  • 1
  • 1
Pheonix
  • 23
  • 5
  • 1
    I like using okhttp for android. Here are some links to get you started: http://square.github.io/okhttp/ use Credentials class to set your basic auth headers http://square.github.io/okhttp/3.x/okhttp/okhttp3/Credentials.html – SeanKelleyx Aug 07 '16 at 14:35
  • Thanks for your response but can post an example code please. I have looked at it but i don't think it works – Pheonix Aug 07 '16 at 14:40
  • Why don't you post what you've tried so far that isn't working and we can see what your problem is. OkHttp has some recipes (code examples) here https://github.com/square/okhttp/wiki/Recipes – SeanKelleyx Aug 07 '16 at 17:01
  • I have edited it to show what i have tried – Pheonix Aug 07 '16 at 18:11

0 Answers0