Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I open Android browser with specified POST parameters?

In my Android application, I need to open a link in Browser. This page can receive some data just via POST. Could I add these parameters (data) to the intent which start the browser?

Do you know if this is possible? If it is, could you give my a hint?

like image 560
Ungureanu Liviu Avatar asked Sep 05 '25 03:09

Ungureanu Liviu


1 Answers

Use a webview:

WebView webview = new WebView(this);
setContentView(webview);
byte[] post = EncodingUtils.getBytes("postvariable=value&nextvar=value2", "BASE64");
webview.postUrl("http://www.geenie.nl/AnHeli/mobile/ranking/demo/index.php", post);
like image 55
Pete Avatar answered Sep 07 '25 23:09

Pete