измените ваш интерфейс следующим образом ..
public interface SpotifyPlayerApi {
@GET("v1/me/player/currently-playing")
Call<APiResponse> getCurrentlyPlaying();
}
и добавьте следующие классы моделей , надеюсь, это решит вашу проблему.для создания pojo я использую этот , вы можете попробовать это сами.
public class APiResponse{
private String currently_playing_type;
private Item item;
private Context context;
private String is_playing;
private String progress_ms;
private String timestamp;
public String getCurrently_playing_type ()
{
return currently_playing_type;
}
public void setCurrently_playing_type (String currently_playing_type)
{
this.currently_playing_type = currently_playing_type;
}
public Item getItem ()
{
return item;
}
public void setItem (Item item)
{
this.item = item;
}
public Context getContext ()
{
return context;
}
public void setContext (Context context)
{
this.context = context;
}
public String getIs_playing ()
{
return is_playing;
}
public void setIs_playing (String is_playing)
{
this.is_playing = is_playing;
}
public String getProgress_ms ()
{
return progress_ms;
}
public void setProgress_ms (String progress_ms)
{
this.progress_ms = progress_ms;
}
public String getTimestamp ()
{
return timestamp;
}
public void setTimestamp (String timestamp){
this.timestamp = timestamp;
}
}
Модель товара
public class Item{
private String disc_number;
private Album album;
private String[] available_markets;
private String type;
private External_ids external_ids;
private String uri;
private String duration_ms;
private String explicit;
private Artists[] artists;
private String preview_url;
private String popularity;
private String name;
private String track_number;
private String href;
private String id;
private External_urls external_urls;
public String getDisc_number ()
{
return disc_number;
}
public void setDisc_number (String disc_number)
{
this.disc_number = disc_number;
}
public Album getAlbum ()
{
return album;
}
public void setAlbum (Album album)
{
this.album = album;
}
public String[] getAvailable_markets ()
{
return available_markets;
}
public void setAvailable_markets (String[] available_markets)
{
this.available_markets = available_markets;
}
public String getType ()
{
return type;
}
public void setType (String type)
{
this.type = type;
}
public External_ids getExternal_ids ()
{
return external_ids;
}
public void setExternal_ids (External_ids external_ids)
{
this.external_ids = external_ids;
}
public String getUri ()
{
return uri;
}
public void setUri (String uri)
{
this.uri = uri;
}
public String getDuration_ms ()
{
return duration_ms;
}
public void setDuration_ms (String duration_ms)
{
this.duration_ms = duration_ms;
}
public String getExplicit ()
{
return explicit;
}
public void setExplicit (String explicit)
{
this.explicit = explicit;
}
public Artists[] getArtists ()
{
return artists;
}
public void setArtists (Artists[] artists)
{
this.artists = artists;
}
public String getPreview_url ()
{
return preview_url;
}
public void setPreview_url (String preview_url)
{
this.preview_url = preview_url;
}
public String getPopularity ()
{
return popularity;
}
public void setPopularity (String popularity)
{
this.popularity = popularity;
}
public String getName ()
{
return name;
}
public void setName (String name)
{
this.name = name;
}
public String getTrack_number ()
{
return track_number;
}
public void setTrack_number (String track_number)
{
this.track_number = track_number;
}
public String getHref ()
{
return href;
}
public void setHref (String href)
{
this.href = href;
}
public String getId ()
{
return id;
}
public void setId (String id)
{
this.id = id;
}
public External_urls getExternal_urls ()
{
return external_urls;
}
public void setExternal_urls (External_urls external_urls)
{
this.external_urls = external_urls;
}
}
Модель External_urls
public class External_urls{
private String spotify;
public String getSpotify ()
{
return spotify;
}
public void setSpotify (String spotify)
{
this.spotify = spotify;
}
}
External_ids Модель
public class External_ids{
private String isrc;
public String getIsrc ()
{
return isrc;
}
public void setIsrc (String isrc)
{
this.isrc = isrc;
}
}
Художники Модель
public class Artists{
private String name;
private String href;
private String id;
private String type;
private External_urls external_urls;
private String uri;
public String getName ()
{
return name;
}
public void setName (String name)
{
this.name = name;
}
public String getHref ()
{
return href;
}
public void setHref (String href)
{
this.href = href;
}
public String getId ()
{
return id;
}
public void setId (String id)
{
this.id = id;
}
public String getType ()
{
return type;
}
public void setType (String type)
{
this.type = type;
}
public External_urls getExternal_urls ()
{
return external_urls;
}
public void setExternal_urls (External_urls external_urls)
{
this.external_urls = external_urls;
}
public String getUri ()
{
return uri;
}
public void setUri (String uri)
{
this.uri = uri;
}
}
АльбомМодель
public class Album{
private Images[] images;
private String name;
private String album_type;
private String href;
private String id;
private String type;
private External_urls external_urls;
private String uri;
public Images[] getImages ()
{
return images;
}
public void setImages (Images[] images)
{
this.images = images;
}
public String getName ()
{
return name;
}
public void setName (String name)
{
this.name = name;
}
public String getAlbum_type ()
{
return album_type;
}
public void setAlbum_type (String album_type)
{
this.album_type = album_type;
}
public String getHref ()
{
return href;
}
public void setHref (String href)
{
this.href = href;
}
public String getId ()
{
return id;
}
public void setId (String id)
{
this.id = id;
}
public String getType ()
{
return type;
}
public void setType (String type)
{
this.type = type;
}
public External_urls getExternal_urls ()
{
return external_urls;
}
public void setExternal_urls (External_urls external_urls)
{
this.external_urls = external_urls;
}
public String getUri ()
{
return uri;
}
public void setUri (String uri)
{
this.uri = uri;
}
}
Изображения Модель
public class Images{
private String width;
private String url;
private String height;
public String getWidth ()
{
return width;
}
public void setWidth (String width)
{
this.width = width;
}
public String getUrl ()
{
return url;
}
public void setUrl (String url)
{
this.url = url;
}
public String getHeight ()
{
return height;
}
public void setHeight (String height)
{
this.height = height;
}
}
Модель контекста
public class Context{
private String href;
private String type;
private External_urls external_urls;
private String uri;
public String getHref ()
{
return href;
}
public void setHref (String href)
{
this.href = href;
}
public String getType ()
{
return type;
}
public void setType (String type)
{
this.type = type;
}
public External_urls getExternal_urls ()
{
return external_urls;
}
public void setExternal_urls (External_urls external_urls)
{
this.external_urls = external_urls;
}
public String getUri ()
{
return uri;
}
public void setUri (String uri)
{
this.uri = uri;
}
}