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 de.demo.login; import java.io.IOException; import java.io.InputStream; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.params.HttpConnectionParams; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; import org.xml.sax.helpers.DefaultHandler; import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.Intent; import android.os.Bundle; import android.os.Looper; import android.view.View; import android.widget.Button; import android.widget.EditText; import de.demo.main.R; public class Login extends Activity { private static final String UPDATE_URL = "https://www.google.com/accounts/LoginAuth"; public ProgressDialog progressDialog; private EditText UserEditText; private EditText PassEditText; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); progressDialog = new ProgressDialog(this); progressDialog.setMessage("Please wait..."); progressDialog.setIndeterminate(true); progressDialog.setCancelable(false); UserEditText = (EditText) findViewById(R.id.username); PassEditText = (EditText) findViewById(R.id.password); Button button = (Button) findViewById(R.id.okbutton); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { int usersize = UserEditText.getText().length(); int passsize = PassEditText.getText().length(); if(usersize > 0 && passsize > 0) { progressDialog.show(); String user = UserEditText.getText().toString(); String pass = PassEditText.getText().toString(); doLogin(user, pass); } else createDialog("Error","Please enter Username and Password"); } }); button = (Button) findViewById(R.id.cancelbutton); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { quit(false, null); } }); } private void quit(boolean success, Intent i) { setResult( (success) ? -1:0, i); finish(); } private void createDialog(String title, String text) { AlertDialog ad = new AlertDialog.Builder(this) .setPositiveButton("Ok", null) .setTitle(title) .setMessage(text) .create(); ad.show(); } private void doLogin(final String login, final String pass) { Thread t = new Thread() { public void run() { Looper.prepare(); DefaultHttpClient client = new DefaultHttpClient(); HttpConnectionParams.setConnectionTimeout(client.getParams(), 15000); HttpResponse response; HttpEntity entity; try { HttpGet get = new HttpGet(UPDATE_URL+"?Email="+login+"&Passwd="+pass); response = client.execute(get); entity = response.getEntity(); InputStream is = entity.getContent(); read(is); is.close(); if (entity != null) entity.consumeContent(); } catch (Exception e) { progressDialog.dismiss(); createDialog("Error", "Couldn't establish a connection"); } Looper.loop(); } }; t.start(); } private void read(InputStream in) { SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp; try { sp = spf.newSAXParser(); XMLReader xr = sp.getXMLReader(); LoginContentHandler uch = new LoginContentHandler(); xr.setContentHandler(uch); xr.parse(new InputSource(in)); } catch (ParserConfigurationException e) { } catch (SAXException e) { } catch (IOException e) {} } private class LoginContentHandler extends DefaultHandler { private boolean in_title = false; private boolean success; public void startElement(String n, String l, String q, Attributes a) throws SAXException { if(l == "title") in_title = true; } public void endElement(String n, String l, String q) throws SAXException { if(l == "title") { in_title = false; progressDialog.dismiss(); if(success) { Intent i = new Intent(); i.putExtra("success", success); quit(success,i); } else { createDialog("Error", "Invalid username and/or password"); success = false; } } } public void characters(char ch[], int start, int length) { if(in_title) { String erg = new String(ch, start, length); success = (erg.equals("Redirecting")) ? true : false; } } public void startDocument() throws SAXException { } public void endDocument() throws SAXException { } } }