How can I use a Website form via Android?

1

I'm new to Android programming (java) and I've had a problem for some time: I need to use a Web form on Android, transferring data between EditText and Input, Button and Button etc ... but without Webview.

I wonder if you can do this.

    
asked by anonymous 28.08.2016 / 05:06

1 answer

2

Through this topic I think it will help you in this

link: link

public void postData(String email, String password) {
// Cria um novo HttpClient e um Post Header
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://www.seusite.com/registrar.php");

try {

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


    // Executa a requesição HTTP Post 
    HttpResponse response = httpclient.execute(httppost);

} catch (ClientProtocolException e) {

} catch (IOException e) {

   }
} 
    
29.08.2016 / 00:06