kotlin jsonobject get nested
Java
val jsonString = """
{
"urls": {
"raw": "https://images.unsplash.com/photo-1461988320302-91bde64fc8e4?ixid=2yJhcHBfaWQiOjEyMDd9",
"full": "https://images.unsplash.com/photo-1461988320302-91bde64fc8e4?ixid=2yJhcHBfaWQiOjEyMDd9&fm=jpg&q=80",
"regular": "https://images.unsplash.com/photo-1461988320302-91bde64fc8e4?ixid=2yJhcHBfaWQiOjEyMDd9&fm=jpg&fit=crop&w=1080&q=80&fit=max",
"small": "https://images.unsplash.com/photo-1461988320302-91bde64fc8e4?ixid=2yJhcHBfaWQiOjEyMDd9&&fm=jpg&w=400&fit=max",
"thumb": "https://images.unsplash.com/photo-1461988320302-91bde64fc8e4?ixid=2yJhcHBfaWQiOjEyMDd9&fm=jpg&w=200&fit=max"
}
}
""".trimIndent()
val json = JSONObject(jsonString)
val rawUrl = json.getJSONObject("urls").getString("raw")
Also in Java:
- Title
- final variables in java
- Category
- Java
- Title
- java how to make a gui
- Category
- Java
- Title
- how to write sensor data into file android studio
- Category
- Java
- Title
- java find duplicates in array
- Category
- Java
- Title
- how to play a clip of audio in java when needed
- Category
- Java
- Title
- java loop through array
- Category
- Java
- Title
- count number of matches in two strings java
- Category
- Java
- Title
- Scanner library showing element not found exception
- Category
- Java
- Title
- height constraint layout guideline
- Category
- Java
- Title
- spigot actionbar
- Category
- Java
- Title
- random code
- Category
- Java
- Title
- how to get witdth of window android
- Category
- Java
- Title
- java method
- Category
- Java
- Title
- Java array nested equals
- Category
- Java
- Title
- java pass arraylist by value
- Category
- Java
- Title
- how to create an action listener in java
- Category
- Java
- Title
- java sort method
- Category
- Java
- Title
- gson parse json
- Category
- Java
- Title
- java manacher's algorithm
- Category
- Java
- Title
- random java
- Category
- Java
- Title
- how to read file from assets folder in android
- Category
- Java
- Title
- java define custom exception
- Category
- Java
- Title
- how to split a string in java
- Category
- Java
- Title
- java script zip function
- Category
- Java
- Title
- how to get elements of a list in java
- Category
- Java
- Title
- check if object is empty java 8
- Category
- Java
- Title
- change the value in a hashtable java
- Category
- Java
- Title
- 2d array length in java
- Category
- Java
- Title
- compile java
- Category
- Java
- Title
- android studio keep device awake
- Category
- Java
- Title
- kotlin android intent pass data
- Category
- Java
- Title
- java create a set with values
- Category
- Java
- Title
- how to use lambda in java
- Category
- Java
- Title
- nikita kaksharov
- Category
- Java
- Title
- iterate hashmap java
- Category
- Java
- Title
- java min function
- Category
- Java
- Title
- java creare costante
- Category
- Java
- Title
- java list to set
- Category
- Java
- Title
- serialversionuid java
- Category
- Java
- Title
- array null pointer java
- Category
- Java
- Title
- java 8 iterating and manipulating list
- Category
- Java
- Title
- open an existing excel file in java apache poi
- Category
- Java
- Title
- java parse xml string
- Category
- Java
- Title
- room insert and return id
- Category
- Java
- Title
- java while
- Category
- Java
- Title
- java string reverse
- Category
- Java
- Title
- java for
- Category
- Java
- Title
- The specified child already has a parent. You must call removeView() on the child's parent first
- Category
- Java
- Title
- query java persistence
- Category
- Java
- Title
- how to scan a character in java
- Category
- Java
- Title
- spigot title
- Category
- Java
- Title
- spring code in java
- Category
- Java
- Title
- trim() and split() in java
- Category
- Java
- Title
- number to string java
- Category
- Java
- Title
- Spring Security JWT Authentication + PostgreSQL – RestAPIs SpringBoot + Spring MVC + Spring JPA
- Category
- Java
- Title
- partial view tiles spring
- Category
- Java
- Title
- how to call a static method in java
- Category
- Java
- Title
- java loop through map
- Category
- Java
- Title
- java initialize float to zero
- Category
- Java
- Title
- print out value java
- Category
- Java
- Title
- how to stop a void java
- Category
- Java
- Title
- java 8 collect multiple lists into single list
- Category
- Java
- Title
- changing double space to single in java script
- Category
- Java
- Title
- java check for string length
- Category
- Java
- Title
- LocalRegistry java rebind() java8
- Category
- Java
- Title
- converter int array para string java
- Category
- Java
- Title
- file with line numbers inserted java
- Category
- Java
- Title
- change number into array in java
- Category
- Java
- Title
- how to copy list item to another list in java
- Category
- Java
- Title
- java prev_permutation
- Category
- Java
- Title
- convert string to localdatetime
- Category
- Java
- Title
- initialize arraylist
- Category
- Java
- Title
- find the day of the week Calendar class in java
- Category
- Java
- Title
- java set value of arraylist
- Category
- Java
- Title
- java convert edittext to double
- Category
- Java
- Title
- test function that call a function javascrip
- Category
- Java
- Title
- foreach in java
- Category
- Java
- Title
- how to ask user for his location in android
- Category
- Java
- Title
- firebase connecten
- Category
- Java
- Title
- add in list java
- Category
- Java
- Title
- how to collect objective in java
- Category
- Java
- Title
- sending a excel in an attachment in email java
- Category
- Java
- Title
- select photo from camera android
- Category
- Java
- Title
- java binary exponentiation
- Category
- Java
- Title
- mutable string in java
- Category
- Java
- Title
- java read from file
- Category
- Java
- Title
- java hashmap size
- Category
- Java
- Title
- string to arraylist convert java
- Category
- Java
- Title
- iterator for array java
- Category
- Java
- Title
- java script dynamic varibale creation
- Category
- Java
- Title
- java generate list of random element
- Category
- Java
- Title
- android how to switch between activities
- Category
- Java
- Title
- Jlabel icon
- Category
- Java
- Title
- How to do press enter to continue in java
- Category
- Java
- Title
- butterfly pattern program in java
- Category
- Java
- Title
- how to add strings in java
- Category
- Java
- Title
- how to get the screen dimensions in java
- Category
- Java
- Title
- run java program maven
- Category
- Java
- Title
- java observable to observer stack overflow
- Category
- Java
- Title
- init cap java
- Category
- Java