Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 73: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 74: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 75: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 76: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 77: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 78: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
import java.io.BufferedInputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.util.Timer; import java.util.TimerTask; import org.apache.http.util.ByteArrayBuffer; import droid.test.vn.R; import android.app.Activity; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.view.View; import android.widget.Button; import android.widget.ImageButton; import android.widget.ImageView; public class test extends Activity{ public static final String imageName = "my_image.jpg"; //the name of your image file goes here ImageView image; Timer timer; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); image=(ImageView)findViewById(R.id.imgView); TimerThread timerThread = new TimerThread(); timerThread.start(); } private class TimerThread extends Thread { public void run() { timer = new Timer(); timer.schedule(new DownloadTimerTask(),2000); } } private class DownloadTimerTask extends TimerTask { public void run() { downloadImage(); handler.sendEmptyMessage(0); } } Handler handler = new Handler() { final String path ="/sdcard/download" + imageName; Bitmap bitmap; File file = new File(path); @Override public void handleMessage(Message msg) { bitmap = BitmapFactory.decodeFile(path); image.setImageBitmap(bitmap); } }; private void downloadImage() { String filePath = "/sdcard/download"; File file = new File(filePath); InputStream in = null; String urlString = "http://www.croatianstar.com/cam1/current.jpg"; BufferedInputStream bis = null; try { URL url = new URL(urlString); URLConnection ucon = url.openConnection(); in = ucon.getInputStream(); bis = new BufferedInputStream(in); ByteArrayBuffer baf = new ByteArrayBuffer(50); int current = 0; while((current = bis.read())!=-1) { baf.append((byte)current); } FileOutputStream fos = new FileOutputStream(file); fos.write(baf.toByteArray()); fos.close(); bis.close(); in.close(); } catch(MalformedURLException e) { e.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } } }