kaaes.spotify.webapi.android.models.ArtistsPager Java Examples

The following examples show how to use kaaes.spotify.webapi.android.models.ArtistsPager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MainActivity.java    From android-web-api-sample with Apache License 2.0 5 votes vote down vote up
@Override
protected Void doInBackground(Void... strings) {
    SpotifyApi api = new SpotifyApi();
    SpotifyService service = api.getService();

    ArtistsPager results = service.searchArtists("Paul");
    List<Artist> artists = results.artists.items;
    for (int i = 0; i < artists.size(); i++) {
        Artist artist = artists.get(i);
        Log.i(LOG_TAG, i + " " + artist.name);
    }
    return null;
}
 
Example #2
Source File: SpotifyServiceTest.java    From spotify-web-api-android with MIT License 5 votes vote down vote up
@Test
public void shouldGetSearchedArtists() throws IOException {
    String body = TestUtils.readTestData("search-artist.json");
    ArtistsPager fixture = mGson.fromJson(body, ArtistsPager.class);

    Response response = TestUtils.getResponseFromModel(fixture, ArtistsPager.class);
    when(mMockClient.execute(isA(Request.class))).thenReturn(response);

    ArtistsPager result = mSpotifyService.searchArtists("Christmas");
    compareJSONWithoutNulls(body, result);
}
 
Example #3
Source File: ParcelableModelsTest.java    From spotify-web-api-android with MIT License 4 votes vote down vote up
ArrayList<Class<? extends Parcelable>> getModelClasses() {
    return Lists.newArrayList(
            Album.class,
            Albums.class,
            AlbumSimple.class,
            AlbumsPager.class,
            Artist.class,
            Artists.class,
            ArtistSimple.class,
            ArtistsPager.class,
            AudioFeaturesTrack.class,
            AudioFeaturesTracks.class,
            CategoriesPager.class,
            Category.class,
            Copyright.class,
            ErrorDetails.class,
            ErrorResponse.class,
            FeaturedPlaylists.class,
            Followers.class,
            Image.class,
            LinkedTrack.class,
            NewReleases.class,
            Playlist.class,
            PlaylistFollowPrivacy.class,
            PlaylistSimple.class,
            PlaylistsPager.class,
            PlaylistTrack.class,
            PlaylistTracksInformation.class,
            Recommendations.class,
            Result.class,
            Seed.class,
            SeedsGenres.class,
            SavedTrack.class,
            SnapshotId.class,
            Track.class,
            Tracks.class,
            TrackSimple.class,
            TracksPager.class,
            TrackToRemove.class,
            TrackToRemoveWithPosition.class,
            TracksToRemove.class,
            TracksToRemoveWithPosition.class,
            UserPrivate.class,
            UserPublic.class
    );
}
 
Example #4
Source File: SpotifyService.java    From spotify-web-api-android with MIT License 2 votes vote down vote up
/**
 * Get Spotify catalog information about artists that match a keyword string.
 *
 * @param q        The search query's keywords (and optional field filters and operators), for example "roadhouse+blues"
 * @param callback Callback method.
 * @see <a href="https://developer.spotify.com/web-api/search-item/">Search for an Item</a>
 */
@GET("/search?type=artist")
void searchArtists(@Query("q") String q, Callback<ArtistsPager> callback);
 
Example #5
Source File: SpotifyService.java    From spotify-web-api-android with MIT License 2 votes vote down vote up
/**
 * Get Spotify catalog information about artists that match a keyword string.
 *
 * @param q The search query's keywords (and optional field filters and operators), for example "roadhouse+blues"
 * @return A paginated list of results
 * @see <a href="https://developer.spotify.com/web-api/search-item/">Search for an Item</a>
 */
@GET("/search?type=artist")
ArtistsPager searchArtists(@Query("q") String q);
 
Example #6
Source File: SpotifyService.java    From spotify-web-api-android with MIT License 2 votes vote down vote up
/**
 * Get Spotify catalog information about artists that match a keyword string.
 *
 * @param q        The search query's keywords (and optional field filters and operators), for example "roadhouse+blues"
 * @param options  Optional parameters. For list of supported parameters see
 *                 <a href="https://developer.spotify.com/web-api/search-item/">endpoint documentation</a>
 * @param callback Callback method.
 * @see <a href="https://developer.spotify.com/web-api/search-item/">Search for an Item</a>
 */
@GET("/search?type=artist")
void searchArtists(@Query("q") String q, @QueryMap Map<String, Object> options, Callback<ArtistsPager> callback);
 
Example #7
Source File: SpotifyService.java    From spotify-web-api-android with MIT License 2 votes vote down vote up
/**
 * Get Spotify catalog information about artists that match a keyword string.
 *
 * @param q       The search query's keywords (and optional field filters and operators), for example "roadhouse+blues"
 * @param options Optional parameters. For list of supported parameters see
 *                <a href="https://developer.spotify.com/web-api/search-item/">endpoint documentation</a>
 * @return A paginated list of results
 * @see <a href="https://developer.spotify.com/web-api/search-item/">Search for an Item</a>
 */
@GET("/search?type=artist")
ArtistsPager searchArtists(@Query("q") String q, @QueryMap Map<String, Object> options);