vijay053
vijay053

Reputation: 872

Can I use Node.js into my windows phone 8 application?

I am developing an app which requires transfer of data over socket. I have to use standard http protocol to send and receive data over sockets. So can I use Node.js into my windows phone 8 application for creating and parsing Http Requests and responses respectively?

I am writing code in c# .NET.

Thanks in advance. Regards, Vijay

Upvotes: 1

Views: 3192

Answers (2)

Jani Hyytiäinen
Jani Hyytiäinen

Reputation: 5407

I'm not sure about node.js but if your goal is to serve static files, such as html, you could look into the Katana Project here: https://katanaproject.codeplex.com/releases/view/113281

As for dynamic data on your static files you could leverage Owin and self host a SignalR endpoint on the phone: http://www.asp.net/signalr/overview/signalr-20/getting-started-with-signalr-20/tutorial-signalr-20-self-host

With SignalR, and C# you could expose much of the phone's functionality and sensor data on your phone.

To avoid creating a lot of unneeded boilerplate code, you could bind the data to your static html with mv* frameworks such as KnockoutJs or AngularJs. For cool looking graphs, you could leverage D3.js

Upvotes: 0

Martin Suchan
Martin Suchan

Reputation: 10620

Sadly you cannot create Windows Phone applications using HTML5+JavaScript, so you won't be able to use this library in your app.
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206940(v=vs.105).aspx

HTML-based phone apps aren’t a supported app model in Windows Phone 8. However, a developer can create a managed app with a XAML front end that uses an embedded browser control to display local HTML content, and it’s possible to access phone APIs by using the InvokeScript method and ScriptNotify events. Also, in Windows Phone 8, the phone’s browser has been upgraded to Internet Explorer Mobile 10, with a host of new features such as a robust HTML5/CSS3 implementation, Scalable Vector Graphics (SVG), ES5, IndexedDB, gesture events, and the addition of the high-performance scripting engine, creating new, interesting possibilities for Windows Phone 8 HTML developers.

But if you just want to use sockets in your WIndows Phone app, you can use them directly in C#:
Sockets for Windows Phone

Upvotes: 1

Related Questions