Code example for DownloadManager.Request

Methods: setAllowedNetworkTypes, setDescription, setDestinationInExternalPublicDir, setTitle

0
		// (et le cree si il n'existe pas) 
		Environment.getExternalStoragePublicDirectory(
				Environment.DIRECTORY_DOWNLOADS).mkdirs();
 
		// On cree une requete de telechargement 
		Request dr = new DownloadManager.Request(uri);
		dr.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI
				| DownloadManager.Request.NETWORK_MOBILE);
		dr.setTitle("Update facts");
		dr.setDescription("A updated version of the fact list for the Fact widget.");
		dr.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS,
				"factList");			 
		return dr;
	} 
 
	/** 
	 * Enregistre deux broadcast receiver pour le download completion 
	 */ 
	private void registerBroadcastReceivers() { 
		 
		broadcastReceiverRegistered = true;