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 Main extends Activity { private static final String url = "http://10.0.2.2:8080/hotelDB/resources/entities.hoteltable"; protected InitTask _initTask; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button button = (Button)findViewById(R.id.button1); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { _initTask = new InitTask(); _initTask.execute( getApplicationContext() ); } }); } @Override public void onStop() { super.onStop(); _initTask.cancel(true); } protected class InitTask extends AsyncTask { @Override protected SearchResponse doInBackground( Context... params ) { InputStream source = retrieveStream(url); SearchResponse response = null; if (source != null) { Gson gson = new Gson(); Reader reader = new InputStreamReader(source); try { response = gson.fromJson(reader, SearchResponse.class); publishProgress( response.query ); } catch (JsonSyntaxException e) { Log.w(getClass().getSimpleName(), "Error: " + e.getMessage() + " for URL " + url); return null; } catch (JsonIOException e) { Log.w(getClass().getSimpleName(), "Error: " + e.getMessage() + " for URL " + url); return null; } finally { try { reader.close(); } catch (IOException e) { Log.w(getClass().getSimpleName(), "Error: " + e.getMessage() + " for URL " + url); } } } if (!this.isCancelled()) { return response; } else { return null; } } @Override protected void onProgressUpdate(String... s) { super.onProgressUpdate(s); Toast.makeText(getApplicationContext(), s[0], Toast.LENGTH_SHORT).show(); } @Override protected void onPostExecute( SearchResponse response ) { super.onPostExecute(response); StringBuilder builder = new StringBuilder(); if (response != null) { String delim = "* "; List results = response.results; for (Result result : results) { builder.append(delim).append(result.hotelName_); delim="\n* "; } } if (builder.length() > 0) { Toast.makeText(getApplicationContext(), builder.toString(), Toast.LENGTH_SHORT).show(); } else { Toast.makeText(getApplicationContext(), "The response was empty.", Toast.LENGTH_SHORT).show(); } } @Override protected void onCancelled() { super.onCancelled(); Toast.makeText(getApplicationContext(), "The operation was cancelled.", 1).show(); } private InputStream retrieveStream(String url) { DefaultHttpClient client = new DefaultHttpClient(); HttpGet getRequest; try { getRequest = new HttpGet(url); try { HttpResponse getResponse = client.execute(getRequest); final int statusCode = getResponse.getStatusLine().getStatusCode(); if (statusCode != HttpStatus.SC_OK) { Log.w(getClass().getSimpleName(), "Error " + statusCode + " for URL " + url); return null; } HttpEntity getResponseEntity = getResponse.getEntity(); try { return getResponseEntity.getContent(); } catch (IllegalStateException e) { getRequest.abort(); Log.w(getClass().getSimpleName(), "Error for URL " + url, e); return null; } catch (IOException e) { getRequest.abort(); Log.w(getClass().getSimpleName(), "Error for URL " + url, e); return null; } } catch (ClientProtocolException e) { getRequest.abort(); Log.w(getClass().getSimpleName(), "Error for URL " + url, e); } catch (IOException e) { getRequest.abort(); Log.w(getClass().getSimpleName(), "Error for URL " + url, e); } } catch (IllegalArgumentException e) { Log.w(getClass().getSimpleName(), "Error for URL " + url, e); } return null; } } }