SlideShare a Scribd company logo
1 of 19
LUMIA APP LABS #17

OPTIMISING YOUR APPS
FOR LARGE-SCREEN
PHONES
Lucian Tomuta
Chief Engineer
Twitter: @ltomuta
AGENDA
What’s new?
New features in Windows Phone Update 3
New Nokia Lumia smartphones
Scalable applications supporting 1080p
Layouts optimized for large displays?
Questions...

© 2012 Nokia. All rights reserved.
© 2012 Microsoft. All rights reserved.

11/22/2013
WHAT’S NEW …
Windows Phone Update 3 (aka GDR3)
Support for more powerful hardware
1080p resolution support
Layout optimization for large-screen displays
Changes in application memory limits
Change in IE’s viewport reported size
… more consumer focused features.
Windows Phone Preview for Developers
© 2012 Nokia. All rights reserved.
© 2012 Microsoft. All rights reserved.

11/22/2013
WHAT’S NEW ...
Nokia Lumia 1520
Gorgeous 6’’ display @ 1080p
Qualcomm Snapdragon 800 2.2 GHz
Adreno 330
2 GB RAM
Nokia Lumia 1320
Gorgeous 6’’ display @ 720p
Snapdragon S4 1.7 GHz
Adreno 330
512 MB RAM

© 2012 Nokia. All rights reserved.
© 2012 Microsoft. All rights reserved.

11/22/2013
ALL NEW... 1080P
Scale factor:
1.5 (real scale
factor is 2.25)

© 2012 Nokia. All rights reserved.
© 2012 Microsoft. All rights reserved.

11/22/2013
YOUR EXISTING APP
...will work on 1080p without any* changes.
If your application is already declaring 720p layout support – it will install and run scaled-up on
the 1080p device
If your application does not declare 720p layout support – it will not install on the 1080p
device and not be offered by the Windows Phone Store
If your application is a WP7.x application (not updated to WP8) it will be made available to
1080p devices, but will run letterboxed
© 2012 Nokia. All rights reserved.
© 2012 Microsoft. All rights reserved.

11/22/2013
OPTIMIZE FOR LARGE HD DISPLAYS
How can I make my app look better?
Detect device’s resolution
Design an auto-scaling layout
Optimize your graphic assets
Optimize your video assets
Optimize your fonts

© 2012 Nokia. All rights reserved.
© 2012 Microsoft. All rights reserved.

11/22/2013
RESOLUTION DETECTION
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");
}
}
}

© 2012 Nokia. All rights reserved.
© 2012 Microsoft. All rights reserved.

11/22/2013
DEVICE EXTENDED PROPERTIES
Three new properties available starting with GDR3
System.ArgumentOutOfRangeException will be thrown if queried on earlier OS
versions.
Property

Value type

Description

PhysicalScreenResolution

Size

Width / height in physical pixels.

RawDpiX

Double

The DPI along the horizontal of the screen. When
the value is not available, it returns 0.0.

RawDpiY

Double

The DPI along the vertical of the screen. When
the value is not available, it returns 0.0.

© 2012 Nokia. All rights reserved.
© 2012 Microsoft. All rights reserved.

11/22/2013
HIGH RESOLUTION GRAPHICS
For a crisp look on the 1080p device,
provide high resolution graphics

Avoid image distortion by using the
correct aspect ratio.

© 2012 Nokia. All rights reserved.
© 2012 Microsoft. All rights reserved.

public class MultiResImageChooserUri
{
public Uri BestResolutionImage
{
get
{
switch (ResolutionHelper.CurrentResolution)
{
case Resolutions.HD1080p:
case Resolutions.HD720p:
//return 16:9 aspect ratio asset, high res
return new Uri("Assets/MyImage.screen-1080p.jpg", UriKind.Relative);
case Resolutions.WXGA:
case Resolutions.WVGA:
// return 15:9 aspect ratio asset, high res
return new Uri("Assets/MyImage.screen-wxga.jpg", UriKind.Relative);
default:
throw new InvalidOperationException("Unknown resolution type");
}
}
}
}

11/22/2013
HIGH RESOLUTION GRAPHICS
Make sure to load the files at needed resolution to reduce memory footprint
...
var bmp = new BitmapImage();
// no matter the actual size, this bitmap is decoded to 480 pixels width
// aspect ratio preserved and only takes up the memory needed for this size
bmp.DecodePixelWidth = 480;
bmp.UriSource = new Uri(@"AssetsDemo1080p.png", UriKind.Relative);
ImageControl.Source = bmp;
...

Optimize asset downloads to minimize data traffic

© 2012 Nokia. All rights reserved.
© 2012 Microsoft. All rights reserved.

11/22/2013
ASSETS WITH PREDEFINED SIZES
Tiles
Smaller on large screen displays due to the 3 columns
layout.
Use WXGA tile sizes and rely on the platform scaling them
down.

Splash Screen
Provide resolution specific assets.
SplashScreenImage.Screen-720p.jpg will be loaded
correctly while SplashScreenImage.jpg is letterboxed
© 2012 Nokia. All rights reserved.
© 2012 Microsoft. All rights reserved.

11/22/2013
FULL HD VIDEO
Full HD video supported, progressive or adaptive
We recommend Smooth Streaming technology, allowing the Player Framework
to optimized video download based on device’s capabilities and network
bandwidth restrictions.

Player Framework v1.3 now supports 1080p, get it from
http://playerframework.codeplex.com/
© 2012 Nokia. All rights reserved.
© 2012 Microsoft. All rights reserved.

11/22/2013
TYPOGRAPHY
Predefined text styles are already
optimized for your device.

If using custom text styles, please
make sure to review their sizes.
Scale by 2.25 your title styles
For body texts, scale by 1.8 (80%)
© 2012 Nokia. All rights reserved.
© 2012 Microsoft. All rights reserved.

11/22/2013
LAYOUT OPTIMISATION
It all depends on your app’s function and design.
Millimeter perfect UI?
Real scale factor is 2.25, not 1.5 as reported by the app.
Large display not optimal for single hand usage
Move controls closer to user’s fingers
More items vs. bigger items
Resize your UI elements to fit more useful content on the screen
May be necessary on 5’’ or larger devices
© 2012 Nokia. All rights reserved.
© 2012 Microsoft. All rights reserved.

11/22/2013
DETECT SCREEN SIZE
...

class ScreenSizeHelper
{
static private double _screenSize = -1.0f;
static private double _screenDpiX = 0.0f;
static private double _screenDpiY = 0.0f;
static private Size _resolution;
static public bool IsBigScreen
{
get
{
// Use 720p emulator to simulate big screen.
if (Microsoft.Devices.Environment.DeviceType == Microsoft.Devices.DeviceType.Emulator)
{
_screenSize = (App.Current.Host.Content.ScaleFactor == 150) ? 6.0f : 0.0f;
}

If we can read the new device
extended properties,
calculate size.

if (_screenSize == -1.0f)
{
try
{
_screenDpiX = (double)DeviceExtendedProperties.GetValue("RawDpiX");
_screenDpiY = (double)DeviceExtendedProperties.GetValue("RawDpiY");
_resolution = (Size)DeviceExtendedProperties.GetValue("PhysicalScreenResolution");
// Calculate screen diagonal in inches.

If we can’t, OS is pre-GDR3,
screen size is ~= 4’’

_screenSize = Math.Sqrt(Math.Pow(_resolution.Width / _screenDpiX, 2) + Math.Pow(_resolution.Height / _screenDpiY, 2));
}
catch (Exception e)
{
// We're on older software with lower screen size, carry on.
Debug.WriteLine("IsBigScreen error: " + e.Message);
_screenSize = 0;
}
}
// Returns true if screen size is bigger than 5 inches - you may edit the value based on your app's needs.
return (_screenSize > 5.0f);
}
}
}

© 2012 Nokia. All rights reserved.
© 2012 Microsoft. All rights reserved.

11/22/2013
DYNAMIC LAYOUTS

How to apply dynamic
layouts to an
application?
Demo.

© 2012 Nokia. All rights reserved.
© 2012 Microsoft. All rights reserved.

11/22/2013
A global app development competition
for Nokia Lumia and Windows Phone 8.

It’s your chance to win prizes that will get you noticed,
including trips to MWC, DVLUP XPs, devices, promotions
and much more.
Mini Mission 5: Big Screen.
10 other missions still open.

ENTER NOW > Nokia.ly/create
LUMIA APP LABS #17

THANK YOU!
QUESTIONS?
More information:
Nokia Lumia Developer's Library
http://developer.nokia.com/Resources/Library/Lumia/

Lucian Tomuta
Twitter: @ltomuta

More Related Content

Similar to Lumia App Labs #17: Optimising your Nokia Lumia apps for large screen phones

Creating Flash Content for Multiple Screens
Creating Flash Content for Multiple ScreensCreating Flash Content for Multiple Screens
Creating Flash Content for Multiple Screenspaultrani
 
Windows 7 and Windows Server 2008 R2 SP1 Overview
Windows 7 and Windows Server 2008 R2 SP1 OverviewWindows 7 and Windows Server 2008 R2 SP1 Overview
Windows 7 and Windows Server 2008 R2 SP1 OverviewAmit Gatenyo
 
Using the Presentation API and external screens on Android
Using the Presentation API and external screens on AndroidUsing the Presentation API and external screens on Android
Using the Presentation API and external screens on AndroidXavier Hallade
 
Android Live Streaming Box Technical
Android Live Streaming Box Technical Android Live Streaming Box Technical
Android Live Streaming Box Technical Jimmin Kurichiyil
 
Adobe AIR 2.5 Beta for Android
Adobe AIR 2.5 Beta for AndroidAdobe AIR 2.5 Beta for Android
Adobe AIR 2.5 Beta for AndroidMark Doherty
 
Chrysler Smart Screen
Chrysler Smart ScreenChrysler Smart Screen
Chrysler Smart ScreenMostafa Sameh
 
Android Programming Basics - Simple Pizza Delivery Application
Android Programming Basics - Simple Pizza Delivery ApplicationAndroid Programming Basics - Simple Pizza Delivery Application
Android Programming Basics - Simple Pizza Delivery ApplicationRiya Tirole
 
Windows phone 8 overview
Windows phone 8 overviewWindows phone 8 overview
Windows phone 8 overviewcodeblock
 
HTML5 vs Native Android: Smart Enterprises for the Future
HTML5 vs Native Android: Smart Enterprises for the FutureHTML5 vs Native Android: Smart Enterprises for the Future
HTML5 vs Native Android: Smart Enterprises for the FutureMotorola Mobility - MOTODEV
 
HTC Developer - 2012
HTC Developer - 2012HTC Developer - 2012
HTC Developer - 2012Bruce Jones
 
A Citrix Masterclass
A Citrix MasterclassA Citrix Masterclass
A Citrix Masterclassbluechipper
 
Desktop virtualisation
Desktop virtualisationDesktop virtualisation
Desktop virtualisationBlueChipICT
 
Device aware web frameworks for better programming
Device aware web frameworks for better programmingDevice aware web frameworks for better programming
Device aware web frameworks for better programmingSuntae Kim
 
Presentazione SimpliVity @ VMUGIT UserCon 2015
Presentazione SimpliVity @ VMUGIT UserCon 2015Presentazione SimpliVity @ VMUGIT UserCon 2015
Presentazione SimpliVity @ VMUGIT UserCon 2015VMUG IT
 
Dreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile designDreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile designDee Sadler
 
VISION Technology from AMD Powered by AMD E-Series & C-Series APUs
VISION Technology from AMD Powered by AMD E-Series & C-Series APUsVISION Technology from AMD Powered by AMD E-Series & C-Series APUs
VISION Technology from AMD Powered by AMD E-Series & C-Series APUsAdditionalResources
 
Responsive Websites and Grid-Based Layouts by Gabriel Walt
Responsive Websites and Grid-Based Layouts by Gabriel Walt Responsive Websites and Grid-Based Layouts by Gabriel Walt
Responsive Websites and Grid-Based Layouts by Gabriel Walt AEM HUB
 
Compared to a similarly sized solution from a scale-out vendor, the Dell EMC ...
Compared to a similarly sized solution from a scale-out vendor, the Dell EMC ...Compared to a similarly sized solution from a scale-out vendor, the Dell EMC ...
Compared to a similarly sized solution from a scale-out vendor, the Dell EMC ...Principled Technologies
 

Similar to Lumia App Labs #17: Optimising your Nokia Lumia apps for large screen phones (20)

Creating Flash Content for Multiple Screens
Creating Flash Content for Multiple ScreensCreating Flash Content for Multiple Screens
Creating Flash Content for Multiple Screens
 
Windows 7 and Windows Server 2008 R2 SP1 Overview
Windows 7 and Windows Server 2008 R2 SP1 OverviewWindows 7 and Windows Server 2008 R2 SP1 Overview
Windows 7 and Windows Server 2008 R2 SP1 Overview
 
Using the Presentation API and external screens on Android
Using the Presentation API and external screens on AndroidUsing the Presentation API and external screens on Android
Using the Presentation API and external screens on Android
 
Android Live Streaming Box Technical
Android Live Streaming Box Technical Android Live Streaming Box Technical
Android Live Streaming Box Technical
 
Multi Screen Hell
Multi Screen HellMulti Screen Hell
Multi Screen Hell
 
Adobe AIR 2.5 Beta for Android
Adobe AIR 2.5 Beta for AndroidAdobe AIR 2.5 Beta for Android
Adobe AIR 2.5 Beta for Android
 
Chrysler Smart Screen
Chrysler Smart ScreenChrysler Smart Screen
Chrysler Smart Screen
 
Android Programming Basics - Simple Pizza Delivery Application
Android Programming Basics - Simple Pizza Delivery ApplicationAndroid Programming Basics - Simple Pizza Delivery Application
Android Programming Basics - Simple Pizza Delivery Application
 
Windows phone 8 overview
Windows phone 8 overviewWindows phone 8 overview
Windows phone 8 overview
 
Developing for Google Glass
Developing for Google GlassDeveloping for Google Glass
Developing for Google Glass
 
HTML5 vs Native Android: Smart Enterprises for the Future
HTML5 vs Native Android: Smart Enterprises for the FutureHTML5 vs Native Android: Smart Enterprises for the Future
HTML5 vs Native Android: Smart Enterprises for the Future
 
HTC Developer - 2012
HTC Developer - 2012HTC Developer - 2012
HTC Developer - 2012
 
A Citrix Masterclass
A Citrix MasterclassA Citrix Masterclass
A Citrix Masterclass
 
Desktop virtualisation
Desktop virtualisationDesktop virtualisation
Desktop virtualisation
 
Device aware web frameworks for better programming
Device aware web frameworks for better programmingDevice aware web frameworks for better programming
Device aware web frameworks for better programming
 
Presentazione SimpliVity @ VMUGIT UserCon 2015
Presentazione SimpliVity @ VMUGIT UserCon 2015Presentazione SimpliVity @ VMUGIT UserCon 2015
Presentazione SimpliVity @ VMUGIT UserCon 2015
 
Dreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile designDreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile design
 
VISION Technology from AMD Powered by AMD E-Series & C-Series APUs
VISION Technology from AMD Powered by AMD E-Series & C-Series APUsVISION Technology from AMD Powered by AMD E-Series & C-Series APUs
VISION Technology from AMD Powered by AMD E-Series & C-Series APUs
 
Responsive Websites and Grid-Based Layouts by Gabriel Walt
Responsive Websites and Grid-Based Layouts by Gabriel Walt Responsive Websites and Grid-Based Layouts by Gabriel Walt
Responsive Websites and Grid-Based Layouts by Gabriel Walt
 
Compared to a similarly sized solution from a scale-out vendor, the Dell EMC ...
Compared to a similarly sized solution from a scale-out vendor, the Dell EMC ...Compared to a similarly sized solution from a scale-out vendor, the Dell EMC ...
Compared to a similarly sized solution from a scale-out vendor, the Dell EMC ...
 

Recently uploaded

Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityVictorSzoltysek
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 

Recently uploaded (20)

Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 

Lumia App Labs #17: Optimising your Nokia Lumia apps for large screen phones

  • 1. LUMIA APP LABS #17 OPTIMISING YOUR APPS FOR LARGE-SCREEN PHONES Lucian Tomuta Chief Engineer Twitter: @ltomuta
  • 2. AGENDA What’s new? New features in Windows Phone Update 3 New Nokia Lumia smartphones Scalable applications supporting 1080p Layouts optimized for large displays? Questions... © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved. 11/22/2013
  • 3. WHAT’S NEW … Windows Phone Update 3 (aka GDR3) Support for more powerful hardware 1080p resolution support Layout optimization for large-screen displays Changes in application memory limits Change in IE’s viewport reported size … more consumer focused features. Windows Phone Preview for Developers © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved. 11/22/2013
  • 4. WHAT’S NEW ... Nokia Lumia 1520 Gorgeous 6’’ display @ 1080p Qualcomm Snapdragon 800 2.2 GHz Adreno 330 2 GB RAM Nokia Lumia 1320 Gorgeous 6’’ display @ 720p Snapdragon S4 1.7 GHz Adreno 330 512 MB RAM © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved. 11/22/2013
  • 5. ALL NEW... 1080P Scale factor: 1.5 (real scale factor is 2.25) © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved. 11/22/2013
  • 6. YOUR EXISTING APP ...will work on 1080p without any* changes. If your application is already declaring 720p layout support – it will install and run scaled-up on the 1080p device If your application does not declare 720p layout support – it will not install on the 1080p device and not be offered by the Windows Phone Store If your application is a WP7.x application (not updated to WP8) it will be made available to 1080p devices, but will run letterboxed © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved. 11/22/2013
  • 7. OPTIMIZE FOR LARGE HD DISPLAYS How can I make my app look better? Detect device’s resolution Design an auto-scaling layout Optimize your graphic assets Optimize your video assets Optimize your fonts © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved. 11/22/2013
  • 8. RESOLUTION DETECTION 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"); } } } © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved. 11/22/2013
  • 9. DEVICE EXTENDED PROPERTIES Three new properties available starting with GDR3 System.ArgumentOutOfRangeException will be thrown if queried on earlier OS versions. Property Value type Description PhysicalScreenResolution Size Width / height in physical pixels. RawDpiX Double The DPI along the horizontal of the screen. When the value is not available, it returns 0.0. RawDpiY Double The DPI along the vertical of the screen. When the value is not available, it returns 0.0. © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved. 11/22/2013
  • 10. HIGH RESOLUTION GRAPHICS For a crisp look on the 1080p device, provide high resolution graphics Avoid image distortion by using the correct aspect ratio. © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved. public class MultiResImageChooserUri { public Uri BestResolutionImage { get { switch (ResolutionHelper.CurrentResolution) { case Resolutions.HD1080p: case Resolutions.HD720p: //return 16:9 aspect ratio asset, high res return new Uri("Assets/MyImage.screen-1080p.jpg", UriKind.Relative); case Resolutions.WXGA: case Resolutions.WVGA: // return 15:9 aspect ratio asset, high res return new Uri("Assets/MyImage.screen-wxga.jpg", UriKind.Relative); default: throw new InvalidOperationException("Unknown resolution type"); } } } } 11/22/2013
  • 11. HIGH RESOLUTION GRAPHICS Make sure to load the files at needed resolution to reduce memory footprint ... var bmp = new BitmapImage(); // no matter the actual size, this bitmap is decoded to 480 pixels width // aspect ratio preserved and only takes up the memory needed for this size bmp.DecodePixelWidth = 480; bmp.UriSource = new Uri(@"AssetsDemo1080p.png", UriKind.Relative); ImageControl.Source = bmp; ... Optimize asset downloads to minimize data traffic © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved. 11/22/2013
  • 12. ASSETS WITH PREDEFINED SIZES Tiles Smaller on large screen displays due to the 3 columns layout. Use WXGA tile sizes and rely on the platform scaling them down. Splash Screen Provide resolution specific assets. SplashScreenImage.Screen-720p.jpg will be loaded correctly while SplashScreenImage.jpg is letterboxed © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved. 11/22/2013
  • 13. FULL HD VIDEO Full HD video supported, progressive or adaptive We recommend Smooth Streaming technology, allowing the Player Framework to optimized video download based on device’s capabilities and network bandwidth restrictions. Player Framework v1.3 now supports 1080p, get it from http://playerframework.codeplex.com/ © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved. 11/22/2013
  • 14. TYPOGRAPHY Predefined text styles are already optimized for your device. If using custom text styles, please make sure to review their sizes. Scale by 2.25 your title styles For body texts, scale by 1.8 (80%) © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved. 11/22/2013
  • 15. LAYOUT OPTIMISATION It all depends on your app’s function and design. Millimeter perfect UI? Real scale factor is 2.25, not 1.5 as reported by the app. Large display not optimal for single hand usage Move controls closer to user’s fingers More items vs. bigger items Resize your UI elements to fit more useful content on the screen May be necessary on 5’’ or larger devices © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved. 11/22/2013
  • 16. DETECT SCREEN SIZE ... class ScreenSizeHelper { static private double _screenSize = -1.0f; static private double _screenDpiX = 0.0f; static private double _screenDpiY = 0.0f; static private Size _resolution; static public bool IsBigScreen { get { // Use 720p emulator to simulate big screen. if (Microsoft.Devices.Environment.DeviceType == Microsoft.Devices.DeviceType.Emulator) { _screenSize = (App.Current.Host.Content.ScaleFactor == 150) ? 6.0f : 0.0f; } If we can read the new device extended properties, calculate size. if (_screenSize == -1.0f) { try { _screenDpiX = (double)DeviceExtendedProperties.GetValue("RawDpiX"); _screenDpiY = (double)DeviceExtendedProperties.GetValue("RawDpiY"); _resolution = (Size)DeviceExtendedProperties.GetValue("PhysicalScreenResolution"); // Calculate screen diagonal in inches. If we can’t, OS is pre-GDR3, screen size is ~= 4’’ _screenSize = Math.Sqrt(Math.Pow(_resolution.Width / _screenDpiX, 2) + Math.Pow(_resolution.Height / _screenDpiY, 2)); } catch (Exception e) { // We're on older software with lower screen size, carry on. Debug.WriteLine("IsBigScreen error: " + e.Message); _screenSize = 0; } } // Returns true if screen size is bigger than 5 inches - you may edit the value based on your app's needs. return (_screenSize > 5.0f); } } } © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved. 11/22/2013
  • 17. DYNAMIC LAYOUTS How to apply dynamic layouts to an application? Demo. © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved. 11/22/2013
  • 18. A global app development competition for Nokia Lumia and Windows Phone 8. It’s your chance to win prizes that will get you noticed, including trips to MWC, DVLUP XPs, devices, promotions and much more. Mini Mission 5: Big Screen. 10 other missions still open. ENTER NOW > Nokia.ly/create
  • 19. LUMIA APP LABS #17 THANK YOU! QUESTIONS? More information: Nokia Lumia Developer's Library http://developer.nokia.com/Resources/Library/Lumia/ Lucian Tomuta Twitter: @ltomuta

Editor's Notes

  1. Nokia Create is a global app development competition for Nokia Lumia and Windows Phone 8. There are 15 missions built around 8 categories, so no matter what type of app you would like to develop there's an opportunity to win. You can also take this as a challenge to learn something new. The 8 categories are Image & Photo, NFC, Maps & Places, Music, Cross-8, Games & Fun, Work Life and Freestyle. Master Missions challenge you to create new apps.Mini Missions challenge you to update your existing apps: 2 just opened – Big Screen and Localisation Do Good Mission challenges you to create new apps for the visually impaired or update your existing ones to make them more accessible. The prize packages include trips to exciting events, free devices, plus promotions, ad credits and more. There are also special extra prizes based on the category. Each Mission will have a winner and 9 runners up. There will be 1 Grand Prize winner. Deadlines vary, so check out the site for more info and sign up.