I am making an app that conects to a server from where it needs to get a path wich will use after for upload files to that server.
In the app, there is a webview that display webpage with the options. When you touch/click in one button... lets say, "get url" it is suposed to send the url(a simple string value) from the server to the app.
In the app I was thinking that it could be something like this.
class JSInterface {
public void getUrl(String URL) {
MainActivity.doSomethingWithUrl(URL);
}
}
In the server side:
<html>
<head>
<script>
function sendUrl() {
Android.getUrl()
}
</script>
</head>
<body>
<input type="button" value="sendUrl" onClick="sendUrl()" />
</body>
</html>
In the js sendURL function is where I dont know what to do. PD: The server backend is php