How to deploy windows form applications on a winRT tablet (Surface)? - winforms

Is it possible to deploy a windows form application to a winRT tablet? Say surface.
The target platform for a win form application is either x86 or x64 and not ARM. Hence I am not able to build a win form application for the tablet and hence could not be executed on the tablet.
Thanks,
Soorya

No, it's not a supported scenario. You can only develop Windows Store (Windows Runtime also known as WinRT) applications to an ARM device running Windows RT. Windows Forms (aka. WinForms) applications are desktop applications leveraging the legacy desktop Windows API/WinAPI/Win32.

Related

Difference between Windows Phone 8.1 and Windows Phone Silverlight 8.1

I was reading about Windows Phone 8.1 Development, because I already work with Windows Phone 8 and I intend to start working with the new OS version.
Then I downloaded the Visual Studio for Windows with update 4, opened one project of mine (target to WP8) and clicked to "upgrade to 8.1".
I saw that my solution changed the name to "Windows Phone SilverLight 8.1".
Then I tried to create a new project targeting Windows Phone 8.1, and I saw the following options under Visual C# tree (as shows the image):
Universal Apps
Windows Apps
Windows Phones Apps
As my goal is to develop for phone devices with Windows Phone 8.1, I chose "Windows Phone Apps". But I saw that this project is kind different from the other (the one that I upgraded from WP8). It appears "Windows Phone 8.1" on the solution instead of "Windows Phone SilverLight 8.1". And codes are also very different.
So, I made a research about it, to understand the difference between "Windows Phone SilverLight 8.1" and "Windows Phone 8.1", read some posts like this:
Difference between Windows Phone Silverlight 8.1 and Windows Phone 8.1 development
What is the difference between Windows Phone 8.1 and Windows Phone 8.1 Silverlight
In windows phone 8.1 what is the differance between Windows phone project and silverlight project?
but I couldn't find anything that made me understand.
At some point, I found an answer saying that "Windows Phone 8.1" is for Universal Apps... but I disagree, if I wanted to create an Universal App, I would choose the "Universal App" instead of "Windows Phone Apps".
Does anyone knows exactly the difference between this two projects?
The main difference is that Windows Phone 8.1 Store Apps strictly use WinRT APIs which are not available under Silverlight.
Before you read on, this is the short version:
Windows Phone 8.1 Store App code runs on all Windows Phone 8.1+ and Windows 8+ machines, since it uses the unified WinRT API.
Windows Phone Silverlight App code runs on all Windows Phones 7+ but not on all Windows 8 machines (ARM machines do not support all features). That's why Windows Store apps are using different APIs (WinRT). You might want to check out this link: http://msdn.microsoft.com/en-us/library/windows/apps/jj681690%28v=vs.105%29.aspx
Windows Phones were using Silverlight apps only up to version 8 while apps for Windows 8 (an up) offered the WinRT API as well - you may have noticed the Windows 8 RT versions for ARM CPUs..
So - to stop the endless parallelism of Silverlight and WinRT Microsoft decided to unify the development process. Starting from Windows Phone 8.1, Windows Phone also runs WinRT (rebranded as Windows Runtime, I think) apps.
The main advantage is that you can now easily port Windows Phone 8.1 code to a Windows 8.1 app and vice versa, since both are using the same APIs. Accessing files, storage, networking.. it's all the same across Windows Phone and for Windows Store Apps.
This is where Universal Apps come into play. Instead of porting your code later by creating a new project you can now easily create a universal project that contains shared code both for Windows Phone 8.1 and Windows 8.1.
However, the downside is that your app won't run on Windows Phones < 8.1.
The difference is in the framework the app will use.
Silverlight is a plugin like Flash, so if you develop an app that use it, you have to use his library/syntax. It is an old way to develop web and phone applications.
Universal is the new framework that Microsoft develop for help developers to create apps that run both on Windows Phone or Windows Store.
So, what you find in internet is correct: Phone App is for Universal framework.
The voices that VS offers mean:
- Universal App: for any device (Phone/Tablet/PC)
- Phone App: only for Phone (pay attention! Can use any library developed for Universal App since Universal App can run on Phone)
- Windows App: only for Tablet/PC (no phone). You can use Universal App library like Phone App can do
I hope this could help
Silver Light project does have service reference facility while in window phone it is removed so you can use either azure provided services or rest services while developing for windows phone

Targeting Windows Phone app for maximum devices

Are following statements correct regarding Windows Phone app?
Windows Phone Silverlight app targeting 8.0 will work on all Windows Phones running 8.0 and above. It will not work on Windows desktop and Surface RT and Surface Pro tablets.
Windows Phone Silverlight app targeting 8.1 will only work on phones running Windows 8.1. It will not work on Windows desktop and Surface RT and Surface Pro tablets.
Windows Phone app will work on all Windows Phones running 8.0 and above and Surface RT tablets. It will not work on Windows Desktop and Surface Pro.
Windows Univeral app will work on all phones, tablets (Surface RT, Surface Pro) and desktop systems running Windows 8.0 or above.
Yes. Yes. No. No.
Maximum number of devices is hard to judge since there isn't a single definitive answer, and maximising devices by targeting older API means the app will not make use of newer features: Windows Phone Runtime apps are easy to port to Windows via Universal projects, but won't run on Windows Phone 8 devices. Windows Phone 8.0 apps will run on Windows Phone 8 devices but will be difficult to build for Windows. Windows Phone 7 apps miss many new features such as higher screen resolutions.
Windows Phone and Windows are separate (but related) OSes. Windows tablets run the same OS as Windows desktops (this is different from Android and iOS where Phone and Tablet share the OS). Windows RT runs a limited version of the desktop Windows OS.
Windows Phone apps do not run on Windows.
Windows apps do not run on Windows Phone.
Windows Universal apps bridge the two and allow essentially the same source code to be built for either Windows or Windows Phone.
Windows Phone apps are upwards compatible:
Windows Phone 7 apps run on Windows Phone 8 and 8.1. Windows Phone 8.0 apps run on Windows Phone 8.1.
Windows apps are upwards compatible:
Windows 8 Store apps will run on Windows 8 and Windows 8.1
Windows 7 desktop apps will run on Windows 8 and Windows 8.1
Windows Phone 8 supports only Windows Phone Silverlight (8.0) apps.
Windows Phone 8.1 supports Windows Phone Silverlight (8.0 & 8.1) and Windows Phone Store apps.
Windows RT supports Windows Store apps (AnyCPU or arm)
Windows 8 & 8.1 support Windows Store apps and Windows desktop apps. (AnyCPU, x86, or x64)
Windows Runtime apps are apps which use the Windows Runtime. On the Windows Phone they are called Windows Phone Store apps. On Windows they are called Windows Store apps.
Universal apps are a way to share source for Windows Runtime apps across different targets (both Windows Phone Store apps and Windows Store apps). They apps need to be compiled separately and except for very simple apps generally have some differences between the two. Typically the UI is different but the underlying app logic is the shared. From a development standpoint, a Universal app solution contains a Windows Phone project for phone specific code, a Windows project for Windows specific code, and a Shared project for shared code.
MSDN has more details at What's a Windows Runtime app?
For more on differences between Windows Phone Runtime apps and Windows Phone Silverlight apps see Migrating your Windows Phone 8 app to a Windows Runtime XAML app
As far as i know Windows Phone apps would never work on tablets where as Windows Store apps can be deployed.
According to your statements:
Yes
Yes
Windows Phone apps (Target not specified, so assuming as WP 8) would work on Windows Phone devices which are 8 or above.
Yes, Universal apps are where, the solution would contain both the Windows Store & Windows Phone projects as combined with a folder for the Shared Resources. These can be deployed on devices which have the target version of 8.1.

Windows Phone or Windows Phone Silverlight

I have just installed Windows 8.1 and then installed Visual Studio 2013 Community Edition.
I tried to create a Windows Phone app and found out that there are two ways of creating it (in fact 3 if you count Universal Apps if I am not wrong)
Windows Phone
Windows Phone Silverlight
Can someone please tell me what exactly is the difference between these two? I read a couple of articles but still don't understand and this whole thing is very confusing.
When I tried to create a Windows Phone Silverlight project then it asked me whether I want to target 8.0 or 8.1.
When I tried to create Windows Phone project then it asked me to get a Developer license and didn't ask about version 8.0 or 8.1.
What shall I chose if my aim is to create an application for mobile devices (tablet/phones) that will run on maximum devices running Windows Phone 8 version?
Windows Phone 8 Silverlight is the older UI on Windows Phone 8. WinRT XAML is used for Windows Store Apps(these are Universal Apps). Windows Phone 8.1 Silverlight is a bit different as explained here.
Windows Phone Silverlight, although older, is better in some ways. If your aim is to develop an app that is targeted only for phones and that doesn't have any use getting ported to Win8/RT, go with Silverlight. Background Audio is a mess in WinRT. Speech Recognition with Cortana is worse.
The controls of WinRT XAML are buggy. For example, there is a clear performance degradation of MapControl in WinRT XAML, whereas, in Silverlight, this is smoother.
On the other hand, Windows Store Apps have .NET Native, which converts C# to native C++ code, resulting in performance gains.
For a beginner, I would advise starting with Windows Phone 8 Silverlight apps.
Windows Phone Silverlight is the "old" platform that WP8.0 apps are built on. It asked you to target 8.0 or 8.1 because WP8.1 has a hybrid mode that lets you build WP8.1 apps but still have access to the Sliverlight API if you had a whole lot of legacy code you didn't want to port over just yet.
Windows Phone is the (mostly) universal platform for WP8.1 that is based on Windows Runtime.

Can I host Windows Forms control in a Windows Store app?

I want to create Windows Store app and it in it would like to host some Windows Forms controls. Is this possible?
The short answer is no. As pointed out in the comments, Windows Store apps use XAML and not winforms, and also run inside an app container (Modern UI) and cannot access the desktop (where winforms works). Also, Windows Store apps run in a highly sandboxed environment and cannot run external desktop applications.
The answer to this question may have been "no" in the past, but it appears that Microsoft has a specific solution to address this scenario. the Desktop to UWP Bridge is designed to host Windows Forms and legacy applications in a UWP container that can (with some limitations) be installed from the Windows Store.
The Desktop to UWP Bridge appears to be designed to handle this situation
https://developer.microsoft.com/en-us/windows/bridges/desktop

Application that works on pc and mobile

I have to create an application with metro design on vs2010 and windows 7.
The application should work both on pc and device without internet.
Initially i though of wpf but i do not know if it works on Mobile.
Please let me know how i can develop once such standalone application for
both device and PC also
Unfortunately, there is not a single platform that targets both PC and Phone...although, the presumption is that Windows Phone and Windows Store applications are moving toward a unified foundation.
Windows Store applications unfortunately don't run on Windows 7. Only Windows 8 and above, but the advantage is they work with the desktop version as well as the tablet version of windows.
If you want to target windows 7 and say windows phone as well, your best bet is to use portable class libraries to create a common "core" for the application. And use WPF for the desktop which has a lot in common with XAML for Windows Phone.
If you want to target windows phone 8, you have to use Visual Studio 2012 or above.
Pretty old question, but in case anyone is still blindfolded, there is UWP.
Furthermore, if you want to have XAML and C# deployed as native apps in a variety of platforms (UWP, Droid, iOS, WinPhone), be sure to check out Xamarin, which now belongs to Microsoft, and follows the awesomeness of open-source MIT just as the entire .NET does now.

Resources