So I wanted to integrate the spotify library into an android app. I went to https://developer.spotify.com/technologies/libspotify/ and downloaded their lib libspotify-12.1.51-Android-arm-release.tar.gz Problem is that the "Android" samples bundled with the lib aren't actually android projects, they are C code, the lib is a .so file. I have basic knowledge of android ndk and jni but the documentation out there about integrating the library with android is non-existent. Can anyone provide a sample of just playing a track? or point me to where i can find a sample.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Is there a way to play audio on a mobile browser w
- Listening to outgoing sms not working android
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Spotify have announced that they released the Android SDK(https://developer.spotify.com/technologies/spotify-android-sdk/).
And the tutorial is here(https://developer.spotify.com/technologies/spotify-android-sdk/tutorial/), so you can easily integrate Spotify into your Android application.
Have a look at this sample project doing libspotify on Android: https://github.com/spotify/psyonspotify
As documented in the README:
Looking at the code gives you some insight in:
Unfortunately, Spotify doesn't have a nice Java library for Android (see this StackOverflow question for more details), so you'll have to manually write a JNI wrapper. As the Android build of libspotify is pretty new, there aren't yet any examples for that either, but I wouldn't be surprised to see the documentation include them soon.
As @juned noted in his comment, this question details how to get the libspotify libraries linked with your Android app. Once you get libspotify linked correctly, you can check out a few Android NDK tutorials for more specific integration help.
If you have troubles during your integration, be sure to check out the example code which Spotify ships with libspotify. The code provides a good reference of how to properly talk with the Spotify service with the library.
Spotify have published a SDK BETA version for android.
https://github.com/spotify/android-sdk
They have a few examples of initializing a player and playing a track using TRACK_CHANGE event (Only available from Beta10). Here is one that doesn't use TRACK_CHANGE:
(Took the code from the tutorial - https://developer.spotify.com/technologies/spotify-android-sdk/tutorial/)