Starting from your code, assuming it works like that already:
// Append character to textView here
JSONArray jsonArray = response.getJSONArray("requested_information");
ArrayList<String> characters = new ArrayList<String>();
for(int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
// Append character to textView here
String cha = jsonObject.getString("character");
characters.push(cha);
}
Random rand = new Random(); // set up our random number generator
int numberOfChars = characters.length;
// Generate random integer in range 0 to number of characters - 1
int randomCharacterIndex = rand.nextInt(characters.length); // boundary is exclusive
String randomCharacter = characters.get(randomCharacterIndex);
vocab.append(randomCharacter);
Note: i didn’t test this, and it’s been a while since i coded in Java.
Scripts are (relatively) simple and short pieces of software code, usually in a single file, which is the difference to software code in general (usually more files, more complex). Though there are a few pretty complex scripts for Wanikani.
In the context of the Wanikani, userscripts modify the Wanikani website to show you more information, give you better controls, etc.
But in this thread, we’re actually talking about Software Code (making programs) external to Wanikani, in this case to show you random burned vocabulary items in an external program for you to review.