Runtime of UWP app - windows-runtime

I can't find any deep information about how UWP apps are actually running.
I read on Wikipedia that UWP is based on WinRT. WinRT incorporates some kind of .NET runtime. Is it CLR? Is it some form of CLR or what?

UWP has nothing to do with .NET or the CLR. It is implemented in C++ and uses COM under the hood. It is language agnostic, meaning its API can be consumed by different languages (C#, VB.NET, F#, C++/CX, C++ and JavaScript right now).
If you're using C# to consume the UWP APIs, then the UWP types are projected into equivalent CLR types. For example, if you instantiate a Windows.Web.Http.HttpClient instance, not only do you get a CLR System.Object back, but under the hood the underlying COM object is "activated" a-la RoActivateInstance (or something like that).

Related

Xml serialization/deserialization in WinRT (Store application)

I need to make a Windows Store application that exchanges xml serialized data over a TCP connection with a server. Since I need to use Direct3D rendering in the application I went for the c++/cx store application template however I ran into issues with xml serialization/deserialization.
My usual approach in C# would be to use the XmlSerializer and classes with DataContractAttribute annotations. However as soon as I try to import System.Xml.Serialization assembly I get the C1114 error - WinRT does not support #using of a managed assembly. However there are lots of examples that mention using this approach in a Windows Phone app from C#.
So the question is - is only c++/cx limited in support for .NET in Windows Store applications and C# can use all the standard components on phone as well or is switching to C# in this case also not a solution and I need to use the WinRT classes for xml serialization/deserialization?
Your confusion is understandable, what with the variety of frameworks Microsoft has put out there.
C++/Cx is a native binding to the Windows Runtime (WinRT). It does not use any managed code or the .NET framework in any way, which is why you're getting the C1114 error.
C# provides a managed binding to WinRT. It does leverage the .NET framework, so in a C# Windows Store application, you can make use of some of the base-class library. This subset is referred to as the .NET Profile. This article talks about this more: http://blogs.msdn.com/b/dotnet/archive/2012/04/17/net-for-metro-style-apps.aspx
In your specific case, you are using a C++/Cx application because you want access to Direct3D. This makes sense, although it means that you will not have access to System.Xml.Serialization. Instead, as you surmised, you will need to use APIs that are available to C++/Cx to read XML, specifically Windows.Data.Xml.Dom: https://msdn.microsoft.com/en-us/library/windows/apps/windows.data.xml.dom.aspx

is WinRT a virtual environment to run Application?

I'd like to know whether applications designed for WinRT are run within a Virtual Machine or compiled in bytecode in order to be compiled once and run everywhere as the slogan says.
The slogan isn't that. WinRT apps rely on COM for runtime cross-environment calls and a metadata format (winmd) to describe the types.
A WinRT app can be fully native (as is most/all of the framework and even the XAML engine).
Individual DLLs or the app itself could be written in a .NET language, and it will interop almost seamlessly with the rest of WinRT thanks to the extended interop code added to the CLR. Under the hood, it's mostly COM interop as usual, but with added "projections" of chosen WinRT types. This is what makes a WinRT IVector look like an IList in .NET. They're just automatically wrapped.
The strength of WinRT is the binary method calling abstraction of COM and the metadata system (without which the language "projections" wouldn't exist). But it is definitely native, just like COM is, and you can stay in C++ without revving up the .NET CLR if you like.

Is it possible to call a library written by C language on Windows Phone 8?

I have a library written by C language, which contains some complicated mathematical algorithm. I'm not going to porting it to C# language, can I use it in my WP8 project? and How?
You can use C library in C++ libraries, specifically, inside C++ Windows Phone Runtime Component. You can then use that proxy/wrapper library straight from C#.
C# cannot access native methods without such proxy. You will have to think about data types translation and what you want to do with it exactly.
Native code on Windows Phone 8

simple JSON parser/Generator for C++ (Windows VS 2010)

Can someone suggest simple JSON parser for C++ Windows VS 2010, possible which can be used for commercial purpose without licensing issues.
The requirement is to
Fetch and package the data in JSON from C++ program,
It would be transferred over network (TCP socket) and would further be read from Android device.
The data is to be sent is light, not very heavy.
Thanks.
Boost and its property tree library can create and parse JSON.

Spring.net and Oracle Coherence integration

I probably suck as Googling stuff, but I couldn't find any link that mentioned whether its possible to integrate Spring.net with Oracle's coherance product.
Does anyone know if Spring.net has wrapper libraries for the same ?
Thanks in advance.
The spring integration project for .net is still listed as a spring.net extension project, it's status is "incubator" and it hasn't had any commits since March 2010.
From the project homepage:
The Spring Integration for .NET project will use the design and code
base of the Spring Integration project as a basis, adapting the code
as need to support .NET idioms and move in the direction to take
advantage of .NET only features such as Lambda expressions and
extension methods.
I'd suggest you first find out if Spring Integration for Java supports Oracle's Coherance and if so, you might have a slight chance to get this working in .NET too.
Oracle Coherence provides a native .NET client that you can use to access it from any .NET application, including Spring.NET-based apps.
Here is a link to docs:
http://docs.oracle.com/cd/E24290_01/index.htm
What you are interested in is covered in the Client Guide (Parts I and IV) and .NET API Reference.
My book, Oracle Coherence 3.5, also has two chapters on .NET and POF (Portable Object Format), as well as a full blown WPF sample application talking to a Coherence Java backend.