4

Possible Duplicate:
How can I open android browser with specified POST parameters?

I have set up a Button that will link to Google Checkout, however, I need to POST a whole lot of required data (not GET) so I can't use the usual Intent method.

            //open the browser
            Uri u = Uri.parse(uri.toString());
            Intent i = new Intent(Intent.ACTION_VIEW, u);
            startActivity(i);

How do I post data to a URL by pressing a button and then load the result into a web browser? In this case it will be the Google Checkout webpage.

1
  • Hi there i would like to talk to you regarding adding parameters to a POST request in android Commented Apr 14, 2015 at 11:33

1 Answer 1

0

Please see the following link for some details Android Webview POST. You will have to use a webview in your layout, you could submit the details then load the results into the webview.

Another which maybe of some use - although not to do with a webview: Android JSON HttpClient to send data to PHP server with HttpResponse

Sign up to request clarification or add additional context in comments.

2 Comments

Is there a way to do this without needing webviews because the user will seed a https connection with the server for the entire session. Will this be ok if I just load html into a webview?
I haven't really done any work with https, but from what I have read, as long as the signing authority behind the websites certificate is trusted by android, or added by you, it will work: Android WebView with https loadUrl shows blank/empty page another of interest: Https Connection Android. I don't know if it is possible to post data via the browser intent though, I haven't seen it done that way.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.