I have not tested it very well but the part I could test worked as expected
Note : after registering a deezer app at http://developers.deezer.com/ , edit it and add your b4a package name and save .
Deezer
Author: SMM
Version: 0.01
Sample :
DOWNLOAD
Update : Check this post https://www.b4x.com/android/forum/threads/deezer-partial-wrap.105986/#post-663668
Note : after registering a deezer app at http://developers.deezer.com/ , edit it and add your b4a package name and save .
Deezer
Author: SMM
Version: 0.01
- Album
- Functions:
- hasExplicitLyrics As Boolean
- Initialize (EventName As String)
- isAvailable As Boolean
- IsInitialized As Boolean
- hasExplicitLyrics As Boolean
- Properties:
- Artist As Artist [read only]
- BigImageUrl As String [read only]
- Contributors As Map [read only]
- Duration As Int [read only]
- Fans As Int [read only]
- Genres As List [read only]
- Id As Long [read only]
- ImageUrl As String [read only]
- Label As String [read only]
- Link As String [read only]
- MediumImageUrl As String [read only]
- NbTracks As Int [read only]
- Rating As Int [read only]
- RecordType As String [read only]
- ReleaseDate As Long [read only]
- SmallImageUrl As String [read only]
- Title As String [read only]
- Type As String [read only]
- Upc As String [read only]
- Artist As Artist [read only]
- Functions:
- AlbumPlayer
- Functions:
- addOnBufferErrorListener
- addOnBufferProgressListener
- addOnBufferStateChangeListener
- addOnPlayerErrorListener
- addOnPlayerProgressListener
- addOnPlayerStateChangeListener
- Initialize (EventName As String, deezerConnect As com.deezer.sdk.network.connect.DeezerConnect, wifionly As Boolean)
- IsInitialized As Boolean
- playAlbum (albumId As Long)
- playAlbum2 (albumId As Long, trackIndex As Int)
- release
- stop
- addOnBufferErrorListener
- Properties:
- CurrentTrackIndex As Int [read only]
- TrackDuration As Long [read only]
- CurrentTrackIndex As Int [read only]
- Functions:
- Artist
- Functions:
- hasRadio As Boolean
- Initialize (EventName As String)
- IsInitialized As Boolean
- hasRadio As Boolean
- Properties:
- BigImageUrl As String [read only]
- Id As Long [read only]
- Link As String [read only]
- MediumImageUrl As String [read only]
- Name As String [read only]
- NbAlbums As Int [read only]
- NbFans As Int [read only]
- SmallImageUrl As String [read only]
- Type As String [read only]
- BigImageUrl As String [read only]
- Functions:
- ArtistRadioPlayer
- Functions:
- Initialize (EventName As String, deezerConnect As com.deezer.sdk.network.connect.DeezerConnect, wifionly As Boolean)
- IsInitialized As Boolean
- Initialize (EventName As String, deezerConnect As com.deezer.sdk.network.connect.DeezerConnect, wifionly As Boolean)
- Functions:
- Deezer
- Fields:
- deezerConnect As com.deezer.sdk.network.connect.DeezerConnect
- PERMISSION_BASIC_ACCESS As String
- PERMISSION_DELETE_LIBRARY As String
- PERMISSION_EMAIL As String
- PERMISSION_LISTENING_HISTORY As String
- PERMISSION_MANAGE_COMMUNITY As String
- PERMISSION_MANAGE_LIBRARY As String
- PERMISSION_OFFLINE_ACCESS As String
- deezerConnect As com.deezer.sdk.network.connect.DeezerConnect
- Functions:
- authorize (permissions As String())
- Initialize (EventName As String, applicationID As String)
- requestAsync (artistID As Long, requestid As String)
- restoreSessionStore As Boolean
- saveSessionStore
- authorize (permissions As String())
- Fields:
- Episode
- Functions:
- Initialize (EventName As String)
- isAvailable As Boolean
- IsInitialized As Boolean
- Initialize (EventName As String)
- Properties:
- BigImageUrl As String [read only]
- Description As String [read only]
- Duration As Int [read only]
- EncodingBitRateKbps As Int [read only]
- Id As Long [read only]
- Link As String [read only]
- MediumImageUrl As String [read only]
- PreviewUrl As String [read only]
- ReleaseDate As Long [read only]
- SmallImageUrl As String [read only]
- StreamToken As String [read only]
- Title As String [read only]
- Type As String [read only]
- BigImageUrl As String [read only]
- Functions:
- PlaylistPlayer
- Fields:
- RADIOTYPE_ARTIST As Object
- RADIOTYPE_PLAYLIST As Object
- RADIOTYPE_RADIO As Object
- RADIOTYPE_USER As Object
- REPEATMODE_ALL As Object
- REPEATMODE_NONE As Object
- REPEATMODE_ONE As Object
- RADIOTYPE_ARTIST As Object
- Functions:
- addOnBufferErrorListener
- addOnBufferProgressListener
- addOnBufferStateChangeListener
- addOnPlayerErrorListener
- addOnPlayerProgressListener
- addOnPlayerStateChangeListener
- Initialize (EventName As String, deezerConnect As com.deezer.sdk.network.connect.DeezerConnect, wifionly As Boolean)
- IsInitialized As Boolean
- play
- playPlaylist (playlistId As Long)
- playPlaylist2 (playlistId As Long, trackIndex As Int)
- release
- skipToNextTrack As Boolean
- skipToPreviousTrack As Boolean
- skipToTrack (trackIndex As Int) As Boolean
- stop
- addOnBufferErrorListener
- Properties:
- RepeatMode As com.deezer.sdk.player.PlayerWrapper.RepeatMode [write only]
- TrackDuration As Long [read only]
- RepeatMode As com.deezer.sdk.player.PlayerWrapper.RepeatMode [write only]
- Fields:
- Podcast
- Functions:
- Initialize (EventName As String)
- isAvailable As Boolean
- IsInitialized As Boolean
- Initialize (EventName As String)
- Properties:
- BigImageUrl As String [read only]
- Fans As Int [read only]
- Id As Long [read only]
- Link As String [read only]
- MediumImageUrl As String [read only]
- Rating As Int [read only]
- SmallImageUrl As String [read only]
- Title As String [read only]
- Type As String [read only]
- BigImageUrl As String [read only]
- Functions:
- PodcastPlayer
- Fields:
- REPEATMODE_ALL As Object
- REPEATMODE_NONE As Object
- REPEATMODE_ONE As Object
- REPEATMODE_ALL As Object
- Functions:
- addOnBufferErrorListener
- addOnBufferProgressListener
- addOnBufferStateChangeListener
- addOnPlayerErrorListener
- addOnPlayerProgressListener
- addOnPlayerStateChangeListener
- Initialize (EventName As String, deezerConnect As com.deezer.sdk.network.connect.DeezerConnect, wifionly As Boolean)
- IsInitialized As Boolean
- playPodcast (podcastId As Long)
- playPodcast2 (podcastId As Long, trackIndex As Int)
- release
- skipToNextTrack As Boolean
- skipToPreviousTrack As Boolean
- skipToTrack (trackIndex As Int) As Boolean
- stop
- addOnBufferErrorListener
- Properties:
- CurrentEpisodeIndex As Int [read only]
- Episodes As List [read only]
- RepeatMode As com.deezer.sdk.player.PlayerWrapper.RepeatMode [write only]
- TrackDuration As Long [read only]
- CurrentEpisodeIndex As Int [read only]
- Fields:
- RadioPlayer
- Fields:
- RADIOTYPE_ARTIST As Object
- RADIOTYPE_PLAYLIST As Object
- RADIOTYPE_RADIO As Object
- RADIOTYPE_USER As Object
- REPEATMODE_ALL As Object
- REPEATMODE_NONE As Object
- REPEATMODE_ONE As Object
- RADIOTYPE_ARTIST As Object
- Functions:
- addOnBufferErrorListener
- addOnBufferProgressListener
- addOnBufferStateChangeListener
- addOnPlayerErrorListener
- addOnPlayerProgressListener
- addOnPlayerStateChangeListener
- Initialize (EventName As String, deezerConnect As com.deezer.sdk.network.connect.DeezerConnect, wifionly As Boolean)
- IsInitialized As Boolean
- play
- playRadio (type As com.deezer.sdk.player.RadioPlayer.RadioType, radioId As Long)
- release
- skipToNextTrack As Boolean
- skipToPreviousTrack As Boolean
- skipToTrack (trackIndex As Int) As Boolean
- stop
- addOnBufferErrorListener
- Properties:
- RepeatMode As com.deezer.sdk.player.PlayerWrapper.RepeatMode [write only]
- TrackDuration As Long [read only]
- RepeatMode As com.deezer.sdk.player.PlayerWrapper.RepeatMode [write only]
- Fields:
- TrackPlayer
- Fields:
- RADIOTYPE_ARTIST As Object
- RADIOTYPE_PLAYLIST As Object
- RADIOTYPE_RADIO As Object
- RADIOTYPE_USER As Object
- REPEATMODE_ALL As Object
- REPEATMODE_NONE As Object
- REPEATMODE_ONE As Object
- RADIOTYPE_ARTIST As Object
- Functions:
- addOnBufferErrorListener
- addOnBufferProgressListener
- addOnBufferStateChangeListener
- addOnPlayerErrorListener
- addOnPlayerProgressListener
- addOnPlayerStateChangeListener
- Initialize (EventName As String, deezerConnect As com.deezer.sdk.network.connect.DeezerConnect, wifionly As Boolean)
- IsInitialized As Boolean
- play
- playEpisode (trackId As Long)
- playTrack (trackId As Long)
- release
- skipToNextTrack As Boolean
- skipToPreviousTrack As Boolean
- skipToTrack (trackIndex As Int) As Boolean
- stop
- addOnBufferErrorListener
- Properties:
- RepeatMode As com.deezer.sdk.player.PlayerWrapper.RepeatMode [write only]
- TrackDuration As Long [read only]
- RepeatMode As com.deezer.sdk.player.PlayerWrapper.RepeatMode [write only]
- Fields:
Sample :
B4X:
#Region Project Attributes
#ApplicationLabel: deezer Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim deeze As Deezer
Dim lis As ListView
Private ids As List
Dim p As AlbumPlayer
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")Me,.AsView
ids.Initialize
lis.Initialize("list")
Activity.AddView(lis,0,0,-1,-1)
deeze.Initialize("deez", "yourapplicationidhere")
If deeze.restoreSessionStore Then
Log("Restored")
StartActivity(Me )
getAlbums
Else
Log("Not restored")
deeze.authorize(Array As String(deeze.PERMISSION_BASIC_ACCESS,deeze.PERMISSION_MANAGE_LIBRARY,deeze.PERMISSION_LISTENING_HISTORY))
End If
End Sub
Sub list_itemclick(position As Int,value As Object)
p.playAlbum(ids.Get(position))
End Sub
Sub getAlbums
deeze.requestAsync(11472,"myRequest")
End Sub
Sub deez_onresult(albums As List)
For a = 0 To albums.Size-1
Dim al As Album = albums.Get(a)
lis.AddTwoLines(al.Title,al.Label)
ids.Add(al.Id)
Next
p.Initialize("p",deeze.deezerConnect,True)
p.addOnPlayerStateChangeListener
End Sub
Sub p_onplayerstatechange(state As String,timePosition As Long)
Log("Playerstate: "&state& " time: "&timePosition)
End Sub
Sub deez_oncomplete(accesstoken As String , expires As String)
Log(accesstoken&" expires : "&expires)
deeze.saveSessionStore
getAlbums
End Sub
Sub deez_oncancel
Log("deez_oncancel")
End Sub
Sub deez_onexception(err As String)
Log(err)
End Sub
Sub Activity_Resume
deeze.restoreSessionStore
End Sub
Sub Activity_Pause (UserClosed As Boolean)
If UserClosed Then
p.stop
p.release
End If
End Sub
DOWNLOAD
Update : Check this post https://www.b4x.com/android/forum/threads/deezer-partial-wrap.105986/#post-663668
Last edited: