0

I did a HTML which includes values which are changed with javascript (after button pressed) and I did an android app with flutter. What is the best way to get this updated data from the HTML in my android app? I tried webview, but it seems not to work, I don't want to load the whole page, only some specific data from it. I tried with json parsing, but I didn't find any way to write my data as json, even if I write json values before (for testing) I can't get this data with this method in my app.

Part of my html:

<tr>
    <td><button id = "btnKli" onclick = "getTEST();">OFF</button></td>
    <td><p>TEST</p></td>
    <td><p id = "t_valKli">0</p></td>
    <td><p id = "t_totKli">0</p></td>
    <td><p id = "t_perKli">0</p></td>
</tr>

I need the changed values from t_valKli etc. This values are changed via javascript in a variable with different functions and t_valKli get changed as following:

document.getElementById("t_valKli").innerHTML = parseFloat(valKli).toFixed(2)

Thank you in advance.

I tried webview but it don't work (probably outdated OS, but I need AND 5.0). I tried html parser, but I only get the fixed values, not the changed one. I tried to write the values as json, but can only read full json files with flutters json parser. I tried to save the values in an extra json file, but it won't overwrite this files and create new ones.

22
  • I can not understand what you are trying to achieve. Commented Feb 18, 2023 at 21:30
  • Well I have an android app and I need special values. This values are generated in a html with javascript and I want to get this data in my app. This html I run on a webserver with a raspberry pi. Commented Feb 18, 2023 at 21:37
  • have look at this? docs.flutter.dev/cookbook/networking/fetch-data Commented Feb 18, 2023 at 21:39
  • and this? medium.com/flutter-community/… Commented Feb 18, 2023 at 21:40
  • or this? stackoverflow.com/questions/62577610/… Commented Feb 18, 2023 at 21:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.