Using a dictionary with 10,000 values gives an error

Hi,

I am building an android app to build a puzzle from some pre-loaded puzzles in a dictionary variable (of int, string). It has over 12,000 puzzles. When the user clicks new game, a random integer is generated and the corresponding puzzle is selected from dict and loaded.

When the dict had only 10 puzzles app was working fine, but the moment I added 10,000 puzzles it shows an error the method playgame():ctor (int) is too complicated.

So I guess it has something to do with the dictionary variable? Each item has atleast 2000 characters.

Can someone tell me why this is happening and how to avoid this? I don't want to use SQlite . Can i store these puzzles in application resources and then load them?

Regards,

Best Answer

  • xam_donjoxam_donjo ✭✭
    Accepted Answer

    I tried application resources and dictionary, alongwith list but nothing was working. So I went with API calls to load the puzzles.

Answers

  • jezhjezh Member, Xamarin Team Xamurai

    Could you please post the full log of this error and the code of this function of playgame?

  • xam_donjoxam_donjo Member ✭✭
    Accepted Answer

    I tried application resources and dictionary, alongwith list but nothing was working. So I went with API calls to load the puzzles.

Sign In or Register to comment.