|By Jim O'Neil||
|August 6, 2012 08:07 AM EDT||
In the last post, I discussed the structure of a notification template and the mechanics for providing the various bit of information in that template. As you know, many of the notification templates can include one or more images, and that brings up a host of configuration options that I didn’t have a chance to get into last time. This post will fill in the gaps and provide insight into three main topics:
I’ll close with a quick list of not-so-obvious features and behaviors that will hopefully save you some time as you plan out your strategy for supporting images as part of notifications used within your application.
There are two overarching constraints for images used within notifications:
- Images used in notifications must be in one of three formats: .png, .jpg/.jpeg, or .gif, and the format must match the extension.
- Images for notifications must be no larger than 200 KB and 1024 x 1024 in dimension.
Beyond that and depending on the device size and characteristics, images within Windows 8 may be scaled to one of four proportions (80%, 100%, 140% and 180%). Since the notification image formats supported are all raster formats (versus vector-based) you cannot rely on the scaling to result in clear, crisp imagery, so it’s recommended that you provide artwork to accommodate all four scaling factors.
The table below (which is adapted from the App images topic on MSDN) shows most of the sizes [see note] needed for tile and toast notifications as well as the (optional) badge logo for the start screen. Only those images highlighted in red (100% size for logo and small logo) are required and must be supplied in the app manifest (as .jpg/jpeg or .png formats [see note]). Other sizes are optional and if not provided will be generated by scaling the default 100% image.
appxmanifest Image Name
80% [see note] 100% 140% 180% Logo
(default square tile)
120x120 150x150 210x210 270x270 Small logo
(tile under semantic zoom,
tile and toast branding) [see note]
24x24 30x30 42x42 54x54 Wide logo
(default wide tile)
248x120 310x150 434x210 558x270 Badge Logo [see note]
24x24 33x33 43x43
Images used for notifications can be stored in one of three places:
- within the app package, using the
ms-appx:///prefix to a directory in your deployed application (this is the default).
- within local storage, using the
ms-appdata:///localprefix to a directory within local storage. Note that images in temporary and roaming application data storage cannot be used.
- on the web, using an
httpsURI that serves up image content (this requires that the application declare Internet client capability in its manifest).
Within the template XML you can specify the entire image URI or use paths relative to the baseUri value specified within the template. The baseUri can be set for either the visual (tile | toast) tag or the binding tag (tile | toast), with the latter overriding the former when provided.
App Package Images
Here, for example, is a code snippet from the App tiles and badges sample showing the use of an image within the local application package:
var tileXml = Windows.UI.Notifications.TileUpdateManager.getTemplateContent( Windows.UI.Notifications.TileTemplateType.tileWideImageAndText01); // get the text attributes for this template and fill them in var tileTextAttributes = tileXml.getElementsByTagName("text"); tileTextAttributes.appendChild(tileXml.createTextNode( "This tile notification uses ms-appx images")); // get the image attributes for this template and fill them in var tileImageAttributes = tileXml.getElementsByTagName("image"); tileImageAttributes.setAttribute("src", "ms-appx:///images/redWide.png");
Local Storage Images
The code for accessing an image in local storage is very similar, differing only by the addressing scheme:
Here the image is located in a subdirectory called images at the location returned by ApplicationData.localFolder; when I ran an excursion of the sample app using this access mechanism, the image was served from:
Images in the Cloud
One option to consider when architecting your application is leveraging the cloud for external resources that your application uses. If you place images and other content on the web or in the cloud, you’ve decoupled those resources from your application, and by doing so you can freshen the look and feel of your application without publishing a new version of your application or requiring the end users to get an update.
Windows Azure, Microsoft’s public cloud offering, can be an incredibly convenient and cost effective way to manage the images you’re using for your notifications. The easiest way to serve image content from Windows Azure is via blob storage which provides highly scalable and highly available storage of unstructured data at one of eight Windows Azure data centers worldwide. A Content Delivery Network (currently comprising 24 nodes) is also available to improve performance and user experience for end-users who aren’t located near a data center.Keep in mind there are some caveats when using cloud or web hosted images:
- The most obvious is that if the machine lacks network connectivity, the image won't be available and the notification will not be sent.
- Web images are cached, so an update to the image in the cloud may not be immediately reflected on the client. If the cache is full, images will be removed in a policy opaque to the developer. Additionally the system will clear the cache when
- The application is uninstalled, or
- The user clears personal information from all of her application tiles (via the Settings flyout on the Start screen).
The system will comply with caching and expiration headers in the HTTP response. Those headers are not configurable in Windows Azure storage alone, but a web service can be configured and hosted on Windows Azure to support this.
- The cloud isn't free! While there are no-cost options (like the 90-day trial and MSDN subscriptions), you ultimately may end up paying for the storage and the transactions (HTTP GET requests) that are made by your application. The complete pricing details are available at the Azure pricing page, but it’s very likely you'll be able to support a popular Windows 8 application for dollars if not pennies a month.
The elephant in the room thus far in this post is that all the samples I’ve shown above refer to a single image of some unknown size, and I appear to have ignored the advice to provide four different image sizes (80%, 100%, 140% and 180%) scale to provide the best user experience!
It turns out that there’s a bit of magic happening behind the scenes to make managing the combination of image sizes and contrast mode (don’t forget there’s are high-contrast white and high-contrast black options too!). The amount of ‘magic’ depends on the image source, so I’ll cover them independently below.
App Package Images
When you provide images as part of your application package, a naming convention can be leveraged which enables you to specify one base image name (say in the notification template image src attribute) yet the system automatically selects a file with a modified name based on the current scale factor and contrast mode.
For instance, while the code sample above refers to
redWide.png, the application can deliver a slew of versions that vary by scale factor, contrast mode, culture (e.g., en-US versus zh-CN), and several other resource qualifiers.
A file named
redWide.scale-140.png, if available, would be used in the samples above – in lieu of scaling the default image – whenever there was a request for
redWide.pngand the current scale required was 140%. Your code doesn’t need to do a thing!
If you had a special version of the tile just for those in French locales, you could name that image,
redWide.lang-FR-fr_scale-140.png. (Note the lang prefix to the BCP-47 language identifier)
redWide.scale-180_contrast-black.pngwould be used when the contrast mode is black and an image scaled to 180% is needed. By the way,
You can also arrange the images in subdirectories, to provide a myriad of customization options. Take, for example, the following directory structure.
If the application were run on a US based system, but the user selected a black high contrast theme, a reference for
welcome.png for a tile notification on a typical laptop would pick the variant on Line 8. Someone running the applications with his locale set to Japan on a high-resolution device would see the image file associated with Line 17.
Unfortunately, none of the conventions supported for app package images are supported when using local images (the
ms-appdata:///local namespace), but you could implement similar semantics programmatically using the following Windows APIs:
|Attribute||Windows Class or Property||Values|
|Language||ApplicationLanguage.languages||a list of BCP-47 codes corresponding to the applications supported languages (see ���How to manage language and region” for details)|
|Contrast Scheme [see note]||AccessibilitySettings.highContrast
”High Contrast White”
”High Contrast Black”
”High Contrast #1”
”High Contrast #2”
|Home Region||GlobalizationPreferences.homeGeographicRegion||BCP-47 subtag code corresponding to user’s Region preference in Control Panel|
Images in the Cloud
Both the tile schema and the toast schema include an optional attribute called addImageQuery, on the visual, binding, and image elements (the value set on the deepest element overriding those above it). When addImageQuery is set to true, HTTP/HTTPS requests made for images will have a query string appended consisting of the following three name value pairs:
|Attribute||Query String Name||Query String Value|
|Contrast Scheme [see note]||
Here for instance is an HTTP request made for the
The good news is that you don’t have to figure out which variant of an image is being requested – that information is available in the query parameters; the bad news is that you have to build your own web service to inspect those parameters and serve up the correct image in response. You can’t just use the blob storage mechanism shown above, because those query parameters aren't automatically interpreted by Windows Azure blob storage, but you can still use Windows Azure with a little bit of code (PHP, ASP.NET, Node.js, or essentially any implementation of a web service that will run on Windows).
- 80% images are used on tiles for some combinations of screen size and resolution.
- Size specifications haven’t been published for images that appear on toast or that do not fill the entire tile, such as the template samples below. In most cases, these will be photographic images which scale fairly well (using the Fant algorithm internally). You could measure the sizes empirically, but if you create images that work for 180% scale they should also scale down well for the other three factors.
- Default images (those declared in your app manifest) must be .png or .jpg/.jpeg format, but you can use .gif in your toast and tile notification templates.
- If an image is of the wrong format or not available (such as a image hosted on the Web when the client is not connected), the notification will not be sent.
- The branding element is taken from the small logo in your manifest. For tiles it appears in the bottom left and for toast in the bottom right. In the tile schema you can use text, logo, or no branding; in the toast schema, the branding attribute is not used and you will always see the logo.
- The badge logo must be monochromatic.
- if you don’t supply multiple images to accommodate scaling, try to create images with dimensions that are a multiple of 5 as they won’t experience pixel shifting during scaling.
- The Visual Studio simulator is an awesome way to test out tile behavior under different resolutions and contrast modes, but be aware, you’ll have to restart your debug session in the simulator if your change in resolution results in loading a different version of the image.
- PC Settings > Ease of Access (accessible via the Settings charm) includes a switch to toggle High Contrast mode; however, since there are four high contrast modes, you’ll need to use the desktop Control Panel option to pick one. Once you’ve selected the contrast mode there, PC Settings > Ease of Access will use that High Contrast mode when you toggle the option.
- Windows supports four high contrast modes (White, Black, #1, and #2), and these map to four overlapping resource types: standard, high, black, and white as follows:
Contrast Setting in Control Panel Applicable Resource Qualifiers
ms-contrastQuery Parameter Value
High Contrast White
white High Contrast Black
black High Contrast #1
black High Contrast #2
SYS-CON Events announced today that G2G3 will exhibit at SYS-CON's @DevOpsSummit Silicon Valley, which will take place on November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. Based on a collective appreciation for user experience, design, and technology, G2G3 is uniquely qualified and motivated to redefine how organizations and people engage in an increasingly digital world.
Oct. 6, 2015 02:15 PM EDT Reads: 289
In his session at @ThingsExpo, Tony Shan, Chief Architect at CTS, will explore the synergy of Big Data and IoT. First he will take a closer look at the Internet of Things and Big Data individually, in terms of what, which, why, where, when, who, how and how much. Then he will explore the relationship between IoT and Big Data. Specifically, he will drill down to how the 4Vs aspects intersect with IoT: Volume, Variety, Velocity and Value. In turn, Tony will analyze how the key components of IoT ...
Oct. 6, 2015 02:00 PM EDT Reads: 294
When it comes to IoT in the enterprise, namely the commercial building and hospitality markets, a benefit not getting the attention it deserves is energy efficiency, and IoT’s direct impact on a cleaner, greener environment when installed in smart buildings. Until now clean technology was offered piecemeal and led with point solutions that require significant systems integration to orchestrate and deploy. There didn't exist a 'top down' approach that can manage and monitor the way a Smart Buildi...
Oct. 6, 2015 02:00 PM EDT Reads: 236
SYS-CON Events announced today that ProfitBricks, the provider of painless cloud infrastructure, will exhibit at SYS-CON's 17th International Cloud Expo®, which will take place on November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. ProfitBricks is the IaaS provider that offers a painless cloud experience for all IT users, with no learning curve. ProfitBricks boasts flexible cloud servers and networking, an integrated Data Center Designer tool for visual control over the...
Oct. 6, 2015 01:00 PM EDT Reads: 736
You have your devices and your data, but what about the rest of your Internet of Things story? Two popular classes of technologies that nicely handle the Big Data analytics for Internet of Things are Apache Hadoop and NoSQL. Hadoop is designed for parallelizing analytical work across many servers and is ideal for the massive data volumes you create with IoT devices. NoSQL databases such as Apache HBase are ideal for storing and retrieving IoT data as “time series data.”
Oct. 6, 2015 12:45 PM EDT Reads: 459
Clearly the way forward is to move to cloud be it bare metal, VMs or containers. One aspect of the current public clouds that is slowing this cloud migration is cloud lock-in. Every cloud vendor is trying to make it very difficult to move out once a customer has chosen their cloud. In his session at 17th Cloud Expo, Naveen Nimmu, CEO of Clouber, Inc., will advocate that making the inter-cloud migration as simple as changing airlines would help the entire industry to quickly adopt the cloud wit...
Oct. 6, 2015 12:30 PM EDT Reads: 576
As the world moves towards more DevOps and microservices, application deployment to the cloud ought to become a lot simpler. The microservices architecture, which is the basis of many new age distributed systems such as OpenStack, NetFlix and so on, is at the heart of Cloud Foundry - a complete developer-oriented Platform as a Service (PaaS) that is IaaS agnostic and supports vCloud, OpenStack and AWS. In his session at 17th Cloud Expo, Raghavan "Rags" Srinivas, an Architect/Developer Evangeli...
Oct. 6, 2015 12:15 PM EDT
SYS-CON Events announced today that VividCortex, the monitoring solution for the modern data system, will exhibit at the 17th International Cloud Expo®, which will take place on November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. The database is the heart of most applications, but it’s also the part that’s hardest to scale, monitor, and optimize even as it’s growing 50% year over year. VividCortex is the first unified suite of database monitoring tools specifically desi...
Oct. 6, 2015 12:00 PM EDT Reads: 408
Organizations already struggle with the simple collection of data resulting from the proliferation of IoT, lacking the right infrastructure to manage it. They can't only rely on the cloud to collect and utilize this data because many applications still require dedicated infrastructure for security, redundancy, performance, etc. In his session at 17th Cloud Expo, Emil Sayegh, CEO of Codero Hosting, will discuss how in order to resolve the inherent issues, companies need to combine dedicated a...
Oct. 6, 2015 12:00 PM EDT Reads: 436
Secure Cloud through Automated Compliance | @CloudExpo @CloudRaxak #Cloud #BigData #DevOps #Microservices
Cloud computing delivers on-demand resources that provide businesses with flexibility and cost-savings. The challenge in moving workloads to the cloud has been the cost and complexity of ensuring the initial and ongoing security and regulatory (PCI, HIPAA, FFIEC) compliance across private and public clouds. Manual security compliance is slow, prone to human error, and represents over 50% of the cost of managing cloud applications. Determining how to automate cloud security compliance is critical...
Oct. 6, 2015 12:00 PM EDT Reads: 248
As-a-service models offer huge opportunities, but also complicate security. It may seem that the easiest way to migrate to a new architectural model is to let others, experts in their field, do the work. This has given rise to many as-a-service models throughout the industry and across the entire technology stack, from software to infrastructure. While this has unlocked huge opportunities to accelerate the deployment of new capabilities or increase economic efficiencies within an organization, i...
Oct. 6, 2015 11:14 AM EDT
Culture is the most important ingredient of DevOps. The challenge for most organizations is defining and communicating a vision of beneficial DevOps culture for their organizations, and then facilitating the changes needed to achieve that. Often this comes down to an ability to provide true leadership. As a CIO, are your direct reports IT managers or are they IT leaders? The hard truth is that many IT managers have risen through the ranks based on their technical skills, not their leadership ab...
Oct. 6, 2015 11:00 AM EDT Reads: 850
Learn how Backup as a Service can help your customer base protect their data. In his session at 17th Cloud Expo, Stefaan Vervaet, Director of Strategic Alliances at HGST, will discuss the challenges of data protection in an era of exploding storage requirements, show you the benefits of a backup service for your cloud customers, and explain how the HGST Active Archive and CommVault are already enabling this service today with customer examples.
Oct. 6, 2015 11:00 AM EDT Reads: 680
SYS-CON Events announced today that Key Information Systems, Inc. (KeyInfo), a leading cloud and infrastructure provider offering integrated solutions to enterprises, will exhibit at the 17th International Cloud Expo®, which will take place on November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. Key Information Systems is a leading regional systems integrator with world-class compute, storage and networking solutions and professional services for the most advanced softwa...
Oct. 6, 2015 11:00 AM EDT Reads: 320
Apps and devices shouldn't stop working when there's limited or no network connectivity. Learn how to bring data stored in a cloud database to the edge of the network (and back again) whenever an Internet connection is available. In his session at 17th Cloud Expo, Bradley Holt, Developer Advocate at IBM Cloud Data Services, will demonstrate techniques for replicating cloud databases with devices in order to build offline-first mobile or Internet of Things (IoT) apps that can provide a better, ...
Oct. 6, 2015 10:45 AM EDT Reads: 448
Cloud Foundry open Platform as a Service makes it easy to operate, scale and deploy application for your dedicated cloud environments. It enables developers and operators to be significantly more agile, writing great applications and deliver them in days instead of months. Cloud Foundry takes care of all the infrastructure and network plumbing that you need to build, run and operate your applications and can do this while patching and updating systems and services without any downtime.
Oct. 6, 2015 10:00 AM EDT Reads: 4,417
SYS-CON Events announced today that Interface Masters Technologies, provider of leading network visibility and monitoring solutions, will exhibit at the 17th International CloudExpo®, which will take place on November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. Interface Masters Technologies is a leading provider of high speed networking solutions focused on Gigabit, 10 Gigabit, 40 Gigabit and 100 Gigabit Ethernet network access and connectivity products. For over 20 ye...
Oct. 6, 2015 10:00 AM EDT Reads: 664
Redis is not only the fastest database, but it has become the most popular among the new wave of applications running in containers. Redis speeds up just about every data interaction between your users or operational systems. In his session at 17th Cloud Expo, Dave Nielsen, Developer Relations at Redis Labs, will share the functions and data structures used to solve everyday use cases that are driving Redis' popularity
Oct. 6, 2015 10:00 AM EDT Reads: 414
For almost two decades, businesses have discovered great opportunities to engage with customers and even expand revenue through digital systems, including web and mobile applications. Yet, even now, the conversation between the business and the technologists that deliver these systems is strained, in large part due to misaligned objectives. In his session at DevOps Summit, James Urquhart, Senior Vice President of Performance Analytics at SOASTA, Inc., will discuss how measuring user outcomes –...
Oct. 6, 2015 10:00 AM EDT Reads: 322
SYS-CON Events announced today that Secure Infrastructure & Services will exhibit at SYS-CON's 17th International Cloud Expo®, which will take place on November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. Secure Infrastructure & Services (SIAS) is a managed services provider of cloud computing solutions for the IBM Power Systems market. The company helps mid-market firms built on IBM hardware platforms to deploy new levels of reliable and cost-effective computing and hig...
Oct. 6, 2015 10:00 AM EDT Reads: 772