Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
ekke
Posts: 1,571
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

libspotify on BlackBerry10 would be cool

one of the apps my kids are missing on their BlackBerry10 is Spotify.

 

Spotify already provides some libraries, but not for BlackBerry10

 

https://developer.spotify.com/technologies/libspotify/

 

recently @DonTurner posted some threads on porting libraries,

so I asked him via Twitter to help

and here's the Thread ;-)

 

I'm a business app developer and I like Momentics IDE and Cascades,

so playing on the commandline or at C - level isn't really my domain ;-)

 

but if there would be a libspotify Library for BlackBerry 10 I can imagine to create an App for Spotify.


and hopefully other developers, too

 

curious to see what happens ...

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Developer
alecaserez
Posts: 18
Registered: ‎08-26-2012
My Device: Z10

Re: libspotify on BlackBerry10 would be cool

news? 

Retired
doturner
Posts: 35
Registered: ‎10-15-2013
My Device: BlackBerry Z30

Re: libspotify on BlackBerry10 would be cool

So, the question is: will one of the libspotify binaries work on BlackBerry 10?

 

Short answer: Not without some work

 

Long answer and testing method below:

 

I've taken a look at what's available for download and there are 2 packages which are of interest:

 

Each of these contains example source code under share/doc/libspotify/examples/. I figured that these would be a good place to start. The libspotify examples build system is recursive makefiles. My build environment is OSX.

 

First, I tried building the examples Android version. Here's the steps I went through:

 

cd share/doc/libspotify/examples
make CC=arm-unknown-nto-qnx8.0.0eabi-gcc LIBSPOTIFY_PATH=../../../..

This results in errors, the main one being:

 

ntox86-gcc: error: unrecognized option '-arch'

 

The QNX gcc doesn't support the -arch flag. Presumably the OSX version of gcc does, and the Makefile is configured only to use that. Lets fix that by editing common.mk. Comment out the following lines:

 

ifeq ($(shell uname),Darwin)
CPUARCH ?= $(shell uname -m)
CFLAGS += -D__APPLE__ -arch $(CPUARCH)
LDFLAGS += -arch $(CPUARCH)
endif

 

Now if we try to compile again we see errors regarding a missing API key in appkey.c. Just delete the contents of appkey.c (in the examples folder) by doing cat /dev/null > appkey.c. Note: To create a working app you need a Spotify Premium account in order to request an app key.

 

Try compiling again. Now we see the following error when compiling the jukebox example:

 

openal-audio.c:28:23: fatal error: OpenAL/al.h: No such file or directory.

 

The OpenAL headers should be on our include path (they can be found in $QNX_TARGET/usr/include/AL), but on BlackBerry they're found in the 'AL' folder not 'OpenAL'. We need to modify the source of jukebox/openal-audio.c.

Change:

 

#include <OpenAL/al.h>
#include <OpenAL/alc.h>

To

 

#include <AL/al.h>
#include <AL/alc.h>


Try compiling again (fun this, isn't it ;-). Now you'll get the following error:

 

arm-unknown-nto-qnx8.0.0eabi-gcc: error: OpenAL: No such file or directory

 

This is caused by the use of the -framework flag during the linking step. Presumably this is another flag which is supported by the OSX default compiler but is not by QNX gcc. We need to modify the jukebox/Makefile by changing the line:

 

LDFLAGS += -framework OpenAL

To

 

LDFLAGS += -lOpenAL

 

Try compiling again. You'll get this error:

 

... undefined reference to `listen'

This looks like something to do with networking. Modify common.mk to add the socket library:

 

LDLIBS += -lspotify -lsocket

Now we get a host of missing reference errors. I believe this is because Android uses a different C library to QNX. The likelihood is that there are workarounds. For example, the bsd_signal reference could probably be resolved using this file: https://chromium.googlesource.com/chromiumos/third_party/glibc/+/cvs/libc-961231/sysdeps/posix/bsd_s...But this is a bit beyond me.

 

I'll ask my colleagues if anyone can take this further.

 

BTW I ran into the same kind of issues with the Linux version only far more undefined references.

Developer
ekke
Posts: 1,571
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: libspotify on BlackBerry10 would be cool

Don,

 

great that you found some time to give libspotify a chance

 


doturner wrote:

So, the question is: will one of the libspotify binaries work on BlackBerry 10?

 

Short answer: Not without some work

 

...
Now we get a host of missing reference errors. I believe this is because Android uses a different C library to QNX. The likelihood is that there are workarounds. For example, the bsd_signal reference could probably be resolved using this file: https://chromium.googlesource.com/chromiumos/third_party/glibc/+/cvs/libc-961231/sysdeps/posix/bsd_s...
But this is a bit beyond me.

 

I'll ask my colleagues if anyone can take this further.

...

this all is more then a bit beyond me ;-)

so lets hope that your colleagues have some more ideas HowTo go on with Spotify.

 

thx again

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Contributor
cheechm
Posts: 26
Registered: ‎07-24-2009
My Device: Not Specified

Re: libspotify on BlackBerry10 would be cool

I know this is an old thread, but did the development of libspotify for BB10 ever get anywhere?