2017년 1월 14일 토요일

clock fires very slow when I calling to API to get XML text


I set clock interval to 1000
and I'm calling to some API to get XML text (with web.get block) but actually it looks to me very slow, XML text should be changed every 1 sec (1000) but it changed between 10-15 sec (I see the change with the web viewer).
 when I put the API address on desktop browser I see the change every time I press on refresh button so its ok, but I thought the clock was doing the same thing

--
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

-- 
something simple like in the image and timeInterval is: 1000 but I see the change every 15 sec on average and not every 1 sec

 unnamed (1).png

-- 
I suspect that the web page is only updating every 15 seconds.
If that is the case it would explain why you only see changes that often.
Setting a clock Timer to 1000 ms will not speed the refresh rate of the web page itself.

--
ok, same happens even I use web.get block and I put the response content into the label to display, it takes even more time until I see some refresh, Im trying to find some solution for this issue in the forum but nothing

-- 
If you are using the url https://admin.appn.com/offerWIApi.aspx?&tid=API&ID=4bae-9bfc-9be2bcba
I get that it is not in use.
Even so, if the owner of a url only pushes updates every 15 seconds, no matter how fast or often you GET that url, it will update only every 15 seconds.
That is the point that I was making.

-- 
but if I put this url in the desktop browser and make a refresh every 1 sec I see new update every time, and thats what wierd

-- 
to only set the url without going to that url does not help very much
I would first use the WebViewer.ClearCaches block and then the Webviewer.GoToUrl block together with your url instead




ClearCaches()
Clear the WebViewer caches

GoToUrl(text url)
Load the page at the given URL.

-- 
this url works surely if this help
???
you might want to try my suggestion...

-- 
I did exactly as you said and no change
web viewer clearcache and then go to url
I still dont know why it's update so slowly

I attached the second option that I  use to display the xml 
xml2.png 표시 중
-- 
I did exactly as you said and no change
you talked about the webviewer component in your screenshot, so my answer was also about the webviewer...

but to receive some XML, I agree, you should use  the web component 
the web component works asynchronously, which means, do not use the clock component, else the system might get overwhelmed

instead first send a request, for example in a button.click event, then in the web.gotText event receive the response and send the next request etc.

-- 
you mean like in the image?
I try it and same behavior, refresh between 15-20 sec, it takes too long time, something here is slow down the process

app3.png 표시 중
-- 
the screenshot looks fine
the response time of that webpage is something out of App Inventor's control

-- 
you right, it resolved, somehow it works now and I didn't do anything, probably problem was not app inventor side
thank you for the help

-- 


댓글 1개:

  1. Did you know that you can shorten your urls with AdFly and receive $$$$$$ for every visit to your short urls.

    답글삭제