Android Question json limits

Discussion in 'Android Questions' started by ArminKH, May 10, 2015.

  1. ArminKH

    ArminKH Well-Known Member

    Hi every body
    I have a question about json
    I have a php page on my server and when my user do search on client side that page return results to json encode
    i want to download results by httpUtils my resluts is a name a family an a profile picture and finaly i want to add this informations to a panel and then add this items to a scroll view
    Now i have two solution
    1:download all search's results from server side and then add 10 or 15 item to scroll view at same time (10 item per each scroll)
    2:download 10 item from server side per each scroll and add them to scroll view

    Which way is better?
    If i use solution 1 then maybe my search reault be about 1000 item and my data's(json string) lenght be too large
    If i use solution 2 then maybe my connection to my server be too much than usual(1 connect for each scroll)and then maybe my server be so busy

    Please help me or suggest better solution
    Excuse me for my english
    Tnx all
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You can download 100 items each time. If the user scrolls to the last page, download another 100 items.
     
    ArminKH likes this.
  3. ArminKH

    ArminKH Well-Known Member

    @Erel Why we cant to download all items together and then add 10 of them to scroll view each time?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You can. I understood from your question that the json string might be too long so it might be slower.
     
    ArminKH likes this.
  5. ArminKH

    ArminKH Well-Known Member

    @Erel yes it can be longer but if we download all items together then thats not possible to crash?(force close)
     
  6. DonManfred

    DonManfred Expert Licensed User

    The question is what you ae doing with that json.....
    Most probably it is NOT the download of 1000 items at once which causes an error.
     
    ArminKH likes this.
  7. ArminKH

    ArminKH Well-Known Member

    my question is about a solution which is fast,smooth,usual and has minimum server cpu and ram usage.
    Ok thank u both as erel said it's better to download 100 item each time :)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice