Code for Download Images in Android . Just path URL of Image and it will download and store in Mobile Phone.
Code :
var url = new Uri("https://dl.dropboxusercontent.com/u/72783403/dharmik.jpg");
var webClient = new WebClient();
webClient.DownloadDataAsync(url);
webClient.DownloadDataCompleted += (sender, e) => {
var bytes = e.Result; // get Data downloaded
string documentPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
string localFileName = "Download.png";
string localpath = Path.Combine(documentPath + localFileName);
Console.WriteLine("Path" + localpath);
File.WriteAllBytes(localpath,bytes);
};
Comments
Post a Comment