Martin Suchan – BloQ Random #WPdev stuff

23Jan/143

New API in Windows Phone 8 GDR3

In this article I describe new developer APIs available in Windows Phone 8 GDR3/Update 3, at the time of writing this article the latest official version of Windows Phone OS.

First of all, GDR3 brings officially no new API, only minor changes in OS behavior, support for 1080p devices, devices with 2GB of RAM, couple of new Uri schemes and that's basically it. But what you might have noticed last week, Pedro Lamas described in his article  Disabling screenshot functionality in a Windows Phone app one undocumented new property

  • PhoneApplicationPage.IsScreenCaptureEnabled

After reading that article I was wondering, if there are another new APIs available in the GDR3 update, that can be accessed by reflection, so I stared my analysis.

At first I tried manual method using Reflection and goind in foreach over all assemblies, types, methods and properties, dumping all names and types to file and comparing results of such run on vanilla Windows Phone 8 emulator and new GDR3 emulators. I've indeed found couple of new or updated properties and methods, but this method was just too cumbersome for any actual research.

Then I tried more sophisticated research. I remembered, that it is possible to access emulator images like any other virtual hard drives. How to mount the emulator images as virtual drives is described here and it's really easy.
After mounting original WP8 emulator image and GDR3 emulator image, I've entered the drive with Windows folder in it and there the System32 folder. This folder contains Device Native Libraries for the Windows Phone app runtime. These native libraries for WP8 RTM can be actually found in your PC as well,  if you have the Windows Phone 8 SDK installed, in this folder:

  • C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\DeviceNativeLibraries

In the DeviceNativeLibraries folder I found 75 dlls, so I've copied these dlls from both emulator images into local folders and unmounted the emulator images. Additionaly the System32 folder also contained Windows.ni.winmd library with the Windows Phone Runtime APIs, I've compared original and the new version of this library as well. For comparing different dll versions I've used the tool Framework Design Studio.

New APIs in managed libraries

In 75 native libraries is really not many changes:

  • bool Microsoft.Phone.Controls.PhoneApplicationPage.IsScreenCaptureEnabled - new property, that can be used for disabling the screenshot ability using Start+On button
  • Uri Microsoft.Phone.Shell.ShellToast.Sound - new property, that can be used for defining custom Toast notification sound.
  • miscellaneous fixes in System.Linq.Enumerable methods
  • miscellaneous fixes in Microsoft.Phone.Reactive.Observable and Microsoft.Phone.Reactive.ObservableExtensions
  • miscellaneous fixes in System.WindowsRuntimeSystemExtensions

New APIs in Windows Phone Runtime library

In the Windows.ni.winmd I've actually found lot of new classes and also some changes to already existing classes.

Windows.Devices.PointOfService

In WP8 GDR3 the WinPRT library contains lot of Windows 8.1 classes for Point of Service apps. As far as I can say most of these hidden classes in WinPRT library probably cannot be used by regular apps, but only by operator-specific or OEM-specific apps. Nevertheless it's a nice discovery and also a promise, that Windows 8.1 and Windows Phone 8 API is getting slowly close together.
These classes and enums can be found in WP8 GDR3:

  • BarcodeScanner
  • BarcodeScannerCapabilities
  • BarcodeScannerDataReceivedEventArgs
  • BarcodeScannerErrorOccurredEventArgs
  • BarcodeScannerImagePreviewReceivedEventArgs
  • BarcodeScannerReport
  • enum BarcodeScannerStatus
  • BarcodeScannerStatusUpdatedEventArgs
  • BarcodeSymbologies
  • ClaimedBarcodeScanner
  • ClaimedMagneticStripeReader
  • MagneticStripeReader
  • MagneticStripeReaderAamvaCardDataReceivedEventArgs
  • enum MagneticStripeReaderAuthenticationLevel
  • enum MagneticStripeReaderAuthenticationProtocol
  • MagneticStripeReaderBankCardDataReceivedEventArgs
  • MagneticStripeReaderCapabilities
  • MagneticStripeReaderCardTypes
  • MagneticStripeReaderEncryptionAlgorithms
  • MagneticStripeReaderErrorOccurredEventArgs
  • enum MagneticStripeReaderErrorReportingType
  • MagneticStripeReaderReport
  • enum MagneticStripeReaderStatus
  • MagneticStripeReaderStatusUpdatedEventArgs
  • MagneticStripeReaderTrackData
  • enum MagneticStripeReaderTrackErrorType
  • enum MagneticStripeReaderTrackIds
  • MagneticStripeReaderVendorSpecificCardDataReceivedEventArgs
  • UnifiedPosErrorData
  • enum UnifiedPosErrorReason
  • enum UnifiedPosErrorSeverity
  • enum UnifiedPosHealthCheckLevel
  • enum UnifiedPosPowerReportingType

Documentation to most of these classes can be found here.

Windows.Phone.Accessibility

WP8 GDR3 contains couple of new classes for supporting the accessibility.

  • enum AccessibleButton
  • AccessibleButtonPressedEventArgs
  • enum AccessibleButtonPressEvent
  • AccessibleButtons

Windows.Phone.Accessibility.MessageManagement

  • enum AccessibleInstantMessagingPresence 
  • AccessibleMessageManager
  • AccessibleTextConversation
  • AccessibleTextMessage
  • AccessibleTextMessageAddedEventArgs
  • AccessibleTextMessageDeletedEventArgs
  • enum AccessibleTextMessageDirection
  • AccessibleTextMessageChangedEventArgs
  • enum AccessibleTextMessageStatus
  • enum AccessibleTextMessageType

Windows.Phone.Accessibility.PhoneCallManagement

  • EmergencyModeChangedEventArgs
  • PhoneCall
  • enum PhoneCallDirection
  • PhoneCallManager
  • enum PhoneCallState
  • enum PhoneCallStateReason

Windows.Phone.Networking.NetworkOperators

New WP8 GDR3 APIs related to Phone or SMS blocking features, that are used for instance in one of apps from Nokia Black update.

  • PhoneCallBlockedEventArgs
  • enum PhoneCallBlockedReason
  • PhoneCallFilter
  • enum PhoneCallFilterStatus
  • SmsFilter
  • enum SmsFilterAction
  • SmsFilterMessageReceivedEventArgs
  • enum SmsFilterStatus
  • enum TelephoneNumberCategories

Windows.Phone.PersonalInformation.Provisioning

API related most likely to saving contacts to phone.

  • IAsyncOperation<ContactStore> ContactPartnerProvisioningManager.OpenDeviceStoreAsync()

Windows.Phone.System

Undocumented API, according to the name it could be used for requesting unlock of the lock screen.

  • void SystemProtection.RequestScreenUnlock()

Windows.Phone.System.Power

This is actually the only officially documented new API in GDR3 update, property used for detecting whether the Battery saver is currently active or not.

  • bool PowerManager.PowerSavingModeEnabled { get; }

Here you can download the files with complete diff between WP8 RTM and WP8 GDR3 libraries.

Note: It's possible that some of these APIs are already available in the GDR2 update. If you are interested, I can update this article with information, which ones are already available in GDR2.

If you know something more about these hidden APIs or have any comments, feel free to contact me on Twitter @martinsuchan or under this article, thanks!