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)
package Oroscopo.grg; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; import android.app.ProgressDialog; import android.app.Activity; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; import android.widget.ImageView; import android.widget.TextView; import android.os.Handler; //this is import for handler object public class arietesett extends Activity { /** Called when the activity is first created. */ protected ProgressDialog myProgressDialog; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fuocosett); /* Show a progress-bar */ myProgressDialog = ProgressDialog.show(arietesett.this, "Please wait...", "Doing Extreme Calculations...", true); new Thread() { public void run() { Bitmap bitmap = DownloadImage("http://www.moongate.it/oroscopo/arietesett.png"); ImageView img = (ImageView) findViewById(R.id.img); img.setImageBitmap(bitmap); Bitmap bitmap1 = DownloadImage1("http://www.moongate.it/oroscopo/arietetext.png"); ImageView imgt = (ImageView) findViewById(R.id.imgt); imgt.setImageBitmap(bitmap1); /*String str = DownloadText("http://www.moongate.it/oroscopo/ariete.txt"); TextView txt = (TextView) findViewById(R.id.text); txt.setText(str); */ String str1 = DownloadText1("http://www.moongate.it/oroscopo/data.txt"); TextView txt1 = (TextView) findViewById(R.id.data); txt1.setText(str1); handler.sendEmptyMessage(0); //Here thread execution is finished and control transferred to the handler object } }.start(); // if you write annonymous class for Thread object creation you should start thread like this } private Handler handler = new Handler() { @Override public void handleMessage(Message msg) { super.handleMessage(msg); myProgressDialog.dismiss(); // here your progress dialog is dismissed indicating process is finished // Here you can write other processing code if you want } }; } private InputStream OpenHttpConnection(String urlString) throws IOException { InputStream in = null; int response = -1; URL url = new URL(urlString); URLConnection conn = url.openConnection(); if (!(conn instanceof HttpURLConnection)) throw new IOException("Not an HTTP connection"); try{ HttpURLConnection httpConn = (HttpURLConnection) conn; httpConn.setAllowUserInteraction(false); httpConn.setInstanceFollowRedirects(true); httpConn.setRequestMethod("GET"); httpConn.connect(); response = httpConn.getResponseCode(); if (response == HttpURLConnection.HTTP_OK) { in = httpConn.getInputStream(); } } catch (Exception ex) { throw new IOException("Error connecting"); } return in; } private Bitmap DownloadImage(String URL) { Bitmap bitmap = null; InputStream in = null; try { in = OpenHttpConnection(URL); bitmap = BitmapFactory.decodeStream(in); in.close(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } return bitmap; } private Bitmap DownloadImage1(String URL) { Bitmap bitmap = null; InputStream in = null; try { in = OpenHttpConnection(URL); bitmap = BitmapFactory.decodeStream(in); in.close(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } return bitmap; } /*private String DownloadText(String URL) { int BUFFER_SIZE = 2000; InputStream in = null; try { in = OpenHttpConnection(URL); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); return ""; } InputStreamReader isr = new InputStreamReader(in); int charRead; String str = ""; char[] inputBuffer = new char[BUFFER_SIZE]; try { while ((charRead = isr.read(inputBuffer))>0) { //---convert the chars to a String--- String readString = String.copyValueOf(inputBuffer, 0, charRead); str += readString; inputBuffer = new char[BUFFER_SIZE]; } in.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); return ""; } return str; } */ private String DownloadText1(String URL) { int BUFFER_SIZE = 2000; InputStream in = null; try { in = OpenHttpConnection(URL); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); return ""; } InputStreamReader isr = new InputStreamReader(in); int charRead; String str1 = ""; char[] inputBuffer = new char[BUFFER_SIZE]; try { while ((charRead = isr.read(inputBuffer))>0) { //---convert the chars to a String--- String readString = String.copyValueOf(inputBuffer, 0, charRead); str1 += readString; inputBuffer = new char[BUFFER_SIZE]; } in.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); return ""; } return str1; } }