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 gpsbusca.com.br; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.CookieStore; 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 android.app.Activity; import android.os.Bundle; import android.util.Log; public class HttpPostConnection extends Activity { private CookieStore cookies; private boolean isAuthenticated; private ArrayList pairs; private DefaultHttpClient httpclient; private HttpPost httppost; private InputStream conteudo; private String retornoConexao; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); //example of use Map vars = new HashMap(); vars.put("login", "login"); vars.put("password", "password"); vars.put("action", "del"); parametrosHttp("http://www.rgcarros.com.br", vars); go(); } public void parametrosHttp(String url, Map variables) { this.httpclient = new DefaultHttpClient(); this.httppost = new HttpPost(url); this.pairs = new ArrayList(); if(variables != null){ Set keys = variables.keySet(); for(Iterator i = keys.iterator(); i.hasNext();) { String key = (String)i.next(); pairs.add(new BasicNameValuePair(key, variables.get(key))); } } } public String go(){ try { UrlEncodedFormEntity p_entity = new UrlEncodedFormEntity(pairs, "ISO-8859-1"); /** Assign the POST data to the entity */ httppost.setEntity(p_entity); /** Perform the actual HTTP POST */ HttpResponse response = httpclient.execute(httppost); HttpEntity entity = response.getEntity(); conteudo = entity.getContent(); this.retornoConexao = convertStreamToString(conteudo); Log.d("HttpPostConnection",">>>>>>>>>>>>>>> "+retornoConexao); int status_code = response.getStatusLine().getStatusCode(); this.cookies = httpclient.getCookieStore(); if (status_code >= 300) { this.isAuthenticated = false; } else { this.isAuthenticated = true; } } catch (UnsupportedEncodingException uee) { // Woops } catch (IOException ioe) { // Woops } catch(IllegalStateException ise) { // woops } return retornoConexao; } public String convertStreamToString(InputStream is) { BufferedReader reader = new BufferedReader(new InputStreamReader(is)); StringBuilder sb = new StringBuilder(); String line = null; try { while ((line = reader.readLine()) != null) { sb.append(line + "n"); } } catch (IOException e) { e.printStackTrace(); } finally { try { is.close(); } catch (IOException e) { e.printStackTrace(); } } return sb.toString(); } public boolean isAuthenticated() { return isAuthenticated; } }