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 /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

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 /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Android Http Post Login

Android Http Post Login

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

Android Http Post Login

Postby guydor » Mon Jun 27, 2011 6:00 am

I'm trying to make a login to my website via an Android app. For some reason something always goes wrong.

Here's my site login structure:

Login.php - the login form (username & password)
Auth.php - login authentication page (gets the username & password from page - login.php (POST method))
I already have to interface with Username & Password (EditText both)

What is the method to make a login via android app?

here's my current login method

private void login() {
// Create a new HttpClient and Post Header
HttpClient httpclient = new DefaultHttpClient();

/* login.php returns true if username and password is equal to saranga */
HttpPost httppost = new HttpPost("my auth.php file url");

try {
// Add user name and password
String username = this.usernameField.getText().toString();
String password = this.passwordField.getText().toString();

List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("username", username));
nameValuePairs.add(new BasicNameValuePair("password", password));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));


HttpResponse response = httpclient.execute(httppost);

} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}


Thanks
guydor
Freshman
Freshman
 
Posts: 2
Joined: Sun Jun 26, 2011 7:36 pm

Top

Return to General

Who is online

Users browsing this forum: No registered users and 5 guests