IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Android Discussion :

Problème récupération Flux RSS en Wifi


Sujet :

Android

  1. #1
    Membre à l'essai
    Inscrit en
    Janvier 2011
    Messages
    22
    Détails du profil
    Informations forums :
    Inscription : Janvier 2011
    Messages : 22
    Points : 11
    Points
    11
    Par défaut Problème récupération Flux RSS en Wifi
    Bonjour,

    Je suis en train de développer une application pour les cours ( lecteur de flux rss avec des RSS de sites spécifiques ).

    J'ai réussie à tout faire ( parser xml, mise en cache des images etc ...).

    Mon problème est que en wifi (je n'ai essayé qu'avec min wifi personnel) mon application ne télécharge rien, si je passe en 3G alors cela fonctionne et tout est téléchargé ( image, texte etc ... ).

    j'ai essayé sur l'émulateur qui prend la connection wifi donc, et ça ne télécharge pas les images.

    je ne sais pas si je dois mettre un bout de code pour illustrer du fait que je ne vois pas d'où vient le problème.

    mon application est fait à la base pour Gingerbread 2.3.3.
    mon téléphone de test est un sgs2 sous ics 4.0.3.

    merci d'avance pour votre aide

  2. #2
    Modérateur
    Avatar de Hizin
    Homme Profil pro
    Développeur mobile
    Inscrit en
    Février 2010
    Messages
    2 180
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France

    Informations professionnelles :
    Activité : Développeur mobile

    Informations forums :
    Inscription : Février 2010
    Messages : 2 180
    Points : 5 072
    Points
    5 072
    Par défaut
    Si ton application ne télécharge rien, tu dois avoir une erreur quelque part.
    Que dis le LogCat ?
    C'est Android, PAS Androïd, ou Androïde didiou !
    Le premier est un OS, le second est la mauvaise orthographe du troisième, un mot français désignant un robot à forme humaine.

    Membre du comité contre la phrase "ça marche PAS" en titre et/ou explication de problème.

    N'oubliez pas de consulter les FAQ Android et les cours et tutoriels Android

  3. #3
    Membre régulier
    Homme Profil pro
    Étudiant
    Inscrit en
    Septembre 2011
    Messages
    144
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Septembre 2011
    Messages : 144
    Points : 118
    Points
    118
    Par défaut
    Tu devrais essayer d'utiliser le debugger d'android (vraiment très utile), en mettant des points d'arrêts avec les lignes où tu exécute des requête http. Ça te permettrait de voir ce qui se passe plus en détails.

    Tu peux mettre les bouts de code où tu exécute une requête http sur le forum d'ailleurs.

  4. #4
    Membre à l'essai
    Inscrit en
    Janvier 2011
    Messages
    22
    Détails du profil
    Informations forums :
    Inscription : Janvier 2011
    Messages : 22
    Points : 11
    Points
    11
    Par défaut
    JE viens de tester , en wifi, le LogCat n'affiche rien du tout, l'application reste bloqué sur mon progressDialog comme si l'appli cherchait toujours a lire le flux rss.

    Par contre en 3G le logCat me met :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    05-03 18:43:38.305: D/dalvikvm(27771): GC_FOR_ALLOC freed 47K, 4% free 8856K/9155K, paused 52ms
    05-03 18:43:38.310: I/dalvikvm-heap(27771): Grow heap (frag case) to 9.139MB for 425616-byte allocation
    05-03 18:43:38.360: D/dalvikvm(27771): GC_CONCURRENT freed <1K, 4% free 9271K/9607K, paused 1ms+2ms
    05-03 18:43:38.750: D/CLIPBOARD(27771): Hide Clipboard dialog at Starting input: finished by someone else... !
    05-03 18:43:44.535: D/dalvikvm(27771): GC_CONCURRENT freed 91K, 3% free 9628K/9863K, paused 2ms+2ms

    et tout s'affiche.

    voila le code :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    package com.android.Main;
     
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
     
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
     
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NodeList;
    import org.xml.sax.SAXException;
     
    import android.app.Activity;
    import android.app.ProgressDialog;
    import android.content.Intent;
    import android.os.Bundle;
    import android.os.Handler;
    import android.os.Message;
    import android.os.StrictMode;
    import android.util.Log;
    import android.view.View;
    import android.widget.AdapterView;
    import android.widget.AdapterView.OnItemClickListener;
    import android.widget.ListView;
    import android.widget.Toast;
     
    import com.android.Parser.LazyAdapter;
    import com.android.Parser.XMLParser;
     
    public class Main extends Activity {
    	/** Called when the activity is first created. */
    	// All static variables
    	static String URL = null;
     
    	// XML node keys
     
    	static final String KEY_ITEM_RSS = "item"; // parent node
    	static final String KEY_TITLE_RSS = "title";
    	static final String KEY_DESCRIPTION_RSS = "description";
    	static final String KEY_LINK_RSS = "link";
    	static final String KEY_GUID_RSS = "guid";
    	static final String KEY_PUBDATE_RSS = "pubDate";
     
    	String _param = null;
    	Intent monintent = null;
    	HashMap<String, String> map = null;
    	ListView list = null;
    	LazyAdapter adapter = null;
    	ArrayList<HashMap<String, String>> songsList = null;
    	Element e = null;
    	StrictMode.ThreadPolicy policy = null;
    	XMLParser parser = null;
    	String xml = null;
    	Document doc = null;
    	NodeList nl = null;
    	DocumentBuilder db;
     
    	@Override
    	public void onCreate(Bundle savedInstanceState) {
    		super.onCreate(savedInstanceState);
    		setContentView(R.layout.main);
    		monintent = new Intent(this, Touch.class);
    		policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
    		StrictMode.setThreadPolicy(policy);
     
    		Bundle b = getIntent().getExtras();
    		URL = b.getString("parametres");
     
    		Toast.makeText(this, URL, 10000).show();
    		monintent = new Intent(this, Touch.class);
     
    		songsList = new ArrayList<HashMap<String, String>>();
    		parser = new XMLParser();
    		// String xml = parser.getXmlFromUrl(URL); // getting XML from URL
     
    		DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    		db = null;
    		try {
    			db = dbf.newDocumentBuilder();
    		} catch (ParserConfigurationException e1) {
    			// TODO Auto-generated catch block
    			e1.printStackTrace();
    		}
     
    		dl();
     
    	}
     
    	public void dl() {
    		final ProgressDialog dialog = ProgressDialog.show(this,
    				"téléchargement",
    				"Téléchargement \n , patientez un instant ...", true);
     
     
    		final Handler handler = new Handler() {
    			public void handleMessage(Message msg) {
    				aff();
    				dialog.dismiss();
    			}
    		};
    		Thread checkUpdate = new Thread() {
    			public void run() {
    				do {
    					try {
    						doc = db.parse(URL);
    					} catch (SAXException e1) {
    						// TODO Auto-generated catch block
    						e1.printStackTrace();
    					} catch (IOException e1) {
    						// TODO Auto-generated catch block
    						e1.printStackTrace();
    					}
    				} while (doc == null);
    				handler.sendEmptyMessage(0);
    			}
    		};
    		checkUpdate.start();
    	}
     
    	public void aff() {
    		Log.e("nl ", "sa rentre");
    		if (doc != null) {
    			nl = doc.getElementsByTagName(KEY_ITEM_RSS);
    			// Log.e("nl ", String.valueOf(nl.getLength()));
    			// nl.getLength();
    			for (int i = 0; i < 15; i++) { // nombre d'éléments à afficher
    				// creating new HashMap
    				map = new HashMap<String, String>();
    				e = (Element) nl.item(i);
    				map.put(KEY_TITLE_RSS, parser.getValue(e, KEY_TITLE_RSS));
    				map.put(KEY_DESCRIPTION_RSS,
    						parser.getValue(e, KEY_DESCRIPTION_RSS));
    				map.put(KEY_LINK_RSS, parser.getValue(e, KEY_LINK_RSS));
    				map.put(KEY_PUBDATE_RSS, parser.getValue(e, KEY_PUBDATE_RSS));
    				map.put(KEY_GUID_RSS, parser.getValue(e, KEY_GUID_RSS));
     
    				songsList.add(map);
    			}
    		} else {
    			Log.e("nl ", "doc null");
    		}
     
    		list = (ListView) findViewById(R.id.list);
     
    		// Getting adapter by passing xml data ArrayList
    		adapter = new LazyAdapter(this, songsList);
    		list.setAdapter(adapter);
     
    		list.setOnItemClickListener(new OnItemClickListener() {
     
    			public void onItemClick(AdapterView<?> parent, View view,
    					int position, long id) {
     
    				Pattern p = Pattern.compile("(http://.*.(jpg|png))");
    				Matcher m = p.matcher(songsList.get(position).get(
    						KEY_DESCRIPTION_RSS));
    				if (m.find()) {
    					_param = m.group(1);
    				}
    				monintent.putExtra("parametres", _param);
    				startActivityForResult(monintent, 1000);
    			}
    		});
    	}
    }
    j'ai un ParserXML chopé sur le net :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    package com.android.Parser;
     
    import java.io.IOException;
    import java.io.StringReader;
    import java.io.UnsupportedEncodingException;
     
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
     
    import org.apache.http.HttpEntity;
    import org.apache.http.HttpResponse;
    import org.apache.http.client.ClientProtocolException;
    import org.apache.http.client.methods.HttpPost;
    import org.apache.http.impl.client.DefaultHttpClient;
    import org.apache.http.util.EntityUtils;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
     
    import android.util.Log;
     
    public class XMLParser {
     
    	// constructor
    	public XMLParser() {
     
    	}
     
    	/**
             * Getting XML from URL making HTTP request
             * @param url string
             * */
    	public String getXmlFromUrl(String url) {
    		String xml = null;
     
    		try {
    			// defaultHttpClient
    			DefaultHttpClient httpClient = new DefaultHttpClient();
    			HttpPost httpPost = new HttpPost(url);
     
    			HttpResponse httpResponse = httpClient.execute(httpPost);
    			HttpEntity httpEntity = httpResponse.getEntity();
    			xml = EntityUtils.toString(httpEntity);
     
    		} catch (UnsupportedEncodingException e) {
    			e.printStackTrace();
    		} catch (ClientProtocolException e) {
    			e.printStackTrace();
    		} catch (IOException e) {
    			e.printStackTrace();
    		}
    		// return XML
    		return xml;
    	}
     
    	/**
             * Getting XML DOM element
             * @param XML string
             * */
    	public Document getDomElement(String xml){
    		Document doc = null;
    		DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    		try {
     
    			DocumentBuilder db = dbf.newDocumentBuilder();
     
    			InputSource is = new InputSource();
    		        is.setCharacterStream(new StringReader(xml));
    		        doc = db.parse(is); 
     
    			} catch (ParserConfigurationException e) {
    				Log.e("Error: ", e.getMessage());
    				return null;
    			} catch (SAXException e) {
    				Log.e("Error: ", e.getMessage());
    	            return null;
    			} catch (IOException e) {
    				Log.e("Error: ", e.getMessage());
    				return null;
    			}
     
    	        return doc;
    	}
     
    	/** Getting node value
              * @param elem element
              */
    	 public final String getElementValue( Node elem ) {
    	     Node child;
    	     if( elem != null){
    	         if (elem.hasChildNodes()){
    	             for( child = elem.getFirstChild(); child != null; child = child.getNextSibling() ){
    	                 if( child.getNodeType() == Node.TEXT_NODE  ){
    	                     return child.getNodeValue();
    	                 }
    	             }
    	         }
    	     }
    	     return "";
    	 }
     
    	 /**
              * Getting node value
              * @param Element node
              * @param key string
              * */
    	 public String getValue(Element item, String str) {
    			NodeList n = item.getElementsByTagName(str);
    			return this.getElementValue(n.item(0));
    		}
    }
    après un imageDownlaoder

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
     
    package com.android.Parser;
     
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import java.util.Collections;
    import java.util.Map;
    import java.util.WeakHashMap;
    import java.util.concurrent.ExecutorService;
    import java.util.concurrent.Executors;
     
    import android.app.Activity;
    import android.content.Context;
    import android.graphics.Bitmap;
    import android.graphics.BitmapFactory;
    import android.widget.ImageView;
     
    import com.android.Cache.FileCache;
    import com.android.Cache.MemoryCache;
     
    public class ImageLoader {
     
    	MemoryCache memoryCache = new MemoryCache();
    	FileCache fileCache;
    	private Map<ImageView, String> imageViews = Collections
    			.synchronizedMap(new WeakHashMap<ImageView, String>());
    	ExecutorService executorService;
     
    	public ImageLoader(Context context) {
    		fileCache = new FileCache(context);
    		executorService = Executors.newFixedThreadPool(5);
    	}
     
    	final int stub_id = android.R.drawable.ic_dialog_info;
     
    	public void DisplayImage(String url, ImageView imageView) {
    		imageViews.put(imageView, url);
    		Bitmap bitmap = memoryCache.get(url);
    		if (bitmap != null)
    			imageView.setImageBitmap(bitmap);
    		else {
    			queuePhoto(url, imageView);
    			imageView.setImageResource(stub_id);
    		}
    	}
     
    	private void queuePhoto(String url, ImageView imageView) {
    		PhotoToLoad p = new PhotoToLoad(url, imageView);
    		executorService.submit(new PhotosLoader(p));
    	}
     
    	private Bitmap getBitmap(String url) {
    		File f = fileCache.getFile(url);
     
    		// from SD cache
    		Bitmap b = decodeFile(f);
    		if (b != null)
    			return b;
     
    		// from web
    		try {
    			Bitmap bitmap = null;
    			URL imageUrl = new URL(url);
    			HttpURLConnection conn = (HttpURLConnection) imageUrl
    					.openConnection();
    			conn.setConnectTimeout(30000);
    			conn.setReadTimeout(30000);
    			conn.setInstanceFollowRedirects(true);
    			InputStream is = conn.getInputStream();
    			OutputStream os = new FileOutputStream(f);
    			Utils.CopyStream(is, os);
    			os.close();
    			bitmap = decodeFile(f);
    			return bitmap;
    		} catch (Exception ex) {
    			ex.printStackTrace();
    			return null;
    		}
    	}
     
    	// decodes image and scales it to reduce memory consumption
    	private Bitmap decodeFile(File f) {
    		try {
    			// decode image size
    			BitmapFactory.Options o = new BitmapFactory.Options();
    			o.inJustDecodeBounds = true;
    			BitmapFactory.decodeStream(new FileInputStream(f), null, o);
     
    			// Find the correct scale value. It should be the power of 2.
    			final int REQUIRED_SIZE = 256;// 70
    			int width_tmp = o.outWidth, height_tmp = o.outHeight;
    			int scale = 1;
    			while (true) {
    				if (width_tmp / 2 < REQUIRED_SIZE
    						|| height_tmp / 2 < REQUIRED_SIZE)
    					break;
    				width_tmp /= 2;
    				height_tmp /= 2;
    				scale *= 2;
    			}
     
    			// decode with inSampleSize
    			BitmapFactory.Options o2 = new BitmapFactory.Options();
    			o2.inSampleSize = scale;
    			return BitmapFactory.decodeStream(new FileInputStream(f), null, o2);
    		} catch (FileNotFoundException e) {
    		}
    		return null;
    	}
     
    	// Task for the queue
    	private class PhotoToLoad {
    		public String url;
    		public ImageView imageView;
     
    		public PhotoToLoad(String u, ImageView i) {
    			url = u;
    			imageView = i;
    		}
    	}
     
    	class PhotosLoader implements Runnable {
    		PhotoToLoad photoToLoad;
     
    		PhotosLoader(PhotoToLoad photoToLoad) {
    			this.photoToLoad = photoToLoad;
    		}
     
    		public void run() {
    			if (imageViewReused(photoToLoad))
    				return;
    			Bitmap bmp = getBitmap(photoToLoad.url);
    			memoryCache.put(photoToLoad.url, bmp);
    			if (imageViewReused(photoToLoad))
    				return;
    			BitmapDisplayer bd = new BitmapDisplayer(bmp, photoToLoad);
    			Activity a = (Activity) photoToLoad.imageView.getContext();
    			a.runOnUiThread(bd);
    		}
    	}
     
    	boolean imageViewReused(PhotoToLoad photoToLoad) {
    		String tag = imageViews.get(photoToLoad.imageView);
    		if (tag == null || !tag.equals(photoToLoad.url))
    			return true;
    		return false;
    	}
     
    	// Used to display bitmap in the UI thread
    	class BitmapDisplayer implements Runnable {
    		Bitmap bitmap;
    		PhotoToLoad photoToLoad;
     
    		public BitmapDisplayer(Bitmap b, PhotoToLoad p) {
    			bitmap = b;
    			photoToLoad = p;
    		}
     
    		public void run() {
    			if (imageViewReused(photoToLoad))
    				return;
    			if (bitmap != null)
    				photoToLoad.imageView.setImageBitmap(bitmap);
    			else
    				photoToLoad.imageView.setImageResource(stub_id);
    		}
    	}
     
    	public void clearCache() {
    		memoryCache.clear();
    		fileCache.clear();
    	}
     
    }
    Voila merci d'avance

  5. #5
    Expert éminent

    Homme Profil pro
    Ingénieur systèmes et réseaux
    Inscrit en
    Février 2007
    Messages
    4 253
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Ingénieur systèmes et réseaux
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Février 2007
    Messages : 4 253
    Points : 7 618
    Points
    7 618
    Billets dans le blog
    3
    Par défaut
    Faut arrêter avec ca:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
    		StrictMode.setThreadPolicy(policy);
    Si Google s'embete à mettre en place des vérifications, c'est pas pour qu'on les supprime afin de pouvoir programmer moche ! D'autant que le reste du code à l'air correct (les appels internet sont dans un thread !)...

    Sinon essayes de mettre des Log.i() Log.d() etc...
    Tu auras quand même plus d'informations dans le LogCat (car celui qui tu as mis ne concerne en rien ton application).
    N'oubliez pas de cliquer sur mais aussi sur si un commentaire vous a été utile !
    Et surtout

  6. #6
    Membre à l'essai
    Inscrit en
    Janvier 2011
    Messages
    22
    Détails du profil
    Informations forums :
    Inscription : Janvier 2011
    Messages : 22
    Points : 11
    Points
    11
    Par défaut
    pas d'inquiétude

    cela :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
    		StrictMode.setThreadPolicy(policy);
    ne fait plus parti de mon code et je sais qu'il en faut pas le laisser, j'ai juste oublié de les enlever.

    je vais réessayer avec les différent Log ce soir.

    hier j'ai refait l'application qui me servait d'exemple et trouvé sur le net, la seule différence était ces codes qui n'y était pas :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
     
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    		db = null;
    		try {
    			db = dbf.newDocumentBuilder();
    		} catch (ParserConfigurationException e1) {
    			// TODO Auto-generated catch block
    			e1.printStackTrace();
    		}
    et

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
    try {
    	doc = db.parse(URL);
    	} catch (SAXException e1) {
    		// TODO Auto-generated catch block
    	e1.printStackTrace();
    	} catch (IOException e1) {
    		// TODO Auto-generated catch block
    	e1.printStackTrace();
    	}
    Sans ces bouts de codes, en wifi ça fonctionne et en 3G.

Discussions similaires

  1. Problème de flux rss
    Par byters dans le forum XML/XSL et SOAP
    Réponses: 2
    Dernier message: 07/07/2009, 19h31
  2. [ZF 1.7] [Zend_Feed] Problème de flux rss sous IE
    Par yegortitov dans le forum Autres composants
    Réponses: 4
    Dernier message: 20/04/2009, 11h09
  3. lecture et récupération flux RSS appli winForms
    Par marcusien dans le forum Windows Forms
    Réponses: 2
    Dernier message: 14/04/2007, 17h38
  4. Pb de récupération FLUX RSS
    Par germain_ledroit dans le forum Struts 1
    Réponses: 5
    Dernier message: 24/11/2006, 17h29

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo