Giter VIP home page Giter VIP logo

android-1-week-6-music-searc's Introduction

Week 6 - Music Search

MusicSearch assignment:

The goal of this assignment is to review using Retrofit and Gson...

  1. Make a class representing an object from the server Example from week 5
  2. Create an interface representing all methods on the server Example from week 4
  3. Building an instance of Retrofit with a custom Gson Example from week 5
  4. Adding a custom json deserializer for a specific class. Example from week 5

For this assignment you will finishing an app that searches using the iTunes Search Api. You can see an example of the api results below. You will use a custom deserializer to map this response type to the ItunesSearchResults object. You will also create an ItunesSongItem. You do not need to add every field returned by the api, just the ones in the SongItem interface.

https://itunes.apple.com/search?media=music&limit=25&term=Taylor

Note: Anything a url after the ? is considered a query param. In this case the url has 3 query params: media, limit, and term. If you want to add a dynamic query param in a Retrofit interface you can use the @Query("...") annotation String param passed to the method and it will be added to the url.

{
  "resultCount": 1,
  "results": [
    {
      "wrapperType": "track",
      "kind": "song",
      "artistId": 159260351,
      "collectionId": 295757174,
      "trackId": 295757188,
      "artistName": "Taylor Swift",
      "collectionName": "Fearless",
      "trackName": "Love Story",
      "collectionCensoredName": "Fearless",
      "trackCensoredName": "Love Story",
      "artistViewUrl": "https://itunes.apple.com/us/artist/taylor-swift/159260351?uo=4",
      "collectionViewUrl": "https://itunes.apple.com/us/album/love-story/295757174?i=295757188&uo=4",
      "trackViewUrl": "https://itunes.apple.com/us/album/love-story/295757174?i=295757188&uo=4",
      "previewUrl": "https://audio-ssl.itunes.apple.com/apple-assets-us-std-000001/Music/8d/7f/d5/mzm.yppdvtoz.aac.p.m4a",
      "artworkUrl30": "https://is4-ssl.mzstatic.com/image/thumb/Music/v4/ae/35/ac/ae35ac3b-5c14-818e-a54c-a1f73ef13c54/source/30x30bb.jpg",
      "artworkUrl60": "https://is4-ssl.mzstatic.com/image/thumb/Music/v4/ae/35/ac/ae35ac3b-5c14-818e-a54c-a1f73ef13c54/source/60x60bb.jpg",
      "artworkUrl100": "https://is4-ssl.mzstatic.com/image/thumb/Music/v4/ae/35/ac/ae35ac3b-5c14-818e-a54c-a1f73ef13c54/source/100x100bb.jpg",
      "collectionPrice": 7.99,
      "trackPrice": 1.29,
      "releaseDate": "2008-09-12T07:00:00Z",
      "collectionExplicitness": "notExplicit",
      "trackExplicitness": "notExplicit",
      "discCount": 1,
      "discNumber": 1,
      "trackCount": 13,
      "trackNumber": 3,
      "trackTimeMillis": 235267,
      "country": "USA",
      "currency": "USD",
      "primaryGenreName": "Country",
      "isStreamable": true
    }
  ]
}

Requirements:

  • Complete the ItunesSongItem class
  • Add a method to ItunesApi in the DataSources class that takes in a search query and returns a Call
  • Create an instance of Gson with a custom type adapter for the ItunesSearchResults class
  • Create an instance of the ItunesApi using Retrofit
  • Finish implementing the DataSources.search() method

Image

android-1-week-6-music-searc's People

Contributors

rjaylwar avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.