gedeon555 Posted November 19, 2009 Share Posted November 19, 2009 Bonjour, est ce qu'il existe une méthode ou un outil pour télécharger un fichier via une url. Sur certaines applications dont le market, le téléchargement se fait en arrière plan, ne bloque pas l'application est la progression s'affiche dans la zone de notification. L'idéal serait d'avoir ceci. Quote Link to comment Share on other sites More sharing options...
johndoe Posted November 19, 2009 Share Posted November 19, 2009 y a exactement ce que tu cherche ici : http://fr.androlib.com/android.application.com-castillo-dd-xjmF.aspx?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+AndrolibFR+%28AndroLib+%3A+Toutes+les+nouveaut%C3%A9s%29 Quote Link to comment Share on other sites More sharing options...
gedeon555 Posted November 19, 2009 Author Share Posted November 19, 2009 le mieux serait que j'ai pas à imposer à l'utilisateur d'installer une autre application. Je pensais que le téléchargement de fichier était déjà inclus dans le sdk Quote Link to comment Share on other sites More sharing options...
gedeon555 Posted November 19, 2009 Author Share Posted November 19, 2009 pour l'instant j'arrive à télécharger un fichier avec CttpClient, HttpResponse, HttpPost ... Seulement j'ai systématiquement ce message d'erreur dans les logs : W/SingleClientConnManager( 1002): Invalid use of SingleClientConnManager: connection still allocated. W/SingleClientConnManager( 1002): Make sure to release the connection before allocating another one. Quote Link to comment Share on other sites More sharing options...
neoakira Posted December 26, 2009 Share Posted December 26, 2009 (edited) gedeon555, t'as trouvé une solution pour éviter : W/SingleClientConnManager( 1002): Invalid use of SingleClientConnManager: connection still allocated. W/SingleClientConnManager( 1002): Make sure to release the connection before allocating another one. ? Edited December 26, 2009 by neoakira Quote Link to comment Share on other sites More sharing options...
Kricek Posted September 17, 2010 Share Posted September 17, 2010 (edited) J'ai peut être un petit quelque chose qui pourrait vous intéresser... public Bitmap getImage(String adresse) { BitmapFactory.Options bmOptions; bmOptions = new BitmapFactory.Options(); bmOptions.inSampleSize = 1; InputStream in = null; Bitmap bm = null; try { URL url = new URL(adresse); URLConnection conn = url.openConnection(); HttpURLConnection httpConn = (HttpURLConnection)conn; httpConn.setRequestMethod("GET"); httpConn.connect(); if (httpConn.getResponseCode() == HttpURLConnection.HTTP_OK) { in = httpConn.getInputStream(); } bm = BitmapFactory.decodeStream(in, null, bmOptions); in.close(); } catch (IOException e1) { } return bm; } Sachant que là, c'est pour des Bitmaps... On peut toujours le modifier à sa sauce... Edit : Woups... J'avais pas vu la date... désolé pour le déterrage... lol Edited September 17, 2010 by Kricek Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.