Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Version 1.1
Browse files Browse the repository at this point in the history
Use device resolution specific images. Support NuGet Package Restore.
  • Loading branch information
mikpiipp committed Oct 22, 2013
1 parent 1b31587 commit 1e72356
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 33 deletions.
2 changes: 1 addition & 1 deletion MusicExplorer/AboutPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<TextBlock Margin="12,10,12,0" Text="Developed and published by Nokia. All rights reserved." Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap"/>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="12,10,0,0" Text="Learn more at " Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap"/>
<HyperlinkButton Margin="-9,8,12,0" NavigateUri="http://projects.developer.nokia.com/musicexplorer" TargetName="developer web site" Content="developer.nokia.com"/>
<HyperlinkButton Margin="-9,8,12,0" NavigateUri="http://developer.nokia.com" TargetName="developer web site" Content="developer.nokia.com"/>
</StackPanel>
</StackPanel>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion MusicExplorer/Models/ArtistModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public Uri ThumbUri
{
get
{
if (_thumb320Uri != null)
if (_thumb320Uri != null && ResolutionHelper.CurrentResolution == Resolutions.HD1080p)
{
return _thumb320Uri;
}
Expand Down
2 changes: 1 addition & 1 deletion MusicExplorer/Models/MixModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public Uri ThumbUri
{
get
{
if (_thumb320Uri != null)
if (_thumb320Uri != null && ResolutionHelper.CurrentResolution == Resolutions.HD1080p)
{
return _thumb320Uri;
}
Expand Down
2 changes: 1 addition & 1 deletion MusicExplorer/Models/ProductModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public Uri ThumbUri
{
get
{
if (_thumb320Uri != null)
if (_thumb320Uri != null && ResolutionHelper.CurrentResolution == Resolutions.HD1080p)
{
return _thumb320Uri;
}
Expand Down
7 changes: 1 addition & 6 deletions MusicExplorer/MusicExplorer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
</Compile>
<Compile Include="MusicApi.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ResolutionHelper.cs" />
<Compile Include="Resources\AppResources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
Expand Down Expand Up @@ -185,12 +186,6 @@
<Content Include="Assets\transport.pause.png" />
<Content Include="Assets\transport.play.png" />
<Content Include="Assets\transport.rew.png" />
<Content Include="README_FIRST.txt" />
<Content Include="Toolkit.Content\ApplicationBar.Add.png" />
<Content Include="Toolkit.Content\ApplicationBar.Cancel.png" />
<Content Include="Toolkit.Content\ApplicationBar.Check.png" />
<Content Include="Toolkit.Content\ApplicationBar.Delete.png" />
<Content Include="Toolkit.Content\ApplicationBar.Select.png" />
<Content Include="Assets\ApplicationIcon.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down
4 changes: 2 additions & 2 deletions MusicExplorer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.1.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: NeutralResourcesLanguageAttribute("en-US")]
4 changes: 2 additions & 2 deletions MusicExplorer/Properties/WMAppManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Deployment xmlns="http://schemas.microsoft.com/windowsphone/2012/deployment" AppPlatformVersion="8.0">
<DefaultLanguage xmlns="" code="en-US" />
<App xmlns="" ProductID="{2926895d-90c8-4dd8-99aa-8f9b3ece4dc6}" Title="Music Explorer" RuntimeType="Silverlight" Version="1.0.1.0" Genre="apps.normal" Author="MusicExplorer author" Description="Music Explorer is a Nokia Developer example application demonstrating the use of Nokia Music API together with standard Windows Phone 8 audio features to create an immersive music experience." Publisher="MusicExplorer" PublisherID="{a93f1abf-70c8-4aad-bc38-b49742da761a}">
<App xmlns="" ProductID="{2926895d-90c8-4dd8-99aa-8f9b3ece4dc6}" Title="Music Explorer" RuntimeType="Silverlight" Version="1.1.0.0" Genre="apps.normal" Author="Nokia Corporation" Description="Music Explorer is a Nokia Developer example application demonstrating the use of Nokia Music API together with standard Windows Phone 8 audio features to create an immersive music experience." Publisher="Nokia Developer" PublisherID="{a93f1abf-70c8-4aad-bc38-b49742da761a}">
<IconPath IsRelative="true" IsResource="false">Assets\ApplicationIcon.png</IconPath>
<Capabilities>
<Capability Name="ID_CAP_NETWORKING" />
Expand Down Expand Up @@ -44,7 +44,7 @@
<ScreenResolution Name="ID_RESOLUTION_HD720P" />
</ScreenResolutions>
<FunctionalCapabilities>
<FunctionalCapability Name="ID_FUNCCAP_EXTEND_MEM"/>
<FunctionalCapability Name="ID_FUNCCAP_EXTEND_MEM" />
</FunctionalCapabilities>
</App>
</Deployment>
79 changes: 79 additions & 0 deletions MusicExplorer/ResolutionHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/**
* Copyright (c) 2013 Nokia Corporation. All rights reserved.
*
* Nokia, Nokia Connecting People, Nokia Developer, and HERE are trademarks
* and/or registered trademarks of Nokia Corporation. Other product and company
* names mentioned herein may be trademarks or trade names of their respective
* owners.
*
* See the license text file delivered with this project for more information.
*/

using Microsoft.Phone.Info;
using System;
using System.Windows;

namespace MusicExplorer
{
public enum Resolutions { WVGA, WXGA, HD720p, HD1080p };

public static class ResolutionHelper
{
static private Size _size;

private static bool IsWvga
{
get
{
return App.Current.Host.Content.ScaleFactor == 100;
}
}

private static bool IsWxga
{
get
{
return App.Current.Host.Content.ScaleFactor == 160;
}
}

private static bool Is720p
{
get
{
return (App.Current.Host.Content.ScaleFactor == 150 && !Is1080p);
}
}

private static bool Is1080p
{
get
{
if (_size.Width == 0)
{
try
{
_size = (Size)DeviceExtendedProperties.GetValue("PhysicalScreenResolution");
}
catch (Exception)
{
_size.Width = 0;
}
}
return _size.Width == 1080;
}
}

public static Resolutions CurrentResolution
{
get
{
if (IsWvga) return Resolutions.WVGA;
else if (IsWxga) return Resolutions.WXGA;
else if (Is720p) return Resolutions.HD720p;
else if (Is1080p) return Resolutions.HD1080p;
else throw new InvalidOperationException("Unknown resolution");
}
}
}
}
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Music API related features by trying out the application.

* Windows Phone 8

Tested to work on Nokia Lumia 920.
Tested to work on Nokia Lumia 920 and Nokia Lumia 1520.
Developed with Microsoft Visual Studio Express for Windows Phone 2012.

4.1 Required Capabilities
Expand Down Expand Up @@ -115,25 +115,16 @@ None.
Make sure you have the following installed:
* Windows 8
* Windows Phone SDK 8.0
* NuGet 2.1 (https://nuget.org/), Visual Studio extension to install and
update third-party libraries and tools in Visual Studio
* Latest NuGet Package Manager (>2.7.1) from https://nuget.org/ to enable
NuGet Package Restore

5.2 Using the WINDOWS PHONE 8 SDK
---------------------------------

1. Open the SLN file:
File > Open Project, select the file MusicExplorer.sln
2. Install Silverlight Toolkit for the project.
* Right click References in Solution Explorer -> select Manage NuGet Packages
* Search for 'wptoolkit' and install the 'Windows Phone toolkit' package
3. Install Nokia Music API for the project.
* Right click References in Solution Explorer -> select Manage NuGet Packages
* Search for 'nokia music' and install the 'Nokia Music' package
4. Install Json.NET for the project.
* Right click References in Solution Explorer -> select Manage NuGet Packages
* Search for 'json' and install the 'Json.NET' package
5. Select the target 'Emulator WXGA'.
6. Press F5 to build the project and run it on the Windows Phone Emulator.
2. Select the target 'Emulator WXGA'.
3. Press F5 to build the project and run it on the Windows Phone Emulator.

5.3 Deploying to Windows Phone 8
--------------------------------
Expand Down Expand Up @@ -191,14 +182,21 @@ http://msdn.microsoft.com/en-us/library/gg588378%28v=vs.92%29.aspx
7. Related documentation
-------------------------------------------------------------------------------

An article "Nokia Music API" published on Nokia Lumia Developer's Library
"Nokia Music API" documentation published on Nokia Lumia Developer's Library
(http://www.developer.nokia.com/Resources/Library/Lumia/#!nokia-music-api.html)
describes the properties and usage of Nokia Music API in detail.

“Optimising for Nokia phablets” documentation on Nokia Lumia Developer's Library
(http://developer.nokia.com/Resources/Library/Lumia/#!optimising-for-nokia-phablets.html)
describes how to optimize applications for large screen, different aspect
ratios, and multiple resolutions.

8. Version history
-------------------------------------------------------------------------------

* 1.1.0.0 Major UI-rework (new tile based design replacing list based design,
utilizing images of higher resolution in 1080p devices and NuGet
package restore support.
* 1.0.1.0 Bug fix to handle exception when location is set off
* 1.0.0.0 First release
* 0.4.0.0 Minor fixes
Expand Down
4 changes: 0 additions & 4 deletions packages/repositories.config

This file was deleted.

0 comments on commit 1e72356

Please sign in to comment.