I’m having trouble in making unrepeating random images on my Android App.
Let’s say on my App I have this ‘TOP 3’ Sections, and I have a JSON file on the web which stores the URL of the images, the variable of the image URL is ‘smallImageUrl’.
So there aren’t certain amount of images on the array, because I can delete/add the entry on the JSON file whenever I want.
I need a method to generate 3 random images from the JSON File I have, but the 3 pictures should be different from one another.
I’m open to any kind of solution. I can provide my codes if you need it as a reference.
Thank you.
You can put all images to an ArrayList by parsing JSON, then you can select a random url by using
If you execute this three times, you will get three different random image urls