Answer the question
In order to leave comments, you need to log in
How to submit a form through android application?
In HTML, you can submit a form to another site by passing in data, something like this:
<form method="POST" action="http://my-server.com/parser.php">
<input type="text" name="name" value="Test" />
<input type="text" name="age" value="10" />
<button type="submit">Send</button>
</form>
Answer the question
In order to leave comments, you need to log in
It is possible, as many as 2 ways:
1) Open the form in a standard browser engine - WebView - as in a normal browser, only in your Activity (OPTIONAL) and under the control of your application.
bsb.info/java/android/browsers/webview.html
2) HTTP request is a more low-level method, does not require user participation, works faster, is universal, but also heavier.
If you have someone else's site / service and you need to simulate local requests, then you need to take a sniffer, for example, Fiddler, and first experiment with desktop Java (for convenience), and then transfer the code to an Android application and test it.
There are also intermediate options for different tasks.
For example, jsoup is not exactly a browser engine, does not execute JS, does not provide any rendering, but makes a GET request and renders HTML into a DOM tree that can be programmatically manipulated.
anything from HttpUrlConnection to OkHttp + Robospice
> advise only where you can read how to do it,
the very soft here.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question