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 com.ignacio.BilingualSTT; import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.util.ArrayList; import java.util.List; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import android.util.Log; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.HttpClient; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.message.BasicNameValuePair; import org.apache.http.util.ByteArrayBuffer; import org.xml.sax.InputSource; import org.xml.sax.XMLReader; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.TextView; import android.widget.Toast; public class PostAndGet extends Activity { private static String Utterance = null; TextView Title; TextView Content; private static final String TAG = "TextToSpeechDemo"; String text; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.en_results); Title = (TextView)findViewById(R.id.A1_title); Content= (TextView) findViewById(R.id.A1_content); text = ""; Bundle b = this.getIntent().getExtras(); if (b !=null){ Utterance = b.getString("query"); } postData(Utterance); } /** * Handle the action of the Back button */ public void sendback(View v) { Intent Sendback=new Intent(this, EnglishRecognizer.class); startActivity(Sendback); } /** * Start HTTP Post call */ public void postData(String Utterance){ // Create a new HttpClient and Post Header HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://hcc.cs.clemson.edu/~ignm/ignacio/Android_QueryResults.php"); try { // Add data to the HTTP Request data has to be named query since the PHP page in the server is expecting that name to run the query on the DB List nameValuePairs = new ArrayList(2); nameValuePairs.add(new BasicNameValuePair("query", Utterance)); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); // Execute HTTP Post Request and retrieve answer from PHP side. HttpResponse response = httpclient.execute(httppost); InputStream is = response.getEntity().getContent(); BufferedInputStream bis = new BufferedInputStream(is); ByteArrayBuffer baf = new ByteArrayBuffer(20); int current = 0; while((current = bis.read()) != -1){ baf.append((byte)current); } // Convert the Bytes read to a String and display it in the Title Container text = new String(baf.toByteArray()); Title.setText(text); //Send Text to parseXML (text); } catch (ClientProtocolException e) { // TODO Auto-generated catch block Toast.makeText(this, "Error in the connection", Toast.LENGTH_SHORT).show(); } catch (IOException e) { // TODO Auto-generated catch block Toast.makeText(this,"IO Exception error", Toast.LENGTH_SHORT).show(); } } public void parseXML (String text){ String AnswerExt = text; try { /* Create a URL we want to load some xml-data from. */ URL url = new URL("http://hcc.cs.clemson.edu/~ignm/ignacio/"+AnswerExt.toString()); Log.i(TAG, url.toString()); /* Get a SAXParser from the SAXPArserFactory. */ SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newSAXParser(); /* Get the XMLReader of the SAXParser we created. */ XMLReader xr = sp.getXMLReader(); /* Create a new ContentHandler and apply it to the XML-Reader*/ ExampleHandler myExampleHandler = new ExampleHandler(); xr.setContentHandler(myExampleHandler); /* Parse the xml-data from our URL. */ xr.parse(new InputSource(url.openStream())); /* Parsing has finished. */ /* Our ExampleHandler now provides the parsed data to us. */ ParsedExampleDataSet parsedExampleDataSet = myExampleHandler.getParsedData(); /* Set the result to be displayed in our GUI. */ Content.setText(parsedExampleDataSet.getExtractedString()); } catch (Exception e) { /* Display any Error to the GUI. */ Content.setText("Error: " + e.getMessage()); Log.e(TAG, "QueryError", e); } } }