Search code examples
c#unity-game-enginespotifylibspotify

How do I access Spotify API from my Unity Android App?


Nowadays I have a Unity App that runs in Android and it has some background music that is inside the project. Now I need to change that, and get the music from Spotify using their API. Any clues on how to do that? Thanks in advance! :)


Solution

  • Will have to do a bit of reading but it's indeed pretty feasible.

    First try to fiddle with the Spotify Android API and do the beginner tutorial.

    Then read through Unity's Getting Started with Android Development. You'll need to get yourself around writing Java plugins for Unity (it's described in the documentation).

    Once you master that learn how to export your project from Unity to Android Studio. This is optional, though. But if you want to go full pro than yes you should know how to handle Unity build instead of letting Unity handle your plugins (which usually causes a lot of problems for beginners like ClassNotFoundException). In this way you can keep your plugins in Android Project which makes their integration and debugging so much simpler.

    Hope it helps! ^_^