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.

Community
  • 1
  • 1
jax
  • 37,735
  • 57
  • 182
  • 278

1 Answers1

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

Community
  • 1
  • 1
Scoobler
  • 9,696
  • 4
  • 36
  • 51
  • 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? – jax Nov 15 '10 at 16:50
  • 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](http://damianflannery.wordpress.com/2010/09/28/android-webview-with-https-loadurl-shows-blankempty-page/) another of interest: [Https Connection Android](http://stackoverflow.com/questions/995514/https-connection-android/1000205#1000205). I don't know if it is possible to post data via the browser intent though, I haven't seen it done that way. – Scoobler Nov 15 '10 at 17:04