0

I am building a small app that lists some books using Google book API. when I make a request I got that answer with [ and ". I want to remove them

Darwind
  • 7,284
  • 3
  • 49
  • 48

2 Answers2

1

In the adapter You should replace each character you don't need with space like this:

list.get(i).getName().replace("[","");

For a more specific answer, please post your Jason.

Update: [] in Json is JsonArray and {} is for JsonObject. So you should parse your Jso correctly using Gson or any other library you are using.

Elmira Frhn
  • 320
  • 4
  • 14
1

As in the JSON that you attached, the object►items►0►volumeInfo►authors is a JsonArray and same for object►items►0►volumeInfo►categories►

So you need to parse authors and categories into an array of Strings and display the first object of the array in your UI

Molly
  • 1,887
  • 3
  • 17
  • 34