WP8 Developer Series–Getting to know Common API’s for Windows Phone 8 and Windows 8

WindowsPhone8.svg Windows 8 logo and wordmark.svg

 

[ Windows 8 and Windows Phone 8 logos are trademarks of Microsoft ]

Windows Phone 8 is the second generation of the Windows Phone mobile operating system by Microsoft, officially announced the release to manufacture on 29th OCT 2012. Previous Windows Phone versions were all based on old CE kernel and with Windows Phone 8 ā€“ Microsoft made sure to shift the focus to a better kernel which can handle multi-core processing capabilities. That why Microsoft has choose Windows NT based kernel as the base kernel for Windows Phone 8.

Windows 8 and Windows Phone 8 are sharing same core level technology(from kernel to networking and driver support, all of that will be common on Windows 8 and Windows Phone 8), Microsoft calls it ā€˜Shared Coreā€™. Windows Phone 8 will include more features aimed at the enterprise market, such as device management, BitLocker encryption (which is already included part of Windows 8), to facilitate all these common features ā€“ that is where ā€˜Shared Coreā€™ comes in to picture.

If you would like to know further about Shared Core ā€“ suggest going through Joe Belfioreā€™s video

Having a Shared Core will save lots of development time – if we are targeting for both the platforms (Windows 8 and Windows Phone 8), that is where Microsoft has done the magic. Microsoft has made sure that development will be lot easier if you can leverage the same code base for both Windows and Windows Phone 8, with minor changes. This is really a good move as a Unified platform.

Developing Applications for Windows Phone 8 and Windows 8

Windows Phone 8 and Windows 8 share the same .NET Framework engine.You can leverage the same .NET engine in your XAML apps for Windows Phone 8 and Windows 8, and use sharing techniques to maximize code reuse for these apps on both platforms.

Now we will try to familiarize with common APIā€™s on both platform which can save our time while developing applications targeting both.

Following partā€™s of this article is prepared based on the Original MSDN Source ā€“ Windows Phone 8 and Windows 8 platform comparison

1. Common Native APIā€™s

As a Windows Phone developer now you can develop Games in C++  using new Windows 8 aligned Direct3D application model.

The set of native APIs that are common to Windows Phone 8 and Windows 8 are listed below:

  • DirectX 11.1
  • XAudio2
  • MediaEngine
  • STL
  • CRT
  • WinSock

Additional references:

2. Common Windows Runtime APIā€™s

Windows Runtime is a technology first introduced in Windows 8 and which offers a core infrastructure, a common type system, and a standard programming model.

It is firat implemented in C++ and ported into C#, VB, C++, and JavaScript, so it is easy to consume with the language of your choice.

  • A subset of Windows Runtime is built natively into Windows Phone 8, with the functionality exposed to all supported languages.
  • This gives you the ability to use the same API for common tasks such as networking, working with sensors, processing location data, and implementing in-app purchase.
  • By using common Windows Runtime API in your app, you increase the potential to share code between your Windows Phone 8 and Windows Store apps to save time and improve the maintainability of your apps over time.

[Source – msdn]

The following list is the Windows Runtime APIs that are common to both platforms:

  • Networking
  • Sensors
  • Proximity
  • Storage
  • DataSaver/Connection Manager
  • Location
  • Touch
  • Online Identity
  • Keyboard
  • Launchers & Choosers
  • In-App Purchase
  • Sensors
  • Threading
  • Base Types/ Windows.Foundation

3. Similar UI Controls

Between Windows Phone 8 and Windows 8 XAML controls you will see lots of similarities. Same control name, class name etc ā€“ this makes the use of same code and controls on both the platforms. Developers will be familiar with both the platforms, and do not have to spend much time in porting from one to another.

  • The set of controls available on Windows Phone 8 is available in the System.Windows.Controls namespace.
  • The set of controls used on Windows 8 is in the Windows.UI.Xaml.Controls namespace.

You may read further about it on: XAML controls comparison between Windows Phone 8 and Windows 8.

4. Shared Engine

Windows 8 and Windows Phone 8 shares the same .NET Framework engine. You can leverage the same .NET engine in your XAML apps for Windows Phone 8 and Windows 8, and use sharing techniques to maximize code reuse for these apps on both platforms.

For more info, see .NET API for Windows Phone.

[ Content Source ā€“ msdn on Windows Phone 8 and Windows 8 platform comparison ]

 

Recommended Reads:

Concepts and architecture for Windows Phone

Maximize code reuse between Windows Phone 8 and Windows 8

XAML for Windows Phone

Learn about Windows Store app development

Learn about Developing apps for Windows Phone

XAML controls comparison between Windows Phone 8 and Windows 8.

What’s new in Windows Phone SDK 8.0

Develop Windows Store apps using Visual Studio 2012.