These slide are from the lab that explores the features of the Nokia Music Windows Phone API and show you how to install and use the API. Steve Robbins, Chief Architect for Nokia Music, describes how to code with the API to quickly add music features to existing apps, and demonstrates how to get music content into your app.
It is recommended that you install the Microsoft Windows Phone SDK 8.0 to get the most out of this training lab. Also, it will be helpful to have a Nokia Lumia phone built on Windows Phone 8 available for testing.
Check out details of the other Lumia App Labs, including the future schedule, here: http://www.developer.nokia.com/Develop/Windows_Phone/Learn/
AWS Community Day CPH - Three problems of Terraform
LUMIA APP LAB: USING THE NOKIA MUSIC WINDOWS PHONE API
1. LUMIA APP LABS #6
USING THE NOKIA
MUSIC WINDOWS
PHONE APIS
Steve Robbins
Chief Architect
Nokia Music
2. AGENDA
What is Nokia Music?
Nokia Music Windows Phone App-to-App APIs.
Using the Nokia Music REST API to add music data to your app.
3. NOKIA MUSIC
Instant free music streaming
on Lumia Windows Phones
100s of curated mixes
Create your own artist mixes
Offline caching
Graphic Equalizer
No login, no ads
Gig Finder for live concerts
4. NOKIA MUSIC APP-TO-APP APIS
Nokia Music 3.5 for Windows Phone 8
added App-to-App APIs
In the Windows Phone Store now!
5. APP-TO-APP APIS
App-to-App protocols allow one
app to launch another with a
specific URI scheme.
Launcher.LaunchUriAsync(
"nokia-music://show/artist/?name=
Rihanna")
6. NOKIA MUSIC APP-TO-APP APIS
Launch App nokia-music://
Search MP3 store nokia-music://search/anything/?term={term}
Show Artist Details nokia-music://show/artist/?name={name}
Play an Artist Mix nokia-music://play/artist/?artist={name}
Show Gigs Around You nokia-music://show/gigs/
Search for Gigs nokia-music://search/gigs/?term={term}
Show Curated Mixes nokia-music://show/mixes/
Play a Curated Mix nokia-music://play/mix/?id={id}
Show Product Details – e.g. an album nokia-music://show/product/?id={id}
8. APP-TO-APP AND NFC
ProximityDevice device = ProximityDevice.GetDefault();
if (device != null) {
device.PublishBinaryMessage("WindowsUri:WriteTag",
GetBufferFromUrl("nokia-music://play/mix/?id=35541874"),
UnregisterUponSend);
MessageBox.Show("Tap NFC tag to write link");
}
See http://nokia.ly/nfcslides
9. USING APP-TO-APP TO MAKE
LAUNCHER TASKS
new ShowArtistTask() {
ArtistName = "Green Day"
}.Show();
10. WEB FALL-BACK
void Launch(Uri appToAppUri, Uri webFallbackUri)
{
#if WINDOWSPHONE8
if (IsNokiaDevice())
{
Launcher.LaunchUriAsync(appToAppUri);
return;
}
#endif
WebBrowserTask web = new WebBrowserTask();
web.Uri = webFallbackUri;
web.Show();
}
11. NOKIA MUSIC LAUNCHER TASKS
Launch App new LaunchTask().Show();
new MusicSearchTask() {
Search MP3 store SearchTerms = "Rihanna"
}.Show();
new ShowArtistTask() {
Show Artist Details ArtistName = "Green Day”
}.Show();
new PlayMixTask() {
Play an Artist or Curated Mix ArtistName = "Green Day"
}.Show();
Show Gigs Around You or Search for Gigs new ShowGigsTask().Show();
Show Curated Mixes new ShowMixesTask().Show();
12. DEMOS
API installation with NuGet
Replace URI-based App-to-App with MusicSearchTask
Take an existing Location-based app and add “Gigs Near You” feature
13. NOKIA MUSIC WINDOWS PHONE API
Makes it easy for you to integrate music
data into your app.
MusicClientAsync client = new
MusicClientAsync(AppId, AppCode);
var artists =
await client.GetTopArtists();
list.ItemsSource = artists.Result;
// when user selects artist...
artist.PlayMix();
14. NOKIA MUSIC WINDOWS PHONE API
Search Nokia Music var items = await client.Search("Green Day");
Search Artist By Location var a = await client.GetArtistsAroundLocation(51.45,-2.6);
Gets available genres var genres = await client.GetGenres();
Gets top artists for a genre var artists = await client.GetTopArtistsForGenre(myGenre);
Gets charts var albums = await client.GetTopProducts(Category.Album);
Gets a list of new releases var tracks = await client.GetNewReleases(Category.Track);
Gets the top artists var artists = await client.GetTopArtists();
Gets products by an artist var products = await client.GetArtistProducts(myArtist);
Gets similar artists var artists = await client.GetSimilarArtists(myArtist);
Gets available Mix Groups var mixGroups = await client.GetMixGroups();
Gets Mixes for a group var mixes = await client.GetMixes(myMixGroup);
15. DEMOS
Sign up for API Keys
Create application to show artists on map