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.FileOutputStream; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.webkit.WebChromeClient; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.ProgressBar; import android.widget.Toast; public class Downfile extends Activity { private static final String fext = ".bin"; private WebView mWebView; private ProgressBar mProgress; //private Handler mHandler = new Handler(); @Override public void onCreate(Bundle icicle){ super.onCreate(icicle); setContentView(R.layout.downfile); mWebView = (WebView) findViewById(R.id.webview); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setAllowFileAccess(true); mProgress = (ProgressBar) findViewById(R.id.pb); mWebView.setWebChromeClient(new WebChromeClient(){ @Override public void onProgressChanged(WebView v, int progress){ mProgress.setProgress(progress); } }); // mWebView.loadUrl("http://www.google.com"); mWebView.loadUrl(getString(R.string.dl_page)); mWebView.setWebViewClient(new MyWebViewClient()); } private class MyWebViewClient extends WebViewClient{ @Override public boolean shouldOverrideUrlLoading(WebView view, String url){ mProgress.setProgress(0); if (TestNeedFile(url)) testGet(url); else view.loadUrl(url); return true; } @Override public void onLoadResource(WebView view, String url){ view.setSaveEnabled(true); //Toast.makeText(Downfile.this, url, Toast.LENGTH_SHORT).show(); } } private boolean TestNeedFile (String link){ String s = link.substring(link.length()-4, link.length()); //Toast.makeText(Downfile.this, s, Toast.LENGTH_SHORT).show(); if (s.equalsIgnoreCase(fext)) return true; else return false; } private String Getfname (String link){ return link.substring(link.lastIndexOf("/")+1); } private void testGet (String link){ try{ String outfile = "/sdcard/mydir/" + Getfname(link); Toast.makeText(Downfile.this, link, Toast.LENGTH_SHORT).show(); URL url = new URL(link); HttpURLConnection uCon = (HttpURLConnection) url.openConnection(); uCon.setRequestMethod("GET"); uCon.setDoOutput(true); uCon.connect(); FileOutputStream fout = new FileOutputStream(outfile); InputStream in = uCon.getInputStream(); int lengtotal = uCon.getContentLength(); byte[] Buffer = new byte[1024]; int leng = 0, lengnow=0; double prog =0; while ( (leng = in.read(Buffer)) != -1 ){ fout.write(Buffer,0,leng); lengnow+=leng; prog = 100 * ((double) lengnow / (double) lengtotal ); Log.d("File", "Progress = " + Integer.toString((int)prog)); mProgress.setProgress((int)prog); } fout.close(); in.close(); } catch (Exception e){ Log.e("test", "This read is wrong"); } } }