normally I can receive and work with JSON ( I get [{"countactive":"2"}] from php and I can work with that in B4A),
but now I am trying to do new task:
I have PHP with javascript which give me JSON string BUT I get it after +-3 second ..... (after I start simple HTTP task via my browser)
but
My app crashed, because when I started the request in B4A, then after some miliseconds I see in LOGs only "html" code of my PHP site....and not JSON output in format [{"countactive":"2"}] which this site can generate after 3-5 second
and it is clear that this code crashed (I understand):
Please how can I wait for this json string with my B4A app? What is better way - how to solve this task?
How can I disable reading "html" content of my php site and how can I wait 3-5second only for described JSON (text)?
Based on your description the server returns a html page with JavaScript. The browser executes the JavaScript and something happens. Maybe it creates another request with the url that you are looking for or maybe it does something else. Use the browser development tools to understand what happens.
For certain I must ask:
Is here some possibility how to work with webpage such this with B4A?
So - I get result (plain text - not JSON) via webpage after 3-5second.
Can I do some http request, wait 3-5 seconds and then work with this result (text) using B4A?
For certain I must ask:
Is here some possibility how to work with webpage such this with B4A?
So - I get result (plain text - not JSON) via webpage after 3-5second.
Can I do some http request, wait 3-5 seconds and then work with this result (text) using B4A?
You may do debug on the return message. Instead of putting into map, put into a string and show on screen. Perhaps your api returned an error message in html format.