Hi now i am working on my new app for eye disease detection by using Api when i make request by sending image to my pre prepared ai for eye disease detection by using Api i get answers in the following form
Youโll need to parse the JSON into variables - if you do a search for it on the forum, thereโre plenty of examples. It does take a while to get your head round though.
Hereโs an example from one of my projects. The key bit is the two orange blocks at the bottom - theyโre assigning a value from the JSON into a variable (var2). Thereโs a list in your API return, so watch for that.
To reference the first probability, youโll need to reference โdisease_prediction[1].probabilityโ, the first TagID will be โdiseae_prediction[1].TagIDโ and so on.
Thanks, it has helped but there is one thing i need help how can i create a table to display the results in my app and also get the probability and tag name together i order to show them in a same row in a table without confusing them with as tags lastly how can i get them arranged in order that the tag with high probability appear the first.
I guess if youโre displaying only one result at a time, you could build a screen with labels and line them up that way. If youโve got more than one result, then youโre probably looking at some sort of Data Viewer List which will make things a lot more complicated. Instead of just returning the variables, you would then need to put them into a data source and pull them from there. Sorting data is, as Iโm also struggling with, pretty complicated.
If you need help with JSON, itโs important that you post the full response as text and make sure to format it using the </> button in the toolbar above the post. To learn more about JSON parsing from an API, you can view my tutorial (link below).
ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท
Need help? How to Ask Great QuestionsDebugging A ProjectAPI JSON Tutorial