Showing posts with label PlayBook. Show all posts
Showing posts with label PlayBook. Show all posts

Sunday, February 12, 2012

Making the Leap to Music on BlackBerry

Disclaimer

So you bought a PlayBook on a screaming deal.  Excellent, and thanks, I work at BlackBerry and appreciate your faith in us.  Like you I am a user of BlackBerry products as well and I work with Media (specifically Media syncing).  I write this blog post from the point of view of a BlackBerry user, not an employee, so don't take this as official from Research In Motion (the makers of BlackBerry).

Purchased Music and Your PlayBook

Perhaps like me you have been using iTunes for years to purchase music.  iTunes has been a great source of content as I have moved from physical media to digital content.  I won't talk about the BlackBerry options for syncing your iTunes library to your PlayBook but take a look at the BlackBerry Desktop Software if you'd like to do this.

What I want to talk about today is making the leap to purchasing music on your BlackBerry PlayBook and show you how easy it is to do.

First, swipe up your PlayBook and go to the Music Store app.

Next register a new account (and your credit card with 7 Digital) if you need to, or login to your account.  To get to your account swipe down to get to the "Options".

Purchase some music and you are done for purchasing music.

ReDownloading My Music Later (ie. Do I lose my music if my PlayBook gets wiped?)

Ok, easy, but let's talk about losing your music.  Like what if you had to reset your PlayBook.  Losing Music is not Cool!  (Note, I have never had to reset my PlayBook, I am just using it as an example, I could also say what if it was stolen, lost, you bought a 2nd BlackBerry, etc.)

No problem.  When you are your PlayBook setup after wiping it, or maybe after setting up your 2nd PlayBook, let's get your Music back onto your PlayBook.

Open the Music Store again.


Now choose the "My Purchases" tab to see your past purchases:

Cool, there's your Music.  Let's select my Flash Gordon soundtrack...

"Flash Ah AH...Savior Of The Universe!"....ah, sorry, where were we.  Right, downloading my previously purchased music.

This being Flash let's download the entire album by selecting the Download button under the artwork.

Sweet, here comes Flash.

What if I have a 2nd Device like another PlayBook or a BlackBerry Bold?

No problem.  On the 2nd PlayBook:
  • Do the above.
On the BlackBerry Bold (or Curve or any BlackBerry that has the 7 Digital Music Store App):
  • If the 7 Digital App is not installed on your phone, go to the App World app and search for 7 Digital.
  • Download the app.
  • Setup your 7 Digital account.
  • Download you music.
Purchasing and using music on your BlackBerrys is easy and you can rest assured that you can get your music later when you want it on a new device.


Read More About

Friday, November 18, 2011

Configuring the liboauth C Library for PlayBook

Overview



You've decided to write a PlayBook App with the NDK (Native Development Kit). That's awesome, let's learn how to port an OSS library you want to use in your new app.

For those of you who are ./configure experts, please point out anything I have wrong or maybe could do differently which might make this easier.

Ok so first off, I am not a ./configure expert but I am perfectly willing to beat my head against the compiling and linking wall until I get something that works.

Some prerequisites:
  • I am on a Mac, switching between a Snow Leopard and a Lion box. So this should work for either. If you are on Windows, please feel free to fork my post and write up how you did this on Windows. If you do, then please refer back here for the Mac Devs who find your site.
  • I expect that you have installed the BlackBerry Tablet OS NDK in the default locations.
  • I am using 2 PlayBooks for testing. One running 1.0.7 and one running 2.0. You can expect this to work for either, if not let me know and I will verify that it is working no the latest OS.
  • You know what the Terminal.app is and aren't afraid to use it.
Let's get started.

Porting liboauth (http://liboauth.sourceforge.net/)

I choose liboauth since it involved the least amount of work for the library's I have been working with. I built liboath-0.9.4 for PlayBook. I only built the device (arm) version since I am not using the simulator; I like to test on the metal; but with some minor variations to the options it should not be hard to get a simulator compatible version built.

First: Set the environment for building

To do this source the NDK included environment script:
source /Developer/SDKs/bbndk-1.0/bbndk-env.sh
This should setup your environment for the QNX compiler so we can build for the PlayBook. Here is what that looks like (at time of writing):
QNX_TARGET="/Developer/SDKs/bbndk-1.0/target/qnx6"
QNX_HOST="/Developer/SDKs/bbndk-1.0/host/macosx/x86"
QNX_CONFIGURATION="/Users/YOUR_USERNAME_HERE/Applications/Library/Research In Motion/BlackBerry Native SDK"
MAKEFLAGS="-I$QNX_TARGET/usr/include"
DYLD_LIBRARY_PATH="/Developer/SDKs/bbndk-1.0/host/macosx/x86/usr/lib:$DYLD_LIBRARY_PATH"
PATH="$QNX_HOST/usr/bin:$QNX_HOST/usr/qde/eclipse/jre/bin:$PATH"
export QNX_TARGET QNX_HOST QNX_CONFIGURATION MAKEFLAGS DYLD_LIBRARY_PATH PATH

Second: Modify the config.sub to include the CPU instruction set for ARMv7

When we set the target and host in the ./configure command we will be using the PlayBook CPU type of armv7, we will need to add that to the config.sub since it is missing from liboauth's config.sub. I did this by searching for armv, where you will find and switch out the line shown in the following diff, notice I just added 7 into the armv[2345] statement:
diff --git a/config.sub b/config.sub
index c2d1257..dd4ef08 100755
--- a/config.sub
+++ b/config.sub
@@ -249,7 +249,7 @@ case $basic_machine in
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
-       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+       | arc | arm | arm[bl]e | arme[lb] | armv[23457] | armv[345][lb] | avr | avr32 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
Sidetrack: If you want to look at some more details on the CPU, check out http://en.wikipedia.org/wiki/Texas_Instruments_OMAP

Third: Run ./configure with some options

Here is the ./configure I used. I included the OpenSSL and the Curl libraries.
./configure CXX="QCC -V4.4.2,gcc_ntoarmv7le_cpp" CC="qcc -V4.4.2,gcc_ntoarmv7le" --prefix=$PWD/playbook NM=ntoarmv7-nm RANLIB=ntoarmv7-ranlib STRIP=ntoarmv7-strip AR=ntoarmv7-ar LD=ntoarmv7-ld LDFLAGS="-L/Developer/SDKs/bbndk-1.0/target/qnx6/armle-v7/usr/lib/" CURL_CFLAGS="-DFD_SETSIZE=64 -g -O2" CURL_LIBS="-Wl,-s -Wl,-Bsymbolic -Wl,--gc-sections" --build=i386-apple-darwin11.2.0 INCLUDES="/Developer/SDKs/bbndk-1.0/target/qnx6/armle-v7/usr/include" --target=armv7-nto --host=armv7-nto
If the above worked then great, you can now run make, else, you will need to try to debug the problem with your environment/configuration.

Fourth: Run make

Run make and then make install to install into the path we chose in our configure statement which was set with the --prefix=$PWD/playbook. What is $PWD, it is the environment variable for the directory you are building the library within. Basically, the make install will make a new directory called playbook and place all the built artifacts into that directory.

Lastly: Pull liboauth into your project

I'll leave that for the user to work out but here is a sample liboauth on BlackBerry PlayBook qde project on github that has the built library and the test/selftest_wiki.c file renamed to main.c included to verify that the library is working.

Finishing



With a little tweaking of the ./configure, porting an OSS project to the PlayBook is not to hard. When you run into compiler issues the story can be a little different (read, lots of hair pulling) but is not insurmountable.

Good luck with your app!

Thursday, March 3, 2011

PlayBook App

Well, my first PlayBook app is in development. I am going to write it using the BlackBerry WebWorks SDK which boils down to; I am writing a web app. I don't know the latest web technologies to save my life so this should be a good experiment to see how easy it is to develop something.

I've found two Javascript libraries to help me along the way and handle a large portion of the work I need for this app. Now I just need to do the gluing and get to work on getting something running in two weeks.

I will be doing a PlayBook Hackathon in 2 weeks and I want to be able to demo the app at the end of the event so I am taking my experience from my last Hackathon and going into this one with the basics of the app laid out. Then at the Hackathon I can get some advice on any areas that are giving me trouble.

Expect some further posts as I progress and once I get the demo completed.