• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Is there any way to validate this type of data in android?

{
"success": "0",
"post": {
"username": [
"The username has already been taken."
],
"email": [
"The email has already been taken."
]
}
}
 
Depends what you mean by validate? The data looks like JSON. There is certainly a JSON parser that can be used to validate syntactic correctness.
As for semantic checking i.e. does the data make sense (and does it have correct values) to your application, then you'll have to write code to do that, by examining what is in the data structure.

There's some help on parsing JSON data structures here

https://www.tutorialspoint.com/android/android_json_parser.htm
 
Back
Top Bottom