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)
public class DownloadFile extends Activity implements View.OnClickListener { private static final int WAIT_DIALOG_KEY = 123; private ProgressDialog waitDialog; private String url, root = "/data/data/wms.apps.android/", filename; private boolean isDownloaded = false; private Bitmap bitmap; private ImageView image; private File downloadFile; private TextView tv; private class DownloadTask extends AsyncTask { @Override protected Void doInBackground(Void... arg0) { // TODO Auto-generated method stub try { URL imageUrl = new URL(url); InputStream in = openHttpConnection(imageUrl); // bitmap = BitmapFactory.decodeStream(in); ByteArrayBuffer buffer = new ByteArrayBuffer(500); int byteRead = 0; while ((byteRead = in.read()) != -1) { buffer.append(byteRead); } String filename = Environment.getExternalStorageDirectory() + "/megan.apk"; downloadFile = new File(filename); // downloadFile = new File(root, "test.apk"); FileOutputStream out = new FileOutputStream(downloadFile); out.write(buffer.toByteArray()); in.close(); out.close(); isDownloaded = true; } catch (Exception e) { } return null; } private InputStream openHttpConnection(URL aUrl) { InputStream in = null; try { URLConnection connection = aUrl.openConnection(); HttpURLConnection httpConnection = (HttpURLConnection) connection; httpConnection.setAllowUserInteraction(false); httpConnection.setInstanceFollowRedirects(true); httpConnection.setRequestMethod("GET"); httpConnection.connect(); in = httpConnection.getInputStream(); } catch (Exception e) { } return in; } protected void onPreExecute() { showDialog(WAIT_DIALOG_KEY); } protected void onPostExecute(Void voids) { // image.setImageBitmap(bitmap); if (isDownloaded) tv.setText("APK downloaded"); waitDialog.dismiss(); // Toast.makeText(DownloadFile.this, "Done", Toast.LENGTH_SHORT) // .show(); } } protected Dialog onCreateDialog(int id) { switch (id) { case WAIT_DIALOG_KEY: { waitDialog = new ProgressDialog(this); waitDialog.setMessage("Please wait while loading..."); waitDialog.setIndeterminate(true); waitDialog.setCancelable(true); return waitDialog; } } return null; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.list); Bundle intentData = this.getIntent().getExtras(); url = intentData.getString("url"); } public void onStart() { super.onStart(); new DownloadTask().execute(); tv = (TextView) findViewById(R.id.label); image = (ImageView) findViewById(R.id.image); Button aButton = (Button) findViewById(R.id.install); aButton.setOnClickListener(this); if (isDownloaded) tv.setText("Image downloaded"); else tv.setText("Image download failed"); }