Reputation: 493
I am an ASP.Net developer, C#, VB, WinForms... these kind of things...
I want to start developing an Application that should run on my Surface Pro and Windows Phone 8.1 but if it could run on IOS and Android.. it would be great !
I had problems with XAML and I am pretty good with Javascript. So, I was thinking to write an Windows 8.1 app with Javascript then I heard about WinJS and Cordova and TypeScript.
The application is pretty simple for now, two options: First one is to read a barcode, search the resulting value in a DB using a web service and using another one to insert a new record inside the DB. Second one is a web view, similar to the idea of an iFrame with the URL of the current web site that is not developped by me.
I will need access to the camera and a barcode library. I heard Cordova can do this and that it enables me to test and build for IOS and Android but also probably can WinJS so I don't understand how those two are different and how they work togheter.
Last, can I use TypeScript to write an application that also uses Cordova and WinJS ?
If you would know any web sites or hints that could give me some help on those questions : Comparisons between Cordova and WinJS Sample of a project like mine or any advice in creating such an application Help on how to use TypeScript in such a context
Thanks for any help that will help me to get starting with this new project.
Best regards, Claude
Upvotes: 0
Views: 1354
Reputation: 1868
I assume by your question that you already have Visual Studio and have seen the Tools for Cordova extension that has been released? (This is an add on CTP for VS2013, or part of the product in the VS2015 Preview just released - see http://msdn.microsoft.com/en-us/library/dn757054.aspx ).
Cordova is the toolset that allows you to build applications based on web technologies that run similar to native apps cross-platform (very rough analogy - think cross-platform Ant or MSBuild for the platform SDKs). It also provides a wrapper to the web host to provide a consistent API to the device capabilities often not surfaced by the browser DOM (e.g. the device camera in your case). WinJS is a JavaScript framework for building app UI and logic (very rough analogy - think Angular + Bootstrap). WinJS has been very focused recently on providing good cross-platform support for different browsers.
The webview host on different mobile platforms have different capabilities, so you might want to check on http://try.buildwinjs.com/ for the latest cross-platform support. That said, there's no reason why you can't build a Cordova app using WinJS. In fact, there is a sample which is exactly that (see https://code.msdn.microsoft.com/WinJS-TODO-Sample-for-17295485 ).
As basarat mentioned; if you can write it in JavaScript, you can write it in TypeScript.
Upvotes: 0
Reputation: 275947
can I use TypeScript to write an application that also uses Cordova and WinJS ?
Yes. You can use TypeScript anywhere you can use JavaScript. TS compiles to JS which is what you deploy.
I heard Cordova can do this and that it enables me to test and build for IOS and Android but also probably can WinJS
Cordova provides a consistent device API to access device hardware and works for Android / iOS / Win 8.
WinJS is more focused on a consistent UI experience across all these devices (front end). It started focused on Win8 but is expanding to other devices.
Upvotes: 1