Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows 8 & Windows Phone 8

How can I develop an App with Visual Studio Professional 2012 for both Windows Phone 8 and Windows 8 (tablets)? I hope on beeing able to reuse most of the code.

like image 445
D-32 Avatar asked Dec 20 '12 00:12

D-32


People also ask

Is Windows 8 still available?

No. Support for Windows 8.1 is discontinued, but the software will continue to function. However, after January 10, 2023, your computer running Windows 8.1 will no longer receive security updates. In addition, Microsoft customer service will no longer be available to provide Windows 8.1 technical support.

Is Windows 10 or 8 better?

Winner: Windows 10 corrects most of Windows 8's ills with the Start screen, whilst revamped file management and virtual desktops are potential productivity boosters. An outright victory for desktop and laptop users.

Is Windows 8 faster than 7?

At the end we concluded that Windows 8 is faster than Windows 7 in some aspects such as startup time, shut down time, wake up from sleep, multimedia performance, web browsers performance, transferring large file and Microsoft excel performance but it is slower in 3D graphic performance and high resolution gaming ...

Is Window 8 good?

With no more security updates, continuing to use Windows 8 or 8.1 could be risky. The biggest problem you'll find is the development and discovery of security flaws in the operating system. Since Microsoft will no longer patch them, it's a persistent hole in your system's defenses.


2 Answers

Some thoughts on how to get high code reuse:

  • Currently XAML may be your best language choice...lots of overlap between Win8 and WP8. Here is a XAML controls comparison between Windows Phone 8 and Windows 8.
  • Leverage the MVVM pattern. This gives a nice decoupling of your UI and application logic.
  • Use portable class libraries (DLLs that can be used across Win8, WP8, and other platforms). More info here.
  • Or, use "Add as link" to reference the same source file from both Win8 and WP8. That way, you are maintaining the source code in one place, but it is used by both your Win8 and WP8 apps.
  • Use conditional compilation. This will enable you to compile certain chunks of code in only for Windows 8, for example. It's nice to use sparingly, but if you find yourself using this technique often, your code can get very difficult to read and for others to maintain.
  • This video on How to Leverage your Code across WP8 and Windows 8 from BUILD 2012 is helpful.
  • There are lots of useful links on http://aka.ms/ShareCode and Getting started developing apps for Windows Phone 8 and Windows 8.
  • SIDE NOTE: it's nice that you have Visual Studio Professional if you're developing for both. You can develop for both using the free versions (Visual Studio Express for Windows 8 and Visual Studio Express for Windows Phone, both available for download here), but with Professional, you can have one instance of Visual Studio open and reference both types of projects in the same solution.
like image 139
Jennifer Marsman - MSFT Avatar answered Sep 30 '22 04:09

Jennifer Marsman - MSFT


There is a good blog post covering this subject here.

like image 35
Bryant Avatar answered Sep 30 '22 04:09

Bryant