Code example for URLConnection

Methods: getInputStreamsetRequestProperty

        final URL url = new URL(mUrl);
        final URLConnection c = url.openConnection();
        c.setRequestProperty("User-Agent", "Android/1.5");
        reader.parse(new InputSource(c.getInputStream()));
        return mId;
    public boolean updateFavicon(long id, String iconUrl) throws MalformedURLException {
        return updateFavicon(id, new URL(iconUrl));
    public boolean updateFavicon(long id, URL url) {
        InputStream stream = null;
        OutputStream ico = null;
        boolean r = false;
Connect your IDE to all the code out there  Get Codota for Java