I have a web page with some input fields and a "OK" button. I can use it from the phone´s internet browser, but:
Is it possible to develop with B4A an App able to fill in the text of the input boxes of the web App, and then ejecuting the transaction associated with the OK button?
Do we have an internet brower object that we could use to automate this sort of tasks?
There are two options:
1. Load the page with WebView and then inject JavaScript that will do whatever you need.
2. Understand how the page works and submit the request yourself with OkHttpUtils2. This is relevant if you only need to extract data from the form response.
Code requires Android 5+ 1. Set a custom WebViewChromeClient. It is implemented with inline Java code. 2. The ShowFile_Chooser event is raised when the user clicks on a "browse" button. 3. You need to get the file URI with FileProvider and call SendResult. Example based on ContentChooser...
www.b4x.com
, and it works well.
But I am not an expert in programming. A simple example for example with the page www.google.com would help me a lot. The example would just load into the search box any word, and then the App would press the search button and get in a string variable the result of the search. This example would answer all for me. Thanks!