I am trying to do this, and I really need help from expirienced fellows.
- App with 2 texboxes. One for username, and one for password.
- Button for login.
- When user press button, login information is sent to webpage (m.bonbon.hr), and that webpage is opened in browser.
- After first login, login information is saved so that user doesn't have to enter that information again.
Where to start from, please any guidelines, advices, i'll take anything.
EDIT:
I created this in my main acctivity
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpPost httpost = new HttpPost("https://www.bonbon.hr/registracija?direct=1");
try {
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
nvps.add(new BasicNameValuePair("email", "login"));
nvps.add(new BasicNameValuePair("password", "pw"));
nvps.add(new BasicNameValuePair("autologin", "true"));
httpost.setEntity(new UrlEncodedFormEntity(nvps));
}
catch (UnsupportedEncodingException e) {
// writing error to Log
e.printStackTrace();
}
try {
HttpResponse response = httpclient.execute(httpost);
// writing response to log
Log.d("Http Response:", response.toString());
} catch (ClientProtocolException e) {
// writing exception to log
e.printStackTrace();
} catch (IOException e) {
// writing exception to log
e.printStackTrace();
}
Under the onCreate part. So now , when i click on my button (already created and ready for use) i need to login to given URL with given information... But I don't know how to makle it happen using asyntask :(