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

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

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

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

Related

Communicating between the desktop Apps and Windows store app

I want to share an image file between Desktop application and the windows store application. What is the best way to do the communication between the desktop app and the windows store app.I have tried creating the shared memory between the apps, but i think this is not possible( Reference ).
It's not possible to communicate and share date directly, except launching via protocol handler. As Aniruddha already said sharing via Filesystem (e.g. pictures library) is a convenient way to do it.
If you are on Windows 8.1 and don't have the requirement to put your application in the public Windows Store there's another option:
Windows Runtime Brokered Components. This is quite awesome stuff. It allows you to freely communicate between a Windows Store App and any other application. It is documented here: https://msdn.microsoft.com/en-us/library/windows/apps/dn630195.aspx
The setup isn't exactly easy but it is very powerful. Keep in mind that you won't get this app published into the public Windows store, if you're using brokered components.
I haven't tried Brokered Components on Windows 10 yet, I'm not sure if this is still supported.

Would controlling a Mobile/Belt Printer via Bluetooth from a Xamarin solution be easier from Android or WP8?

We are in the process of deciding whether our port of a legacy Compact Framework/Windows CE app (potentially cross-platform, thus using Xamarin in Visual Studio) should be done first for Android or Windows Phone 8 (iOS is on the "back burner").
I imagine the port of the existing (C#) code would be easier if we targeted WP8 (as opposed to Android), nevertheless welcome rebuttals/refutations. Am I right?
Even better would be some sample code of how such manipulation (sending PCL* from the PCL**) is accomplished. Does anybody have any they'd like to share (has anybody done this yet)?
If it is relevant, the device we would probably be writing to is a Zebra QL220, and we would be sending a barcode and related info.
* Printer Control Language
** Portable Class Library
Android Bluetooth socket with Xamarin exposes System.IO.Stream for both input and output. As long as you target the stream with the communication protocol you should be able to swap out Android BT socket with a virtual serial port on a computer or any other option that also provides a Stream to write to and read from. You could abstract it even further but I feel Stream is probably the most convenient target.

Best way to distribute Cloud HTML5 App

I thought PhoneGap was a simple wrapper for HTML5, but it looks like it does in fact compile into native in some way.
I have a Cloud based, HTML5 Single Page Web application that I just want to run full screen, and distribute via an app store.
Should I just create a PhoneGap App with an InAppBrowser?
If you intend to publish an HTML5-based app in a "native" app store sucha s Google Play or Apple Store, you have 2 options:
1- Implement your own native application using a webview to show your web-based app.
2- Use some existing framework like Phonegap/Cordova even you do not use the native API. The framework will already setup everything for you to just deploy your HTML5 code.
However, if your web app is meant to be hosted remotely (i.e. not run from local files), you may encounter problems when trying to publish in the Apple Store. They have some strict rules about remote content, and about publishing apps that may not provide much more value and/or functionality than a simple web-app can.
Best.

Not able to retrieve call Logs specifically through blackberry 10

I am able to retrieve call Logs through Blackberry-7 but not from blackberry-10 OS.
There are no methods provided to get call logs for blackberry 10 OS.
Is it possible to use methods of blackberry-7 in blackberry-10?
It turns out you can't do it in WebWorks, but you can add a native extension. I'm sorry that I can't provide you an example, but take a look at BlackBerry 10: Creating native extensions . From that page:
Although a BlackBerry WebWorks application has a wide range of functionality, that functionality is limited to the resources that the application contains. By creating a custom extension, you can extend the functionality of your application to include the features and functions provided by core native APIs that are available to BlackBerry 10 OS applications.
You create a custom extension in C/C++, which are the native languages for BlackBerry 10 OS, and then you wrap it in JavaScript. When you build and package your BlackBerry WebWorks application, you include the extension, so that your application can access the extension through JavaScript. You can pass arguments into the extended function and handle return values as you would in any native BlackBerry 10 OS application.

HTML5, jquery mobile app deployed as stand alone app

I have read a few forums and articles on this but can't get a clear answer.
I need to build a mobile app that can run on any platform/device. It looks like HTML5 + jquery is the best option but I need the application to do the following:
The app must run on any platform (Windows Phone, iOS, Android, etc).
It must work as a stand alone application. Meaning it must work without internet connection.
Because it is stand alone, I need a local database on the device. The database can be embedded in the app. I'm thinking SQL CE.
The local database on the device must be able to sync to a SQL Server database.
The app needs to interact with features of the device like the camera, or GPS device.
Is it possible to build such a mobile application?
I am using ASP.net MVC 4 to do the development.
If you want to use HTML5 and JQuery then the PhoneGap/Cordova framework would suit you best.
Phonegap is a cross platform framework that gives you access to the device features like GPS and Camera using a standard javascript API.
The app must run on any platform (Windows Phone, iOS, Android, etc).
Phonegap is compatible with all these and many more including blackberry. See here for full list: http://phonegap.com/about/feature/
It must work as a stand alone application. Meaning it must work without internet connection.
PhoneGap runs as a native application inside each devices webview. It does not need access to a data connection to run
Because it is stand alone, I need a local database on the device. The database can be embedded in the app. I'm thinking SQL CE.
PhoneGap cannot run its own SQL Database like a standard native application but it can use the web standards Web Storage and Web SQL. Though this approach does have limitations. Read more about this here: http://docs.phonegap.com/en/1.2.0/phonegap_storage_storage.md.html#Storage
The local database on the device must be able to sync to a SQL Server database.
This would be upto you to design and implement but can definitely be done
The app needs to interact with features of the device like the camera, or GPS device.
Most device features supported with PhoneGap. See above link for full support list.
If the lack of a full SQL Database support is a problem for you there are frameworks like Titanium Appcelerator that build a fully native cross platform app for you that may be more suited to your situation.
http://www.appcelerator.com/platform/titanium-platform/
But if you're using HTML and JQuery to go cross platform then PhoneGap is your best bet.
Edit: Also there are plugins for PhoneGap to run a standard SQLite DB but this requires extra work on each platform. Every platform you develop for would require a compatible plugin.
http://brodyspark.blogspot.com.au/2012/12/cordovaphonegap-sqlite-plugins-offer.html
Use PhoneGap: http://phonegap.com/
or Apache Cordova: http://cordova.apache.org/
or Intel XDK: http://xdk-software.intel.com/