How can I use a Website form through Android?

Asked

Viewed 46 times

1

I’m new to Android programming (java) and for a while now I have a problem: 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 have a way to do that.

  • Why doesn’t Webview work for you? It would be the ideal solution since it would allow you to display and manage dynamically rendered html content.

  • something like this http://www.tutorialspoint.com/android/php_mysql.htm

  • I would like to use a form in a normal Activity with a button that performs the same functions of a form on a website, as if it were a mask, I think you need to convert the page into html and then perform the functions. The webview would be very vulnerable and show the page advertisements.

1 answer

2

Through this topic I think will help you in this

link:https://stackoverflow.com/questions/17505157/how-to-send-the-data-from-edittext-to-a-website

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) {

   }
} 
  • I think that’s not quite what he wants! Or maybe I got it wrong!

  • So from what I understand he wants to send the Edittext data in the app, to a form on his website.

  • That’s right @Reynaldotadeu, I need to do this and get a value on the next page.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.