Documente Academic
Documente Profesional
Documente Cultură
By Bill Sempf
Windows* Store apps in the Microsoft design style are all the rage right now, but many of us have existing Desktop applications that are going to stay Desktop applications. From network access to user interface (UI) considerations, there are a host of reasons to update a Desktop application to extend its useful life while you explore your options with the Windows Store. But how to keep the application looking and acting up to date in the new modern application world? Fortunately, a host of new, useful features will help to make Windows 7 apps more at home on Windows 8, including touch application programming interfaces (APIs) and new storage features. This article provides some straightforward recommendations for updating your Desktop app for Windows 8, no matter if it is running on an actual desktop, an Ultrabook device, or a tablet.
Embrace Touch
One of the most visible changes in Windows 8 from the application developers point of view is the inclusion of touch. Windows Store apps are largely touch driven, and the same can be true of Desktop apps. Working in Windows 8 on contemporary hardware is an interesting transition, as a touch-enabled laptop changes the way users work with the machine. Getting to the charms bar has a keyboard shortcut (Windows+C), for example, but very quickly, one becomes used to reaching up and swiping from the right edge of the screen with a quick flip of the thumb. Desktop applications can embrace touch, as well. The best current example of this is Microsoft Office 2013, which has a Touch/Mouse Mode button at the top of the quick access toolbar. The usual Ribbon in Microsoft Office in Figure 1 is much better suited to a mouse.
Figure 1. The Mouse Ribbon in Microsoft Office 2013 With a change to Touch mode, the space between iconsand even the style of iconschanges dramatically. You can see that change in Figure 2.
Figure 2. The Touch Ribbon in Microsoft Office 2013 The difference is in the size guidelines. Microsoft recommends that to support touch interaction, touch points should be at least 50 pixels wide and high, with an 10-pixel gutter between targets. This guideline supports the majority of users in the majority of situations. So handling touch in an application is really a matter of managing the size of your targets, at least in Touch mode, like Microsoft Office has done.
4 March 2013
Figure 3. The typographic ramp While doing this, consider your ontology. Information architecture is key in application design, and using the typographic ramp makes you consider on what tier each piece of information in your application sits.
Reduce Chrome
Increasing space between buttons often means reducing the number of buttons used in the interface. To really embrace touch, developers need to reduce the number of options in front of the user at any one time. Desktop applications have too many buttons, anyway. Look at GIMP, in Figure 4.
4 March 2013
Figure 4. Gimp and its buttons Alternatively, look at Trimble SketchUp*, a Windows Store app, shown in Figure 5. Although it is unlikely that a desktop app could go to that level, considering streamlining of the UI is a good step toward a more Windows design style experience.
4 March 2013
4 March 2013
Modern Applications
A modern application is one that uses cloud services to maintain the data and state of an application across devices. The promise is that no matter whether users are using a PC, a laptop, a tablet, or a phone, all of the data for the application remains in sync. The modern application name was coined for tablet applications (especially Windows 8 Store apps), but the same term can apply to an existing desktop app. Storage can be maintained in a central system, and business logic can be moved to an online middleware system.
4 March 2013
Bill
Storage Account
Table
Entity
Figure 6. Azure Tables architecture Tables can be a fantastic simple storage system for an application that just needs to keep some data in the cloud.
Access Logging
Knowing when a user logs in can be a real boon for security and user experience alike, especially when you just want to let the user know that you are paying attention. That information is available to Desktop applications through User Access Logging in Windows 8. Saving user access to a server is available in ual.h in the Windows software development kit (SDK). The application will need to store information about the IP address that is accessing the application in a data blob, and then pass it to the UalInstrument function, as the following code snippet shows:
UAL_DATA_BLOB ualDataBlob; ZeroMemory(&ualDataBlob, sizeof(UAL_DATA_BLOB)); ualDataBlob.Size = sizeof(UAL_DATA_BLOB); ualDataBlob.RoleGuid = RoleIdentifier; ualDataBlob.TenantId = TenantIdentifier; UalRegisterProduct(L"MyProduct", L"UserRole", L"{3D1A8E20-AD01-457B-B044-79113F30C54C}"); if (S_OK == UalStart(&ualDataBlob)) { ualDataBlob.Address.ss_family = AF_INET; InetPton(AF_INET, ip_number, &(reinterpret_cast<SOCKADDR_IN *>(&ualDataBlob.Address)>sin_addr)); UalInstrument(&ualDataBlob); }
The application can then use Windows Management Instrumentation to get information from the event log about user access at the server level and use it in the UI. For instance, Google Mail informs the user about access from other IP addresses right on the main mail page. This kind of information is good for both reference and security.
4 March 2013
In Windows 8, hybrid shutdown (S4) stops user sessions, but the contents of kernel sessions are written to hard disk. This enables faster startup. You can use that fact to your advantage when checking power state on launch in Microsoft .NET and C++, although in JavaScript, that information isnt yet available.
Got Games?
In the world of gaming, most of the improvements available in the Windows Store for Windows 8 are also available to Desktop apps. For example, Microsoft XAudio2 is a new set of sound APIs available as part of the Windows 8 SDK. Games that are using Microsoft DirectSound* on the Windows Desktop platform should certainly look at XAudio2. XAudio2 now supports per-voice filtering and digital signal processing effects as well as submixing with voices. New audio formats are supported, and runtime decompression of compressed audio is finally available. This brings the Windows game sound up to par with the awesome video control in Microsoft DirectX*. Also, the XAudio2 APIs will not block the audio processing enginea critical feature for the development of crash-free desktop games. Microsoft XInput lets an application take input from the Xbox* controller from Windows. Using an Xbox controller in a Windows game takes user interaction to a whole new level. XInput has been enabling Xbox controllers for Windows since Windows XP and has a new 1.4 version for Windows 8. The new version supports upcoming features of the controllerforce feedback, wireless, voice, plug-in devices, and navigation buttons. You can find XInput 1.4 in the Windows 8 SDK.
4 March 2013
10
Use Sensors
Although sensors are more a mobile development feature, desktop apps run on Ultrabook and tablet devices, too. Desktop-style apps likely can be improved with some integration with the sensor array in an Ultrabook device, laptop, or tablet. Windows uses physical sensors to provide some logical sensor objects for application use. These logical objects include: Light sensor. How much light is in the users environment Global positioning system. Uses the Global Positioning Satellite network Accelerometer. Determines changes in the movement of the device Compass. Magnetic direction changes Orientation. General sensor for figuring out how the user is viewing the device Of course, not all sensors are available on all devices, so take care. That said, integration with the machine at the sensor level gives the user a much more modern experience.
Do Data Differently
Data access is a moving target in modern applications. Windows Store apps cant directly connect to most databases and require use of a service layer for most storage options. Big data and hugescale reporting are changing the face of both storage and access. The Windows API is changing a bit to support this movement in access options.
Compression API
Moving data into and out of applications is time-consuming and expensive. Use of compression can mitigate these problems, and the Compression API is the first low-level toolset for compression in Windows. It supports: MSZIP XPRESS XPRESS_HUFF LZMS
4 March 2013
11
Storage Management API, but if an application is file-centric and focused on the enterprise, there will still be a use for the interface.
Conclusion
Existing Desktop apps do have a place in the new Windows 8 ecosystem. With a little updating for touch interaction, cloud storage, and new user interaction APIs, existing apps are ready for listing in the Windows Store. Get the Windows App Certification Kit today, run your existing Desktop app through it, and see what has to change. Then, implement the recommendations above to be ready for Windows 8!
References
Designing for Ultrabook Devices and Touch-enabled Desktop Applications: http://software.intel.com/en-us/articles/designing-for-ultrabook-devices-and-touchenabled-desktop-applications How to use the Table Storage Service: http://www.windowsazure.com/enus/develop/net/how-to-guides/table-services Whats new in Microsoft .NET 4.5: http://msdn.microsoft.com/enus/library/ms171868.aspx#core XAudio2 APIs: http://msdn.microsoft.com/enus/library/windows/desktop/hh405049(v=vs.85).aspx XInput API: http://msdn.microsoft.com/enus/library/windows/desktop/ee417003(v=vs.85).aspx Windows SDK for Windows 8: http://msdn.microsoft.com/enus/windows/hardware/hh852363.aspx Compression API: http://msdn.microsoft.com/enus/library/windows/desktop/hh437596(v=vs.85).aspx Ultrabook and Tablet Windows 8 Sensors Development Guide: http://software.intel.com/en-us/articles/ultrabook-and-tablet-windows-8-sensorsdevelopment-guide
4 March 2013
12
4 March 2013