Quantcast
Channel: Visual Studio Blog
Viewing all 1076 articles
Browse latest View live

Apache Cordova Customer Spotlight: WeatherPerfect

$
0
0

clip_image002In this blog we typically share updates and improvements to Visual Studio itself. We also want to highlight examples of how developers use these tools to build compelling mobile apps.

Meet Sverre Nøkleby, a developer from Norway who’s been building the very cool WeatherPerfect app using Apache Cordova. I interviewed him recently over Skype and email. Among other things, we discussed how he built the app and his recommendations to developers that have a great new app idea they want to bring to reality.

Meet Sverre and WeatherPerfect

Tell me a little about your app. What prompted you to build it?

As a runner with a family and full time job, I often struggle with finding time to run. And where I live (Bergen, Norway) we have a lot of rain, which I would like to avoid when being outdoors. My wife and I pretty much organize our lives using shared calendars, so I ended up switching between the calendar and the weather forecast to find a good time to run. To make this process easier, I built WeatherPerfect. It is an app that combines the weather forecast and the user’s calendars to find the best time to run.

image

 

How long have you been developing software?

Professionally since 2002; as a hobbyist I started with Turbo PASCAL 1995. I've been involved in all layers of the [web development] stack at some point, with a focus on front-end development the last years. The last 5 years I’ve been using ASP.NET MVC. I’ve also been doing hobby-projects involving web-sites for around 10 years now. I also built tagdef.com, which has been reasonably popular and now has over 70,000 user-added definitions of hashtags.

What’s your background with mobile development?

I [built] an iPhone app a couple years ago with native iPhone development using Objective-C. I made a super simple Android app, as well. [WeatherPerfect] was my first take on using [Apache] Cordova.

Also, the web development I've done the last 2-3 years has taken mobile into account. We were the first bank in Norway to completely replace our "mobile bank" with a responsive web app.

Why did you decide to use Visual Studio?

There were multiple reasons. Because I’m an Android-user, I decided to target this platform first. But Android Studio and the Android emulator runs really slow on my old computer. I tried using it, but it got frustrating quickly. Visual Studio 2015 was out as a release candidate, and I had read that it supported multi-platform development using Cordova. It also turned out to run smoothly on my old PC.

Using Visual Studio and Cordova meant that I could develop in an environment and technology I’m familiar with. I’m pretty sure being able to use HTML5 and debugging in the browser gave me a flying start, compared to native development.

Why did you choose to build an application using Cordova?

[I’ve] been building web applications for 5 years, so the technology was very familiar to me. I didn't have to learn the Java/Android stack.

I didn't have to spend extra money beyond hiring a designer. The tools were free. Even though I chose to target Android first, the possibility to target other platforms without a total rewrite is a nice bonus.

Going from idea to published app

How long did it take you to build your application?

It took about two months from idea to publishing the app in the Google Play Store. I spent evenings and weekends to assemble the app in my spare time.

I tried to also allocate time to doing stuff we coders often ignore: making proper screenshots for the app-store, doing some user testing, trying to figure out a way to make the app known to the world, etc. I guess the fancy word for much of this is "App store optimization."

image

 

What was your development process like?

Even though web development in general is familiar ground, I decided to use this project as a way of learning some new technology or library. So this was the first time I used ReactJS in a real project.

I started with the key functionality: Fetching the weather forecast from a REST API, rating the different time period based on preferences, and fetching items from the user’s calendars from the phone.

I got external help on the design. The design was delivered as PDF, but the designer also provided CSS for the basic components, colours, fonts etc. This made the transfer from PDF to app much easier.

I did most of the initial testing and debugging directly in the browser on my computer. This meant I could adjust the GUI directly with the developer tools, edit code and run it instantly, and in the worst case edit code in Visual Studio and hit F5 in the browser. […] When the app got a bit more complex, I also used the browser for performance profiling.

A bit into the development process, I started testing more on real devices. I used an online tool [called TestObject] for this, which gave me access to all sorts of devices. I also used [the NodeUnit] library to add unit tests.

I set up Gulp in Visual Studio [to compile TypeScript, generate JavaScript from .jsx files, compile LESS and SCSS, and run unit tests].

What was the most difficult part of building your app and how did you overcome that challenge?

Making the app look like a native Android app with material design.

Perhaps this is due to my mediocre CSS skills, but you can still tell that the app behaves a bit different from a native app with material design. For example, when sliding between tabs, WeatherPerfect doesn’t have the smooth transitions that good native apps have. I honestly don’t know if this is something you get out of the box with native development, but this was one thing that I just had to cut in the initial version. I focused on making the GUI fast, and used some of the many CSS libraries and code-examples that emulate the material design look.

I ended up using very little external JavaScript and CSS for that. I was in the lucky position that my designer had made a design that followed many of the material design guidelines, and provided me with the CSS for colours and shapes. Again, a nice feature with Cordova is that CSS is a universally known design language.

image

Advice for other developers

For developers new to Cordova development, what advice would you give?

Try to identify the deal-breakers early on. If you are accessing native OS functionality, are there Cordova plugins available for the platforms you target? If not, it might not be many lines of code to make the plugin yourselves. I made a plugin for better geo-location on Android with very little Java or Android specific knowledge.

Remember that even the newest phones are much slower than your desktop computer. So keep an eye on JavaScript performance. Modern browsers have great support for debugging this.

If you get an error on a physical device that you cannot reproduce using the emulator on the computer, remember that you can attach the phone to the computer and do remote debugging from the browser.

What learning materials/sites did you use while building your app?

Wrapping up

A huge thank you goes to Sverre, for taking the time to share with me his experience and advice for Cordova developers! You can follow along with the WeatherPerfect app now by downloading it for Android devices and follow Sverre on Twitter.

I hope you found this interview interesting as we discussed the creation of the WeatherPerfect app using Visual Studio TACO. If you have an app you’d like to share with us, let us know by tweeting us on Twitter (@VSCordovaTools) or email us with your suggestion (vscordovatools –at- microsoft.com)!

 

clip_image010

Sverre Nøkleby (@MrCalzone)
Software Architect, creator of WeatherPerfect

Enjoys running and beer, but not at the same time.

clip_image012

Jordan Matthiesen (@JMatthiesen)
Program Manager, Visual Studio Tools for Apache Cordova

Jordan works at Microsoft on JavaScript tooling for web and mobile application developers. He’s been a developer for over 17 years, and currently focuses on talking to as many awesome mobile developers as possible. When not working on dev tools, you’ll find him enjoying quality time with his wife, 4 kids, 2 dogs, 1 cat, and a cup of coffee.


Top News for September 2015

$
0
0

Hello everyone! Every month we share some top stories from the previous month, and here’s our round-up for September.

Open-source, cross-platform MSBuild: Continuing the open-source, cross-platform .NET story that is already well underway with .NET Core and the .NET Compiler Platform (“Roslyn”), MSBuild is joining the fun as explained by Nikolai Tillmann. The sources are now on GitHub, and open to contributions are MSBuild makes its way to .NET Core.

MSBuild open source on GitHub

 

Cross-platform apps: Choices like Apache Cordova, Xamarin, and Unity all have great support in Visual Studio. In Building your first end-to-end Cross Platform app – Part 4 – iOS App, Shashank Bisen continues his journey with Xamarin that’s already covered Windows and Android. On Channel9, Episode 9 of the Office Dev Show features Richard diZerega who demonstrates how to build a Cordova app that integrates with Office365. And Alex Lian on Unity’s blog shares news about Unity 5.2 – your gateway to Unity Services (such as Unity Ads, Unity Cloud Build, Unity Analytics, and Unity Multiplayer), and how Unity 5.2 supports the Windows 10 Universal Windows Platform a much tighter integration with Visual Studio. And check out What's new for .NET and UWP in Win10 Tools 1.1 by Richard Lander.

 

Microsoft Loves Linux: People have been asking “What is Microsoft doing with Linux?” and the answer, as Michael Kelley puts it in Deep Dive #1:  Introduction to Linux and FreeBSD on Hyper-V is “a lot!” In addition to the work Michael describes for the datacenter, and the Linux support on Azure, Mickey MacDonald has written about how you can hook up Visual Studio Code for Linux with Unity’s experimental Linux build. And speaking of Visual Studio Code, Sean McBreen has shared that its documentation is now on GitHub.

Microsoft Loves Linux

Docker and Containers: When you bring up Linux with developers, you’ll probably get into a conversation about Docker and containers. If you want to get caught up on the subject, this Visual Studio Toolbox episode with Robert Green and Steve Lasker covers all the basics and how you can take advantage of containers from Visual Studio on Windows and Linux.

Robert Green and Steve Lasker talk Docker and Containers

A Summer of ASP.NET: With four releases of ASP.NET in the past few months, Jeffrey Fritz brings us up to date on all the .NET web developments of late, including ASP.NET 4.6, the continued betas of ASP.NET 5, and the exciting new WebHooks extension. There’s a full series of WebHooks posts on the .NET Web Development blog from Henrik Nielsen, starting with his Introduction and continuing with detailed posts about integrating with the likes of Slack, Salesforce, and Instagram. And if you’re ready to dive into ASP.NET 5, get started with Scott Hanselman’s introduction video on Microsoft Virtual Academy.

clip_image008

Something old, something new: Lastly, we have a small study in contrasts. For the old, Jim Springfield shares the story of Rejuvenating the Microsoft C/C++ Compiler, noting how there are still comments in the source code from 1982. I particularly enjoyed this article because I first encountered that compiler myself only a few years later. As for the new, which in fact also relates to something very old, spend a few minutes with Introducing U-SQL – A Language that makes Big Data Processing Easy by Michael Rys, right here on the Visual Studio blog. Michael explains that when you start working with Big Data, existing SQL-based languages fall short where extensibility is concerned, and procedural languages fall short in matters like scaling. Hence, U-SQL, which brings together the best of both.

To see what else we’ve shared recently, check out top news from August 2015 and top news from July 2015, along with recent posts on the Visual Studio Blog.

Enjoy!

clip_image010

Kraig Brockschmidt, Senior Content Developer, Visual Studio

@kraigbro

Kraig has been around Microsoft since 1988, working in roles that always have to do with helping developers write great software. Currently he’s focused on developing content for cross-platform mobile app development with both Xamarin and Cordova. He writes for MSDN Magazine, is the author of Programming Windows Store Apps with HTML, CSS and JavaScript (two editions) and Inside OLE (two editions, if you remember those) from Microsoft Press, occasionally blogs on kraigbrockschmidt.com, and can be found lurking around a variety of developer conferences.

Writing and Using Custom Code in U-SQL – User-Defined Functions

$
0
0

In my last blog post, I introduced U-SQL as the new Big Data query language for the Azure Data Lake that unifies the benefits of SQL with the expressive power of your own code. Today we are announcing the availability of the Azure Data Lake in public preview. You can now try U-SQL in Visual Studio and run it over massive amounts of data in the store and across relational store such as Azure SQL Database. In this blog post, I will dive a bit deeper into how you can extend U-SQL queries with custom code.

One of the major values of U-SQL is how easy it is to add user-specific code written in C#. Because U-SQL’s type system is based on C# and the U-SQL scalar expression language on the instances of these types is the C# expression language, it is very easy to use the power of the C# language and the .NET Framework and assemblies in U-SQL.

U-SQL’s C# integration

U-SQL’s core reliance on C# for its type system and scalar expression language provides the query writer access to the wealth of the C# and CLR libraries of classes, methods, functions, operators and types

This starts with that all C# operators except for the assignment operators (=, += etc.) are valid in U-SQL scalar expressions. In particular, all comparison operators such as ==, !=, <, >, the ternary comparison cond ? true-expression : false-expression, the null coalesce operator ?? are supported. Even lambda expressions using => can be used inside U-SQL expressions.

This very tight integration and seamless programming experience is syntactically also enabled by U-SQL being integrated with the C# Roslyn compiler. In fact, the U-SQL integration is probably the most complex application of the C# Roslyn compiler platform.

There are several ways how C# code can be used to extend U-SQL expressions:

  • Provide inline C# expressions in your U-SQL script: This often makes sense if a small set of C# methods need to be applied to process one of the scalar values. E.g., a string type method or a math function.
  • Write user-defined functions in a C# assembly and reference them in the U-SQL script: This is preferred for more complex functions, if the logic of the function requires the full power of C# beyond its expression language, such as procedural logic or recursion.
  • Write user-defined aggregators in a C# assembly and reference them in the U-SQL script: By providing user-defined aggregators, custom aggregation logic can be plugged into U-SQL’s processing of aggregation with a GROUP BY clause.
  • Write user-defined operators in a C# assembly and reference them in the U-SQL script: User-defined Operators (UDO) are U-SQL’s custom-coded rowset operators. They are written in C# and provide the ability to generate, process and consume rowsets.

For the user-defined functions, aggregators and operators, the C# assembly will have to be loaded into the U-SQL metadata catalog with CREATE ASSEMBLY (U-SQL) and then referenced in the script with REFERENCE ASSEMBLY. The Azure Data Lake Tools for Visual Studio make the registration process a breeze and even provides a so-called code behind experience where you just write the code and submit the script and the tool takes care of all the plumbing.

In today’s blog post, let’s look at the example I introduced a month ago and dive a bit deeper into the inline C# expressions and the experience of writing user-defined C# expressions and functions with U-SQL.

U-SQL inline C# expressions

Let’s quickly recall the sample: The data is twitter history of all my tweets, retweets and mentions in a CSV file that lives in a file in my Azure Data Lake Store:

Data in Azure Data Lake Store

Going back to our example, I now want to add additional information about the people mentioned in the tweets and extend my aggregation to return how often people in my tweet network are authoring tweets and how often they are being mentioned. In the previous post showed you a simplified version of the following U-SQL script (please read up on the philosophy and statement processing of U-SQL in the previous post):

U-SQL code

The highlighted parts of the script above show some of the places where U-SQL expects and accepts C# expressions. As you can see, you can use the C# expressions in the EXTRACT’s and OUPUT’s USING clause, in the SELECT clause and WHERE clause, as well as in the GROUP BY clause, ORDER BY clause and EXPLODE function, although in this example we just refer to a column name in the two later cases.

An important aspect of the integration is that the C# expressions have full access to the scalar values inside the query expression in a seamless way due to the fact that they are typed with C# types.

The EXTRACT’s and OUPUT’s USING clauses in line 6 and 32 take C# expressions resulting in a user-defined operator instance. The two built-in expressions above are calls to factory methods that return an extractor and outputter instance respectively. We will discuss user-defined operators in a future blog post in more details.

Let’s look at the C# expression from line 8 in a bit more details:

new SQL.ARRAY<string>(tweet.Split(' ').Where(x => x.StartsWith("@")))

This is a great example of the use of C#: The U-SQL built-in type SQL.ARRAY<T> is actually a C# object type that provides the expected SQL/Hive capabilities without the side-effect update functions of the existing C# Array type. You just use the C#’s new operator to create a new instance. The instance gets created by simply applying one of the many string operations on the column tweet that has been defined with the string type to break it into words. No more wondering where you get a certain string-type functionality as in normal SQL dialects: you have the full power of the CLR at your fingertips!

It gets even better. The Split method returns an IEnumerable<string>. So any further processing, such as filtering only the mentions from the tweet words can be done with a LINQ expression and using a lambda expression as the predicate. Now try that with your standard SQL language!

Let’s also look at the WHERE clause in line 21. Again, I can simply provide the C# expression referring to the columns in the rowset. The expression in this context has to result in a value of type bool. Now C# has two-valued logic and not three-valued logic as SQL. Thus the comparison r != null will return true if r is not null or false if it is null. Furthermore, by using the C# logical operator&&, I get the guarantee of C#’s execution order being preserved and more importantly, the short-cutting that will not execute the right comparison if the first will evaluate to false.

U-SQL and Visual Studio’s Code-Behind Capabilities

In the previous blog post I showed the code behind capabilities that will automatically deploy the code in the associated .cs file to the service on submission. In order to be able to refer to the methods and types and functions in U-SQL, the classes have to be defined as public and the objects need to be defined as static public.

U-SQL code

What the tool does is actually the following steps:

  1. The .cs file will be compiled into an assembly file.
  2. The user’s U-SQL Script gets augmented with a header that adds a CREATE ASSEMBLY statement that will create the assembly files binary content in your U-SQL metadata catalog.
  3. It also adds a cleanup at the end of the script that will remove the registered assembly with a DROP ASSEMBLY statement.

The following shows the modified script that the tool submits with the code behind header:

image

U-SQL Assemblies

I can also deploy and register the code as an assembly in my U-SQL metadata catalog myself explicitly. This allows me and other people to use the code in future scripts. It is also the preferred way to manage your user-defined functions, aggregators and operators, if you have more complex code that you want to maintain separately, where you may want to include existing code that may have been written in other contexts (like your XML or JSON libraries) or even call out to external executables (again a topic for a later blog post).

Since I have shown the code of how to use the assembly in the previous post, let me talk a bit more about the assembly management in U-SQL.

Similar to relational databases like SQL Server, U-SQL provides a metadata catalog and supports the standard database objects. One of the objects, is an assembly metadata object. By using the CREATE ASSEMBLY statement, you can register an assembly in the database. Assemblies are objects scoped to a database and the assembly DLL file gets placed into the assembly folder inside the relevant database folder inside the catalog folder in your primary Azure Data Lake Storage account.

In addition to storing your assembly, you can specify additional files that will be stored together with your assembly and will be included when you reference the assemblies. The CREATE ASSEMBLY statement syntax grammar looks like this (see the U-SQL language reference documentation for more details):

Create_Assembly_Statement :=
'CREATE' 'ASSEMBLY' ['IF' 'NOT' 'EXISTS'] Assembly_Name
'FROM' Assembly_Source
['WITH' 'ADDITIONAL_FILES' '='
'(' Assembly_Additional_File_List ')'].

Assembly_Name := Quoted_or_Unquoted_Identifier.

Assembly_Source :=
Static_String_Expression | lexical_binary_value.

Speaking of referencing an assembly, U-SQL has a small set of pre-loaded System assemblies and namespaces, including System and System.Linq. The set is kept small to keep the compilation time and the job’s resource utilization lower. If you want to refer to a different system assembly, you can just include them with the following statement that adds System.Xml:

REFERENCE SYSTEM ASSEMBLY [System.Xml];

What’s next?

The public preview of the Azure Data Lake has been opened today. So pleasesign up for joining the Azure Data Lake Analytics Preview, and give us your feedback!

In a future blog post I will dive deeper into user-defined operators. Please let me know in the comments or via the feedback link above, what other U-SQL topics you want to learn about, such as file sets, the metadata objects, federated queries etc.

Also, head over to our Azure Data Lake documentation center to read more and watch our Channel 9 video series on the Azure Data Lake.

 

clip_image007

Michael Rys (@MikeDoesBigData), Principal Program Manager, Microsoft Big Data

Michael has been doing data processing and query languages since the 1980s. Among other things he has been representing Microsoft on the XQuery and SQL design committees and has taken SQL Server beyond relational with XML, Geospatial and Semantic Search. Currently he is working on Big Data query languages such as SCOPE and U-SQL when he is not enjoying time with his family under water or at autocross.

Visual Studio Update 1 RC

$
0
0

Today we released Visual Studio 2015 Update 1 RC, which builds on the Update 1 CTP we released three weeks ago. In addition to the features introduced in the CTP as described here, the Release Candidate includes the following:

  • Go To Implementation. The feature many of you have been waiting for: just right-click on an interface or abstract method and select this command to navigate to the implementation.

clip_image002

  • New Quick Action. Ctrl + . now converts get methods to properties.
  • Windows Presentation Foundation. We’ve improved performance and added DirectX extensions (via NuGet), spell checking improvements, and additional support for per-user custom dictionaries. You can find more details on the blog post, WPF in .NET 4.6.1.
  • CPU Profiling while Debugging. This capability enables a per-function breakdown of CPU usage between breakpoints and in steps while using the debugger. For details, see the post Profiling your CPU in the Debugger.
  • C/C++ Debugging Improvements. The debugger now tells you which variable caused an access violation during C/C++ debugging. Read the blog post Improvement to Debugging C++ Access Violations in VS2015 Update 1 for more details.
  • Tools for Universal Windows Apps v1.2. We have made updates for.NET Native, the XAML designer, the manifest designer, Windows Store packaging, and the debugger. You can use these tools today to build apps and submit them to the Windows Store.
  • Visual Studio Tools for Apache Cordova. We added support for Cordova 5.3.1 and iOS 9. We've also laid the groundwork for Android 6 “Marshmallow,” and added a new plugin for Azure Active Directory authentication.
  • TypeScript. The latest updates include enhancements to the type system, native support for React’s JSX, completion of ECMAScript 6 support with generators and class expressions, and support for ECMAScript 7 proposals like the exponentiation operator and async functions.
  • Node.js Tools for Visual Studio. We added support for Node.js 4.x, support for npm 3.x, faster and clutter-free IntelliSense, faster project load times, improved stability during debugging, and code snippet support. (These tools are available a separate download: see Node.js Tools for Visual Studio.)

clip_image004

  • Improved feedback options. In addition to a simpler feedback icon in the IDE that looks good in the dark theme, we’ve redesigned the menu options to clearly separate reporting a problem and sending feedback:

    Feedback menu in Visual Studio 2015 Update 1 
    For suggestions, we take you directly to UserVoice; when reporting a problem, we have a new form that specifically asks for the information we need to investigate the issue and contact you for more information if necessary:

    clip_image008

 

For a complete list of features in Update 1 RC and information on bug fixes and known issues, see the Visual Studio 2015 Update 1 RC Release Notes.

Important note: the Visual Studio Emulator for Emulator and Microsoft Test Manager will not be able to acquire online licenses when used with Visual Studio Update 1 RC installed. Therefore, we recommended that you avoid installing Update 1 RC on a computer where either of those products is needed.

Also, only the .ISO files for Visual Studio Update 1 RC are available at this time, and these may take a while to download. The web installers will be available within the next several days.

 

As always, we welcome your feedback. Share your feedback, suggestions, thoughts, and ideas on UserVoice , through the in-product feedback UI, or file a bug through the Visual Studio Connect site.

 

John Montgomery

John Montgomery is the Director of Program Management for Visual Studio, responsible for product design and customer success for all of Visual Studio, C++, C#, VB, JavaScript, and .NET. John has been at Microsoft for 17 years, working in developer technologies the whole time. Reach him on Twitter @JohnMont

Apache Cordova Face-to-Face Meeting, Fall 2015

$
0
0

Microsoft hosted an in-person meeting in mid-October for Apache Cordova committers and developers. The goal was to two-fold: (1) advance conversations around Apache Cordova's future road map and (2) review the project health and, where necessary, create an action plan to address any quality issues identified by developers. The themes of the meeting included our commitment to making Apache Cordova and its plugins a stable platform.

This meeting was similar to the hour-long virtual conversations that Cordova committers usually have every month, but with more time dedicated to cover all the topics. In attendance were more than 25 people including folks from Intel, Adobe, IBM, Salesforce, Monaca and Meteor. The agenda for the meeting is on cordova-discuss and the meeting minutes are also available.

clip_image002

Stability and Consistency

Developers have voiced concerns about the numerous quirks in plugins for each platform, and the group agreed to ensure that plugins perform consistently on all platforms. For example, a Cordova plugin like the camera has a long list of quirks that result in different behaviors for some of the options used when calling the API. Another example would be the file plugin where the location of saving a file depends on the platform it is used on.

We are also looking at establishing a process to triage any issues that users report on the Cordova JIRA to ensure that high priority bugs are fixed quickly.

Documentation

The group also agreed on lowering the entry barrier for using the technology by adding more documentation and organizing the existing documentation better. In addition to continuing localization of content on http://docs.cordova.io, we also have proposals for better content based on the data we have from analytics on our documentation web site. Some of the proposals include new content, organizing plugin documentation, and adding blogs about any breaking changes we add to the project.

Extensibility

Many tool-builders who build upon Cordova in their products and offering (what we call “downstream distributions”) were also present at the meeting including IBM, Intel, and Meteor. There was general agreement that Cordova should be made much more extensible so that tool developers could leverage its features even more easily. The new proposals include ways to add third party package manager and a unified logging solution that can be used by downstream distributions.

We also discussed Cordova’s usage and collaboration with new and upcoming native-hybrid technologies including ReactNative. The group has discussed areas like sharing plugins and the ability to augment existing Webviews in Cordova apps with native controls. To this end, we have been experimenting with a plugin adapter that lets developers use Cordova plugins with ReactNative plugins.

Tools for Apache Cordova (TACO)

Several committers representing larger organization shared demos of their tools leveraging Cordova. The demo of TACO was very well received and features like dev kits seemed to be an idea that we could consider adding to Cordova core. The group also acknowledged that installing the developer tools for the first time could be cumbersome, and the TACO dependency installer is a great way to get started with Cordova.

Conclusion


Overall, the project's health is very good and the committers have done an amazing job in running the project and ensuring that developers using the platform can take advantage of the latest and greatest features of each platform. The project has also been following Apache's guidelines for new releases, features and processes for running the project. The project has been steadily growing with new committers bringing new skills to the table.

Many of the news idea and features are now starting to take shape of new proposals on the cordova-discuss repository and this is a great time to contribute to the project. You can use the mailing list to join the conversations, or leave your comments on specific issues or proposals on cordova-discuss.

 

clip_image004

Parashuram N, @nparashuram

Parashuram is a Senior Program Manager in Visual Studio team and works on creating tools that help with cross-platform mobile development. He is also a committer and a member of the Project Management Committee of  the Apache Cordova Project.

Developer update for Microsoft Band

$
0
0

It’s been a year since we launched Microsoft Band and Microsoft Health. We’ve made a commitment to the developer community to make our ecosystem open and accessible on every platform. Since then, we delivered three developer tools around our devices and services: Microsoft Band SDK, Microsoft Band Web Tiles, and Microsoft Health Cloud APIs. And as our devices and services evolve, we’re making continuous improvements to these tools.

With the recent announcement of the new Microsoft Band 2, we released updates to the Band SDK to add support for the new device. We’ve also released the official bits of Microsoft Band Web Tiles. Its preview bits went out in June this year. The new updated bits are available for download on our developer portal.

Microsoft Band 2

Updated Band SDK for Microsoft Band 2

In addition to enabling the existing SDK functionalities in Microsoft Band 2, we’ve enhanced the existing Microsoft Band SDK to take advantage of new sensors and specs of the new device. Here are the top enhancements:

  • Five new sensor-based subscriptions for Microsoft Band 2. In addition to nine sensor-based subscriptions exposed for both Microsoft Band and Microsoft Band 2, the updated SDK exposes five additional subscriptions that are only available for Microsoft Band 2: galvanic skin response (electrical conductivity of the skin in kohms), barometer, altimeter, RR interval (time between heart beat peaks), and ambient light.
  • Creation of PDF 417 barcodes with alpha/numeric data on Microsoft Band 2. The previous SDKsupported only 0-9 digits. The updated SDK extends support for more ASCII characters. For details, see the Microsoft Band SDK documentation.
  • Increased the icon limits for tiles on Microsoft Band 2. The updated SDK increases the icon limit for tiles from 8 to 13 for only Microsoft Band 2.

Download the latest update for the Microsoft Band SDK to start using these new features.

Microsoft Band Web Tiles

We launched a preview of the Microsoft Band Web Tiles in June this year. Now we’re excited to share the official release of Microsoft Band Web Tiles with more stable bits and new enhancements. Microsoft Band Web Tiles make it simple to deliver relevant information to the Band from virtually any data source accessible through the web. Developers have to write web tile code only once to support multiple mobile platforms (iOS, Android, and Windows) because the Microsoft Health app takes responsibility for doing the rest—installing the web tile to the Band, accessing web resources for content, extracting and formatting the content, and then delivering that content to the associated web tile on the Band.

In addition to stabilizing the preview bits that were released in June of this year, we added new web tile functionalities based on the feedback we’ve received. Here are the top things that we added to this release:

  • Creates simple conditions that trigger sending notification to web tiles. You can now make web tiles more informative for your users by sending notifications to the band whenever the web data meets predefined conditions. Want a weather web tile that notifies you when there’s a high chance of rain? You can create one now.
  • Extracts data from a web service that requires basic HTTP authentication. Until now, web tiles supported only publicly available web content. With the new update, web tiles can now support authenticated resources, opening up the opportunity to make the web content more secure and personalized.

Web tiles have no dependency on Band device version: the same web tile code works on both Microsoft Band and Microsoft Band 2.

For more information, visit the Microsoft Band Web Tiles developer website to read the updated developer documentation and download the sample web tiles. You can start creating new web tiles today using the Web Tile Authoring tool.

Feedback

We are making continuous improvements to our developer tools based on feedback. So please share your suggestions on the Microsoft Band Health UserVoice page. You can also vote on existing suggestions for improvements to any of our tools. You can also contact us through healthms (at) microsoft.com.

 

Maria Kang

Maria Kang, Program Manager, Microsoft Band and Microsoft Health

Maria Kang is on the Personal Devices team in Redmond, the creators of Microsoft Band and Microsoft Health. Since joining Microsoft in 2010, Maria has worked as a program manager in developer experience team on a number of Windows releases from Windows 8 through Windows 10. Most recently, she joined the Microsoft Band team to continue enhancing the developer ecosystem for Microsoft Band and Microsoft Health. She has a BS in Electrical Engineering.

Talk with our Apache Cordova Tooling team, live!

$
0
0

In the Visual Studio Tools for Apache Cordova team, we’re always looking for ways to connect with developers using our tools to create mobile apps. Starting next week, we’re taking a cue from the ASP.NET team and trying a new format – live, weekly, community question and answer sessions via our http://taco.visualstudio.com/live site.

We’ll be taking questions from attendees as well as responding to issues posted to Stack Overflow. To learn about our schedule and how to attend, visit the Cordova Tools Live Q&A website. We’re going to host these events for the next two months; based on feedback and attendance, we’ll decide if we continue it beyond that time.

As always, you don’t have to wait until the event to ask us questions – you can reach us directly on Twitter (@VSCordovaTools), email us (vscordovatools –at- microsoft.com), or report issues on StackOverflow (using the visual-studio-cordova tag).

We look forward to seeing you at one of our upcoming live streaming events!


clip_image002

Jordan Matthiesen (@JMatthiesen)
Program Manager, Visual Studio Tools for Apache Cordova

Jordan works at Microsoft on JavaScript tooling for web and mobile application developers. He’s been a developer for over 17 years, and currently focuses on talking to as many awesome mobile developers as possible. When not working on dev tools, you’ll find him enjoying quality time with his wife, 4 kids, 2 dogs, 1 cat, and a cup of coffee.

SAP Fiori Mobile Apps and Tools for Apache Cordova

$
0
0

Cordova makes it easy to build an app for iOS, Android, and Windows using web technologies. Although Blank project templates in Visual Studio Tools for Apache Cordova provide all the raw materials to build your basic “Hello World”, you have also told us that you would like to see richer starting points. We have covered starting points for frameworks like Ionic and Monaca in the past, but today we are going to take a look at how a major business platform company is working towards this goal with Cordova and Visual Studio: SAP.

SAP, SAP Fiori, and the SAP Mobile SDK

As the market leader in enterprise application software, SAP is at the center of today’s business and technology revolution. SAP's innovations enable more than 291,000 customers worldwide to work together more efficiently and use business insight more effectively. SAP is building their next-generation platform and business systems that include a strong focus on mobile based workflows as well as a distinctive set of design guidelines called SAP Fiori. In addition to end-user mobile apps for their business systems, SAP also offers an underlying platform and server infrastructure that enables developers like you to build custom apps that take full advantage of enterprise business data.

With over 500+ role-based apps, SAP solutions such as SAP S/4HANA, SAP Simple Finance, and the SAP Business Suite are applying SAP Fiori responsive design patterns to provide a personalized, responsive and simple user experience from either web or hybrid apps.

SAP Fiori Designs

The SAP Mobile Platform (SMP) and in particular the Mobile Platform Server and SDK enhances apps built using SAP5UI and Fiori Mobile UX by providing additional mobile device capabilities not available to traditional web apps. SAP provides multiple development options for mobilizing Fiori - SAP Web IDE, Cloud build or Custom Fiori client. Under the covers, these Fiori clients are built using a standard Apache Cordova Command Line Interface (CLI) project and a series of SAP built value-add Cordova plugins.

As a part of the collaboration between SAP and Microsoft, SAP plans to introduce some features to streamline development of SAP-powered mobile apps in Visual Studio. This blog post will cover the option of bringing Fiori apps to mobile devices through the creation of custom Fiori clients using Tools for Apache Cordova. Note thattoday Microsoft and SAP also announced that Microsoft Intune’s App SDK can be integrated with Fiori clients to add greater app level security controls when using Microsoft’s Enterprise Mobility Suite and will even be available in SAP’s cloud build service. You can expect even more in the future, so be sure to check out this video for more information!

SAP created the SAP Fiori Client to provide Fiori applications:

  • Additional native capabilities (such as Camera, Barcode Scanner, etc.) on top of what a typical browser provides
  • Management of the local web cache better when new versions of the application are released by the Fiori server
  • Additional security to protect the application from unauthorized access
  • Provisioning the user certificate through Mobile Secure and SAP Mobile Platform

With SMP, developers and IT staff can focus on delivering Fiori solutions to the business rather than building infrastructure. Enterprise requirements addressed by SMP include:

  • Enterprise authentication (single- or multi-factor), single sign on, network edge security, SSL, reverse proxy, remote access
  • Secure data at rest and data in motion, encryption
  • User/device registration, onboarding, managed rollout
  • Application lifecycle management
  • Offline Data, Mobile Database Integration and data composition for SAP and 3rd party back-end systems and databases
  • Central administration, Tracing and logging for end-user supportability
  • Horizontal scalability, high availability, usage statistics

Custom Fiori clients allow you to extend these base features and brand your Fiori client, add additional device capabilities by with Cordova plugins, remove plugins you do not intend to use to reduce your app’s size, and even add additional code packaged with the client app to meet your own specific needs (such as customizing your offline experience).

Tools for Apache Cordova

All editions of Visual Studio 2015 now come bundled with Tools for Apache Cordova which is designed to make it easy for you to build cross platform apps targeting Android, iOS, Windows, and Windows Phone using Cordova from one convenient IDE. Tools for Apache Cordova is “command line interoperable” which means that you can easily take a standard Cordova CLI project (like a Fiori client project) and further customize it to meet your needs. Once in Visual Studio you can take advantage of all of Visual Studio’s great cross-platform features like IntelliSense, integrated debugging for Android and iOS, and the high-speed Visual Studio Android Emulator.

Even better, you are able to use Team Foundation Server 2015 or Visual Studio Online for collaboration and continuous integration even when building an iOS version of your app or use Visual Studio Code to edit your project on a Mac. You can even take advantage of the cross-platform “TACO CLI” (Tools for Apache Cordova Command Line Interface) to simplify Cordova apps development using your favorite text editor.

Cordova Tools

Using Visual Studio on Windows to Build an App

The SAP Mobile SDK enables developers to build apps using Cordova through the integrated Kapsel SDK. The Kapsel SDK contains a set of Cordova plugins that you can add to your own Cordova project. In addition, the SDK provides a script to generate a Custom Fiori Client project ready for use.

To get started building your own Fiori client, follow these steps:

1. Download the latest SAP Mobile SDK (or a free trial from the SAP Store) and install it on your machine. (Ex: C:\SAP)

2. Follow the instructions in oursamples GitHub repo to generate a Custom Fiori Mobile Client project or to simply add a SAP Kapsel SDK plugin to your own Cordova app.

3. Install Visual Studio 2015, select the Tools for Apache Cordova option, and simply open the Cordova project you created in Visual Studio using the File > New > Project From Existing Code… menu item.

New project from editing code

You can currently build custom SAP Fiori clients for Android and iOS with Windows support expected in the future. Pick either Android or iOS, a device or emulator / simulator debug target, and click the debug button to see the app in action!

Selecting an Android emulator or device

 

App running in an emulator

Using Visual Studio Code on a Mac or Windows to Build an App

If you would prefer to use Visual Studio Code or your favorite text editor on Windows or a Mac:

  1. Follow the same instructions above to create your Cordova project
  2. Install the TACO CLI and use it to help you install any pre-requisites
  3. Simply open the folder containing your project in VS Code, start editing, and use the “taco” command to build and run as appropriate!

Using Apache Cordova in Visual Studio Code

Summary and the Future

SAP’s Mobile SDK combined with Tools for Apache Cordova can help you build quality, secure, and great looking SAP Fiori mobile apps faster than ever before. As a part of the collaboration between SAP and Microsoft, SAP’s roadmap includes Visual Studio support for building, debugging, and deploying fully “packaged” versions of Fiori apps along with integration with a cloud build service and Microsoft has some new and exciting capabilities already in the works.

You can expect much more from SAP and Microsoft in ensuring that you are able to build and deploy the high quality, secure apps for your enterprise needs in the future.

If you have not already, check out this video for more information!

You can find more information about SAP Fiori and how the SAP Mobile SDK can help you mobilize your business apps at SAP’s developer help portal.

You can find more information about Tools for Apache Cordova from the portal site. Microsoft is always interested in your feedback, so please contact the product team via UserVoice, Send-a-smile, Twitter, StackOverflow, or email.

 

Chuck Lantz

Chuck Lantz, Senior Program Manager, Visual Studio Client Tools Team

@chuxel

Chuck spent over 15 years as developer, advocate, and architect in a variety of mid and large scale enterprise IT shops. He brought his passion for app development to Microsoft in 2012 and is currently focused on mobile app development.

Kiran Karunakaran

Kiran Karunakaran, Director, Product Management at SAP

kiran.karunakaran (at) sap.com

Kiran is responsible for the product management, strategy and roadmaps for the SAP Mobile SDK and Fiori client. He has over 19 years of experience in architecture and development across multiple domains. He has been with the mobile platform team at SAP for the last four years.

Sanjeet Mall

Sanjeet Mall, Vice President, Engineering at SAP

sanjeet.mall (at) sap.com

Sanjeet is the Chief Architect for the SAP Mobile Platform team. He has been with SAP for more than 15 years and has worked on some of the key SAP products like SAP CRM, SAP Mobile Platform. He also runs the engineering organization responsible for Mobile SDK and Fiori client.


Announcing the Intune App SDK

$
0
0

One of the challenges enterprises face in a cloud-first, mobile-first world is protecting sensitive data in the face of an increasing number of business critical mobile apps running on employee owned devices. To help tackle these challenges, Microsoft’s Enterprise Mobility Suite (EMS) is designed to help organizations manage mobile devices and applications. This is achieved by helping organizations maintain a single identity across a number of apps and keep sensitive company and personal data protected not only on Windows but Android and iOS as well.

As a core part of EMS, the recent Microsoft Intune release includes improvements to their Mobile Application Management capabilities that will extend its policy management features to any custom or ISV app built using native technologies through the integration of the Intune App SDK. In addition, the team is pleased to announce that it is accepting applications for participating in a preliminary Intune App SDK beta for select customers targeting Cordova, and Xamarin based apps. Once available, you’ll be able to quickly add the SDK to your app from Visual Studio 2015 including cross-platform apps built with Tools for Apache Cordova or Xamarin.

The end result is that nearly any app will be able to take advantage of Intune’s comprehensive security features and centralized management functions. Administrators can require corporate credentials to be used to access the app, encrypt data on the device, restrict cut-copy-paste access, and more, right from the Intune console.

InTune Console

These capabilities complement Intune’s existing Mobile Device Management capabilities and an internal app store for Android, iOS, and Windows designed to provide piece of mind while still ensuring that deploying apps to employee or corporate owned devices is as simple as possible.

Mobile device management capabilities

The App SDK is already in use by a number of partners including SAP as profiled yesterday in this blog post and video.

Beginning today the Intune team is accepting requests for access to preview of the Intune App SDK for Cordova plugin in an upcoming preliminary beta for select customers. We are looking for companies interested in developing secure apps using Intune along with Cordova or Xamarin and are willing to try out early bits.

If you are interested, contact us today and, if accepted, You'll get the opportunity to participate in Insider Groups such as Intune app SDK for Cordova or Xamarin based on your interests. We’ll contact you via email using the information you provide and send you the Intune App SDK when it is ready to try with your technology of choice. Microsoft collects, handles, and uses that information in accordance with our privacy statement.

DownloadVisual Studio 2015 and sign up now!

 

Chuck Lantz

Chuck Lantz, Program Manager, Visual Studio Client Tools Team
@chuxel

Chuck spent over 15 years as developer, advocate, and architect in a variety of mid and large scale enterprise IT shops. He brought his passion for app development to Microsoft in 2012 and is currently focused on cross-platform mobile app development.

Sam Tulimat

Sam Tulimat, Program Manager, Microsoft Intune team
@samtulim

Sam works on the Microsoft Intune team at Microsoft's Boston office. He developed a love for technology when he started an internet Café in his home country of Syria. Later on he decided to bring his love for Entrepreneurship and tech to Microsoft by focusing on the fast evolving technology for app management and data protection in the enterprise.

Node.js Tools 1.1 for Visual Studio Released

$
0
0

Since our first stable release of Node.js Tools 1.0 for Visual Studio (NTVS) earlier this year, we have seen a lot of interest in this free extension. We are both humbled and excited by the response and community engagement on GitHub.

We’ve been hard at work developing interim releases with the support of our vibrant community. And today, we are pleased to announce that our next stable release of Node.js Tools 1.1 for Visual Studio is available for download. NTVS 1.1 supports Visual Studio 2012, 2013, 2015 (including the free Visual Studio Community Edition and Express for Web). To learn more about NTVS v1.1, visit Node.js Tools for Visual Studio on visualstudio.com.

We strive to make NTVS the best Node.js development experience out there by bringing the power of Visual Studio to allow developers to build enterprise-grade Node.js applications like a boss. Node.js Tools supports you at every stage of your application—from powerful code completions, to advanced debugging and profiling, to unit testing, cloud deployment, and much much more.

What’s new in v1.1?

Apart from support for Node.js v4.x and numerous bug fixes all across the product, we’ve focused on increasing developer productivity with the following improvements.

Faster and clutter-free IntelliSense

Apart from improving the overall code analysis performance, we have added a Quick IntelliSense mode and an easier way to classify browser and Node.js code for a clutter free IntelliSense experience to make it easier for full-stack developers to switch contexts between backend and frontend development.

Selecting ES6 IntelliSense

 Set as Content menu

This release includes an ES6 IntelliSense Preview powered by TypeScript.

More reliable debugging

Advanced debugging is the cornerstone of NTVS and we are committed to making it best-in-class. With this release we have made it even better by fixing several stability issues developers have reported in our earlier releases. So if breakpoints weren't working properly sometimes, or your app was having trouble running under the debugger, or things were generally inconsistent then hopefully this'll help. J

Node.js debugging in Visual Studio

Still running into problems? Please, please, pleasefile an issue on GitHub so we can work together to resolve it!

npm v3 support

Look familiar?

MAX_PATH issues with npm

<cue Professor Farnsworth> “Good news, everyone!”

npm v3 is officially out of beta , and one of the features we're most excited about is that dependencies are installed maximally flat, so you're less likely to run into MAX_PATH issues.

NTVS v1.1 brings full support for this latest version of npm in both solution explorer and the JavaScript analysis engine. Ready to give npm v3 a spin? Either follow the manual upgrade steps, or take advantage of the npm-windows-upgrade package from our friends at Microsoft DX.

Improved Performance

Slow project load times are a drag, but not anymore. We have significantly improved our performance during project load when the dependency tree is large. In some cases, we have seen over 80% gain in load times of large projects.

Code Snippets

Writing the same few lines of code over and over again gets annoying real fast. Support for Code Snippets is finally here to ease that pain. Simply press Ctrl+K+X to browse and select a snippet to insert, or type in the snippet name and press tab to complete it.

Node.js code snippets in Visual Studio

Write a great code snippet that you'd like to share? Let us know - we may be able to include it in the next update of NTVS.

And much more!

We’ve made improvements all across the product, including better code-completion defaults, improved formatting, unit testing, and support for the NTVS IoT extension, which enables developers to deploy Node.js as a Universal Windows Platform (UWP) application to Windows IoT Core devices like Raspberry Pi 2. Check out our release notes for the interim releases for a more comprehensive list of improvements.

Help make NTVS better

NTVS is a free and open source project, and this release simply would not have been possible without your support, so thank you, thank you, thank you to everyone who’s already active on our GitHub repo J.

We’re always willing to take high quality contributions. If you’d like to contribute, please check out our issue tracker for outstanding bugs and features which can be implemented. You can also help make NTVS better by reporting issues or helping out your fellow users on GitHub.

Get started with Node.js Tools 1.1 for Visual Studio

Download Node.js Tools 1.1 for Visual Studio to get started developing Node.js applications in Visual Studio. And as always… comments, compliments, or complaints? File an issue, join us on Gitter, or shoot us a tweet. We’d love to hear your feedback, especially if it comes in the form of a pull request.

Onwards!

image

Sara Itani (@mousetraps)

Sara is a Software Engineer on the Node.js Tools for Visual Studio. At first, she was skeptical about Node.js – that is, until she realized its full potential…. Now, she’s all in, and excited to help it take over the world by bringing the power of Visual Studio to the Node.js community. She, for one, welcomes our new JavaScript overlords. :-)

 

image

Arunesh Chandra (@aruneshc)

Arunesh is a Senior Program Manager at Microsoft working on Chakra, the JavaScript engine that powers Microsoft Edge, and Node Tools for Visual Studio. He is currently working on supporting Chakra’s integration with Node.js and helping ship new versions of Node.js Tools for Visual Studio.

News and Announcements at Connect(); //2015

$
0
0

Today we held the Connect(); //2015 event in New York, where we introduced many new products and features that we’ve been working on. In this post I’ll share the highlights with you, and you can watch the Connect(); event along with many additional on-demand videos on http://www.visualstudio.com/connect2015.

Visual Studio Code beta release. In this beta of Visual Studio Code we have done the following:

To find out more about the VS Code announcements visit the VS Code blog.

Visual Studio Code Beta


.NET Core 5 RC and ASP.NET 5 RC with Go-Live license.
The release candidates of both .NET Core 5 and ASP.NET 5 are now available for Linux, Windows, and OS X with a Go-Live license, so that you can start using it in production environments even though it’s still not at full release yet. ASP.NET 5 RC includes enhancements to both the runtime and tools with a simplified hosting model across Windows, OS X and Linux. You can read more about .NET Core on the .NET team blog, and more on ASP.NET 5 on the ASP.NET team blog and Scott Hanselman’s blog.


Visual Studio Online is now Visual Studio Team Services and extends its features.
We’ve changed the name of Visual Studio Online to Visual Studio Team Services to help make it clear in the name that these cloud development services have become a central part of agile team collaboration and DevOps services. New features in Team Services include a plugin for IntelliJ IDEA, a new customizable and task-based Build service, dashboards that provide visibility into a team’s progress, and preview extensions for Code Search, Package Management, and Release Management. The team has a number of posts on the Visual Studio ALM blog where you can explore all these improvements in depth.


Visual Studio Dev Essentials
is a new, free program that brings together everything developers need to create applications on any device or operating system including Visual Studio Community and Visual Studio Code, and the free tier of Visual Studio Team Services. Dev Essentials adds priority forum support, training services from Pluralsight, Wintellect, and Xamarin, and—something that many have asked for—monthly credits to use in Azure, which will be coming in early 2016. You can find all the details on https://www.visualstudio.com/products/free-developer-offers-vs.


Visual Studio cloud subscriptions.
Weare adding Visual Studio Professional and Enterprise monthly and annual subscriptions to our existing MSDN subscription lineup. Monthly subscriptions include the Visual Studio Professional or Enterprise IDE, access to Visual Studio Team Services with the optional Test Manager extension (for VS Enterprise subscriptions), and Team Foundation Server client access license. Annual subscriptions add benefits equivalent to those currently offered through MSDN subscriptions, including technical support incidents, Azure credits, Pluralsight training, access to dev/test software, a Windows developer account, Office ProPlus, an Office 365 developer subscription, Power BI Pro, and partner offers, depending on the subscription level. You can find all the details on https://www.visualstudio.com/products/subscriber-benefits-vs.

We’ll offer these subscriptions through the new Visual Studio Marketplace, giving you the convenience of a single bill for both subscription purchases and other Microsoft Azure cloud services like virtual machines and storage.


Visual Studio Marketplace.
We’ve had the Visual Studio Gallery for VS extensions for a long time. Today we’re announcing the Visual Studio Marketplace, a central place for developers to find, acquire, and install extensions for all editions of Visual Studio (Enterprise, Professional, and Community), for Visual Studio Team Services (formerly Visual Studio Online), and for Visual Studio Code.

The new Visual Studio cloud subscriptions, as well as the Test Manager extension for Visual Studio Team Services, are now available for purchase in the Marketplace. And at a future date, partners will be able to sell extensions in the Visual Studio Marketplace. Explorehttp://marketplace.visualstudio.com for more.


Visual Studio 2015 Update 1 and Team Foundation Server 2015 Update 1.
We’re closing in on the release of Visual Studio 2015 Update 1 and Team Foundation Server Update 1, which will both happen on November 30th.

I’ve previously shared details on this blog about the many features that we put out in the CTP and RC releases; in the full update you can look forward to even more like MS Test and Code Coverage support for ASP.NET 5, parallel test execution, improved code analysis, and an improved NuGet Package Manager experience, along with updated tools for the Universal Windows Platform. Watch this blog for the announcement on November 30th.

With Team Foundation Server, new features include dashboards that provide visibility to a team’s progress of work, code, tests and builds, Git and Team Foundation Version Control in the same team project, the ability to query Kanban columns and SonarQube Analysis build tasks work with on-premises and hosted agents. Brian Harry will let you know all about TFS 2015 Update 1 on his blog also on November 30th.


Xamarin 4 support
. We’re excited to announce that Visual Studio 2015 Update 1 will include Xamarin 4 support, providing an end-to-end solution to build, test, and monitor native mobile apps at scale with Visual Studio. Xamarin 4 includes updates to Xamarin Platform, notably rebuilt support for developing iOS apps in VS, making it more convenient to build, debug, and deploy Xamarin.iOS projects from Visual Studio. Xamarin now uses a SSH-based connection to simplify the Visual Studio-to-Mac network connection and provide a faster, more reliable connection over a well-known port. Configuring a Mac for Xamarin and Visual Studio only requires enabling Remote Login, and allows multiple Visual Studio instances to connect simultaneously, making it easier to work in multiple iOS projects at the same time. Xamarin 4 is a big release, with the Xamarin team investing hundreds of hours to improving the performance and stability of mobile development in C#. Visit the Xamarin blog to learn more and get started.


iOS Build with MacinCloud on Visual Studio Team Services.
We've partnered with MacinCloud to introduce a VS Team Services / VSO build agent plan. For organizations that prefer to not manage Macs in their datacenters or for smaller organizations that would prefer to not maintain dedicated Mac hardware for continuous integration, they can now use Team Services with MacinCloud to do their iOS builds. The plan is currently in preview at $30/month per agent with no limits on build hours. You’ll still need to sign up for the Apple Developer Program to obtain signing certificates and the necessary provisioning profiles to build and release your app, but a MacinCloud agent can be used with the free tier of Visual Studio Team Services through its one complementary "private" agent slot.

iOS build with MacinCloud

For details, visit the full ALM blog post, MacinCloud’s plan, the Xcode Build tutorial, the Cordova build tutorials, and this blog post on React Native.

Additional Announcements

  • Take an early peek at the nextmajor version of Visual Studio by watching the videos on http://www.visualstudio.com/connect2015. Features include a dramatically improved setup experience, lightweight installation options for any language, and innovation themes for the next version of C#.
  • Visual Studio Emulator for Android is coming to Mac OS X, enabling Android developers working either in OS X or Windows to use Microsoft’s fast, powerful and free Android emulator. You can sign up to be notified when the emulator is available on Mac OS X here. Plus, we’ve added new features in the Windows version of the emulator, including support for Marshmallow (API Level 23).
  • The HockeyApp extensionis available in the Visual Studio Marketplace, which enables developers to extend their existing DevOps workflow to their mobile apps. A free tier lets a single developer manage two apps with all the capabilities of HockeyApp.
  • Public Preview of Visual Studio GDB Debugger Extension, enabling Linux native remote debugging support in Visual Studio for Linux servers or IoT devices among others.
  • Node.js Tools for Visual Studio 1.1 RTM delivers higher developer productivity and Node.js v4.x support in Visual Studio.
  • Azure Service Fabric and Azure DevTest Labs in Public Preview.Azure Service Fabric helps developers build and operate microservice-based applications at scale with full integration with Microsoft Azure and Visual Studio. Azure DevTest Labs helps developers and testers quickly create environments in Azure while helping IT professionals minimize waste and control costs.
  • Azure SDK 2.8 for .NET includes updates to the Mobile Apps templates, big data tools for HDInsight customers, and updates to Docker and Data Factory tools. We’ve also announced new Azure Service Fabric tools for Visual Studio 2015 along with a standalone version a new client that runs on both the Windows and Mac desktops known as Storage Explorer.
  • Microsoft Graph (GA and Preview), described in detail on the Office Blog and Office Dev Blog and found on https://graph.microsoft.com, offers developers a consistent way to access data, intelligence and APIs within the Microsoft cloud, and with a single authorization token. Any developer capable of making an HTTP request can call the API from any platform, and once-siloed Office 365 services can now be directly navigated via the Microsoft Graph.
  • Additional updates for mobile development include CodePush Open Beta and the Intune App SDK, in addition to the partnership with MacinCloud (discussed earlier) that enables Visual Studio Team Services to build for iOS and other platforms in the cloud.
  • Docker tools for Visual Studio RC, enabling developers to work with Docker containers from Visual Studio target both Linux and Windows.
  • Azure diagnostics, now offered as part of Visual Studio Application Insights, provide system and infrastructure data in one place.

Again, you can enjoy the videos from the live announcements as well as more than 70 on-demand videos with additional details on https://channel9.msdn.com/Events/Visual-Studio/Connect-event-2015. And of course we’re already underway with future updates and releases. Let us know what you’d like to see by sharing your feedback, suggestions, thoughts, and ideas on UserVoice , through the in-product feedback UI, or file a bug through the Visual Studio Connect site.

 

John Montgomery

John Montgomery is the Director of Program Management for Visual Studio, responsible for product design and customer success for all of Visual Studio, C++, C#, F#, VB, TypeScript, JavaScript, and .NET. John has been at Microsoft for 17 years, working in developer technologies the whole time. Reach him on Twitter @JohnMont

Latest Microsoft Office Developer Tools for Visual Studio 2015

$
0
0

We’re pleased to announce that Update 1 for the Microsoft Office Developer Tools for Visual Studio 2015 is ready for you to install! This update includes a vocabulary change in our tools, Apps for Office and SharePoint are now known as Office and SharePoint Add-ins, and bug fixes, such as the Office/SharePoint node not appearing under Visual C# in the New Project dialog.

Second, we have also released a preview of the next round of improvements to these tools. We invite you to shape their future by giving us your feedback through Send-A-Smile or Microsoft Connect. You can start by trying out the new project types that you’ll see in this Preview release, as I’ll highlight in this post.

Follow these steps to install the Preview:

  1. If you don’t already have Visual Studio 2015, you can install Visual Studio Community 2015 at aka.ms/VSCommunity2015.
  2. Go grab the latest version with aka.ms/GetLatestOfficeDevTools.
  3. Head to the Download Center and install the Preview.
  4. Make sure you have Outlook 2016 installed.

New: Add-in Commands

In our Preview, we’ve added a new project type called Outlook Add-in with Commands to show off the new features in Office Add-ins. Add-in commands let you add a button on the Outlook ribbon to launch the add-in, display a menu, or execute a custom JavaScript function, providing a seamless Office experience for your users.

Outlook add-in commands

You declare commands in the manifest with a node called VersionOverrides that is be ignored by older versions of Office, thus ensuring backwards compatibility with all your users.

Now let’s walk through a scenario to create an add-in that inserts custom text when writing emails. When reporting issues, customer support workers typically need to ask for more details and give instructions on how to find versions, serial numbers, etc. It would be very handy—and save a lot of time—to have a button in Outlook to insert this kind of common text. We’ll step through an example to create an add-in that inserts custom text when writing emails.

In Visual Studio 2015, create a new Outlook Add-in with Commands project through File > New Project and selecting Templates > Office/SharePoint > Outlook Add-in with Commands:

Outlook add-in with Commands project in Visual Studio 2015

To see what the buttons look like, select the OutlookAddIn node in Solution Explorer, change the Start Action to Office Desktop Client in the Properties window, so the add-in will launch in Outlook 2016, and then press F5:

image

As you can see, our add-in can be launched by selecting the Display all properties button that now appears on our ribbon when we’re reading messages (the MessageRead surface defined in our manifest). Now we’re going to add a menu button to the ribbon for when we’re writing messages (the MessageCompose surface).

Stop the debugger and click on the OutlookAddInManifest node in Solution Explorer to open the manifest XML file.

Underneath the </ExtensionPoint> end tag, add an ExtensionPoint for the MessageCompose surface that contains everything for adding a menu button:

...

 

<ExtensionPointxsi:type="MessageComposeCommandSurface">

  <OfficeTabid="TabDefault">

    <Groupid="msgComposeDemoGroup">

      <Labelresid="groupLabel" />

      <Controlxsi:type="Menu"id="msgComposeMenuButton">

        <Labelresid="menuComposeButtonLabel" />

        <Supertip>

          <Titleresid="menuComposeSuperTipTitle" />

          <Descriptionresid="menuComposeSuperTipDescription" />

        </Supertip>

        <Icon>

          <bt:Imagesize="16"resid="icon16" />

          <bt:Imagesize="32"resid="icon32" />

          <bt:Imagesize="80"resid="icon80" />

        </Icon>

        <Items>

          <Itemid="msgComposeMenuItem1">

            <Labelresid="menuItem1ComposeLabel" />

            <Supertip>

              <Titleresid="menuItem1ComposeLabel" />

              <Descriptionresid="menuItem1ComposeTip" />

            </Supertip>

            <Icon>

              <bt:Imagesize="16"resid="icon16" />

              <bt:Imagesize="32"resid="icon32" />

              <bt:Imagesize="80"resid="icon80" />

            </Icon>

            <Actionxsi:type="ExecuteFunction">

              <FunctionName>addMsg1ToBody</FunctionName>

            </Action>

          </Item>

          <Itemid="msgComposeMenuItem2">

            <Labelresid="menuItem2ComposeLabel" />

            <Supertip>

              <Titleresid="menuItem2ComposeLabel" />

              <Descriptionresid="menuItem2ComposeTip" />

            </Supertip>

            <Icon>

              <bt:Imagesize="16"resid="icon16" />

              <bt:Imagesize="32"resid="icon32" />

              <bt:Imagesize="80"resid="icon80" />

            </Icon>

            <Actionxsi:type="ExecuteFunction">

              <FunctionName>addMsg2ToBody</FunctionName>

            </Action>

          </Item>

        </Items>

      </Control>

    </Group>

  </OfficeTab>

</ExtensionPoint>

 

...

In the Resources section at the end of the manifest, replace the ShortStrings and LongStrings nodes with the code below.

...

<bt:ShortStrings>

  <bt:Stringid="groupLabel"DefaultValue="My Add-in Group"/>

  <bt:Stringid="paneReadButtonLabel"DefaultValue="Display all properties"/>

  <bt:Stringid="paneReadSuperTipTitle"DefaultValue="Get all properties"/>

  <bt:Stringid="menuComposeButtonLabel"DefaultValue="Insert message"/>

  <bt:Stringid="menuComposeSuperTipTitle"DefaultValue="Choose a message to insert"/>

  <bt:Stringid="menuItem1ComposeLabel"DefaultValue="Insert custom message #1"/>

  <bt:Stringid="menuItem2ComposeLabel"DefaultValue="Insert custom message #2"/>

</bt:ShortStrings>

<bt:LongStrings>

  <bt:Stringid="paneReadSuperTipDescription"DefaultValue="Opens a pane displaying all available properties. This is an example of a button that opens a task pane."/>

  <bt:Stringid="menuComposeButtonTooltip"DefaultValue="Inserts your choice of text into body of the message."/>

  <bt:Stringid="menuComposeSuperTipDescription"DefaultValue="Inserts your choice of text into body of the message. This is an example of a drop-down menu button."/>

  <bt:Stringid="menuItem1ComposeTip"DefaultValue="Inserts custom message #1 into the body of the email." />

  <bt:Stringid="menuItem2ComposeTip"DefaultValue="Inserts custom message #2 into the body of the email." />

</bt:LongStrings>

...

Finally, add some custom JavaScript functions for the menu buttons at the end of functions/functions.js:

...

 

// Adds text into the body of the item, then reports the results to the info bar.

function addTextToBody(text, icon, event) {

    Office.context.mailbox.item.body.setSelectedDataAsync(text,
        { coercionType: Office.CoercionType.Text },

        function (asyncResult) {

            if (asyncResult.status == Office.AsyncResultStatus.Succeeded) {

                statusUpdate(icon, "\"" + text + "\" inserted successfully.");

            } else {

                Office.context.mailbox.item.notificationMessages.addAsync("addTextError", {

                    type: "errorMessage",

                    message: "Failed to insert \"" + text + "\": "
                       
+ asyncResult.error.message

                });

            }

 

        event.completed();

        });

}

 

function addMsg1ToBody(event) {

    addTextToBody("Custom message #1", "icon16", event);

}

 

function addMsg2ToBody(event) {

    addTextToBody("Custom message #2", "icon16", event);

}

Now run the add-in to see the new menu. Because we added the menu to the MessageCompose surface, you’ll need to create a new message by clicking the New Email icon in the top left of Outlook 2016 to open the Create a Message window.

Add-in appearing with a new message 

That’s it! You’ve successfully added your command to the add-in. To discover more, check out the Overview of add-in commands for mail and Create a manifest for add-in commands for a deep dive into how to add commands to your Office Add-in.

SharePoint 2016 Beta 2

Also available in our Preview are the templates for developing SharePoint farm and sandboxed solutions for SharePoint 2016 Beta 2. You can find these in the File > New Project dialog under Templates > Office/SharePoint >SharePoint Solutions:

Visual Studio 2015 project for SharePoint Solutions

Note that with the preview installed in Visual Studio 2015, opening an existing SharePoint solution targeting SharePoint 2013 will automatically prompt you to upgrade the project to target SharePoint 2016.

We’re working on our SharePoint 2016 Add-in support so keep an eye out in our upcoming releases. To keep up to date about what’s new in SharePoint 2016, check out the Office Blogs.

Learn More

To start developing with the Office platform, use the new dev.office.com/getting-started pages and learn about the Office 365 APIs and Office Add-in Model.

You can also:

If you have any questions or concerns, please let us know by leaving a comment below, through Visual Studio’s Send a Smile feature or via Twitter @nicoleabruck!

Nicole Bruck

Nicole Bruck, Program Manager, Office and SharePoint Tools
@nicoleabruck

Nicole is new to Microsoft and has just started as a program manager working with our Office Development Tools. Starting at the company as a developer intern in IT, she transitioned into a PM role full-time working on the Napa Development Tool and has since taken over more of the Visual Studio tooling for Office and SharePoint.

Improving your build times with IncrediBuild and Visual Studio 2015

$
0
0

IncrediBuild is a software acceleration technology that allows builds, tests, and other development processes to execute in parallel over a distributed network. It works locally on your development box and over a build server, and can also make use of idle CPU cycles in other computers over the entire network. In addition, developers with Visual Studio can use IncrediBuild to scale to the cloud via Azure to add more computing resources, substantially increasing performance, speeding up build time, and improving overall developer productivity. IncrediBuild is used by many Visual Studio customers today and is seen as a leader in the software acceleration technology space. Learn more about IncrediBuild at https://www.incredibuild.com or through is short Connect video about IncrediBuild.

With Visual Studio 2015 (both the RTM and Update 1 releases), developers see a Build Accelerator template in the File > New project dialog, which will install IncrediBuild:

Installing Incredibuild through New Project dialog

By installing IncrediBuild in Visual Studio through the Build Accelerator template, you can leverage the following features free of cost (these were previously available only as a part of the paid IncrediBuild SKU):

  • Predicted (Out of Order) Execution: Allows IncrediBuild to build more parallelized build plans by breaking down artificial dependencies, resulting in faster build times. Predicted execution also allows intelligent resource management and scales system resources according to your build needs.
  • Build Visualization: The build visualization tool, integrated into Visual Studio, helps developers see their overall build process, better understand the resource utilization of the builds, and easily identify bottlenecks for troubleshooting and optimization.
  • Parallelize up-to 8 cores: Allows developers to now use the free version of IncrediBuild across 8 cores on their development machines, bringing overall goodness!

In our internal test labs, we’ve seen a 10-20% improvements in most end-to-end application build times. The figure below, for example, illustrates build times achieved with predictive execution building across 8 cores on a single development machine for the popular C++ source-base Adaptive Computation Environment (ACE) Libraries:
Incredibuild improvements for a C++ project
We are really excited about this partnership with IncrediBuild and what it means for you! Learn more at https://www.incredibuild.com/microsoft-incredibuild-partnership.html, and through two Channel9 videos: What is Incredibuild? and Incredibuild with Visual Studio 2015 Update 1.

What is Incredibuild? (video link)  Incredibuild with Visual Studio 2015 Update 1 (video link)

We’d also love to hear your experience as you try this out in your development environments. Reach out to me directly via aasthan (at) microsoft.com.

clip_image006

Ankit Asthana, Senior Program Manager, Visual Studio
@ankitasthana86

Ankit's focus area is cross-platform mobile development along with native code generation tools. Ankit is also knowledgeable in compilers (dynamic and static compilation, optimizer, code generation), distributed computing and server side development. He has in the past worked for IBM and Oracle Canada as a developer building Java 7 (hotspot) optimization and telecommunication products. He is author of C++ for Beginners to Masters and graduated from McMaster University with a degree in Electrical Engineering.

Visual Studio Update 1 RTM

$
0
0

Today we’re releasing Visual Studio 2015 Update 1. Let me be the first to thank everyone who installed these earlier releases, provided feedback, and helped us iron out the kinks. [The final release of Team Foundation Server Update 1 is also available today, which you can read about on Brian Harry's blog.]

I’ve already shared many of the features that we introduced in the CTP and the release candidate (RC), and you can find a complete list of features in Update 1 in the Visual Studio Update 1 RTM Release Notes. Let me now highlight the final additions made for RTM:

  • New Visual Studio Icon. Responding to your feedback on UserVoice, we’ve tweaked the Visual Studio 2015 icon in Update 1 to make it easier to differentiate visually between multiple versions of Visual Studio running side by side on the same machine:
    New icon for Visual Studio
  • .NET Framework 4.6.1. Visual Studio 2015 Update 1 includes the latest version (4.6.1) of the .NET Framework. You can read about all the new features on the .NET blog.
  • Editor support for new languages. The Visual Studio editor now provides built-in syntax highlighting and basic IntelliSense support for languages including Go, Java, Perl, R, Ruby, and Swift. We support the TextMate bundle
    model for language grammars and snippets, allowing you to extend this with support for other languages.

    Editor support for new languages (showing R)
  • IncrediBuild-Visual Studio partnership. With this collaboration and at no additional cost, developers can use IncrediBuild’s build engine to lay out build plans for their applications with more parallelized execution of the build. This leverages hardware resources more effectively and provides monitoring to identify bottlenecks and better understand resource usage. For complete details, see the post, Improving your build times with IncrediBuild and Visual Studio 2015.
  • Tools for Universal Windows Apps v1.2. This update enables you to build and submit apps to the Windows Store targeting Windows 10 SDK Version 1511. It includes several developer productivity improvements to .NET Native, the XAML designer, the manifest designer, Windows Store packaging, and the debugger in this release. If you don't already have Tools for Universal Windows Apps installed, you can enable them by modifying the Visual Studio 2015 installation, or directly installing them from http://go.microsoft.com/fwlink/?LinkID=619614.
  • Native support for behaviors in Universal Windows apps. Behaviors are an easy way of adding common interactivity to your XAML apps without having to add more imperative code. These are natively supported in Update 1, shipping as a NuGet Package (available for both managed and native projects), and accepting contributions as an open source project. The package can also be installed through the Blend Assets Pane (under “Behaviors”). Learn more from the XAML Behaviors, open source and on UWP post on the Windows Developer blog, start contributing by visiting the GitHub page, or request features by raising issues.
  • MSTest and CodeCoverage support for ASP.NET 5. The Visual Studio testing tools now support MSTest framework-based tests for ASP.NET 5 applications and add support for CodeCoverage with ASP.NET 5 on x86/x64 platforms targeting the CoreCLR/CLR. The MSTest framework components are available from the NuGet gallery.
  • Parallel Test Execution: The Visual Studio testing tools introduce support for parallel execution of test cases leveraging the available cores on the machine, with Test Explorer indicating the progress of parallel tests. The test execution engine is launched on each available core as a distinct process, and is given a container (assembly, DLL, or relevant artifact) with the tests to execute according to the semantics of the test framework. VS supports parallel execution through all launch points (e.g. the command line and IDE commands like Test Explorer, CodeLens, and various “Run” commands). For details on how to enable this feature, refer to the Release Notes.

    Parallel Test Execution feature showing tests running at the same time
  • C# Interactive Window and command-line REPL. We’ve added more functionality and fixed a number of bugs in these features that first appeared in the CTP. For RTM we’ve also cleaned up some of the command-line argument handling as described in the detailed notes on GitHub. (Note that NuGet support and the VB scripting API are not available with this release, but we’re still actively working on them. In the meantime, you can play with the C# scripting API available on GitHub.)
  • Managing analysis issues. We’ve heard from many customers that when they install a Roslyn analyzer from NuGet or Visual Studio Extensions, thousands of code analysis issues end up showing up in the Error List, leading them to abandon the analyzer. With this update you can now suppress all current issues to a global suppression file, view and manage baselined issues (to audit suppressions or review baselined issues), show analysis warnings and messages for only ‘my code changes,’ and remove duplicate instances of warnings in the error list to focus results to the unique set.

    Managing analysis issues
  • NuGet and NuGet Package Manager. NuGet 3.3 is now bundled with Update 1, and we’ve made a number of changes to the NuGet Package Manager interface including a tab-based UI to help filter groups of packages, action buttons in the package list for quick access to common management functions, a Consolidate tab for packages you work with at the solution level, and an Update tab that allows you to select and update multiple packages together.

    Updated NuGet package manager
  • Visual Studio license improvements. Signing in to unlock the IDE with your subscription is one of those features that you do not want to see interrupting your workflow. Towards this goal, Update 1 has improvements that will ensure the IDE stays unlocked for a year or more after signing in as long as you have regular access to the internet to keep the license renewed in the background. More improvements to reduce sign ins are still to come.

Again, for a complete list of features in Update 1 and information on bug fixes and known issues, see the Visual Studio 2015 Update 1 Release Notes.

Your continuing feedback is very important to us as we now start work on the next Visual Studio update. Share your feedback, suggestions, thoughts, and ideas on UserVoice, through the in-product feedback UI, or file a bug through the Visual Studio Connect site.

clip_image006[4]

John Montgomery is the Director of Program Management for Visual Studio, responsible for product design and customer success for all of Visual Studio, C++, C#, F#, VB, TypeScript, JavaScript, and .NET. John has been at Microsoft for 17 years, working in developer technologies the whole time. Reach him on Twitter @JohnMont

Connect(“demos”); // 2015: HealthClinic.biz

$
0
0

image

During Connect(); //2015 we showcased many technologies available to you as a developer across Azure, Office, Windows, Visual Studio and Visual Studio Team Services. We’ve also heard from you that you love to have real-world applications through which you can directly experience what’s possible using those technologies. This year, then, we built out a full health and technology scenario for our Connect(); //2015 demos and are delighted to share all the source code with you:

image

HealthClinic.biz is a fictitious regular doctor practice specialized in offering healthcare preventive care. This clinic is using different Microsoft and multi-channel apps built with Visual Studio 2015 to grow their business and modernize the customer experience. They also innovate and offer multiple apps and services—including websites, mobile apps, and wearable apps—to empower their patient’s well-being with easy access to manage their healthcare data and stay healthy.

How we built the scenario

We built eight different demo projects in a couple of months using Visual Studio 2015 and Agile methodologies. We used Visual Studio Team Services to host our code repository and to manage our backlog, daily builds, and DevOps cycle across a number of different teams at Microsoft. And all the data, services, and notifications that bring the experiences and devices together are centralized in a variety of Azure services. Here’s how all that is structured:

Structure of HealthClinic.biz

Connect (“with your health”); Demo apps

The core apps in HealthClinic.biz are a public website, a private website, a WPF application for receptionists, a Universal Windows Platform app for patients, mobile apps for patients and doctors, wearable apps, and more! The following sections give a brief summary of each, which you can see in action during the Connect(); //2015 keynotes.

Public and Private Websites

The clinic has a public-facing or marketing site that provides info on the services and apps that the clinic offers. The clinic is also an enterprise and needs to manage doctors and patients in its database. The clinic thus has a private website used for patient/doctor data management and a dashboard to understand visit trends.

Public website

Public website for HealthClinic.biz

 

Private website

Private website for HealthClinic.biz

 

We built both websites using Visual Studio 2015 + ASP.NET 5.0 RC + Azure, with Glimpse and App Insights for monitoring and gathering telemetry.

You can see these apps in action @ Scott Hanselman’s keynote starting at 2:11.

Universal Windows Platform and WPF apps

For receptionists, we built a WPF app that lets them view the information they need. Similarly, we build a Universal Windows Platform app for patients. Both apps use a common Portable Class Library that results in approximately 80% shared client logic code between the apps. You can see more during Kevin Gallo’s demo starting at 1:07:50.

WPF receptionist app

WPF receptionist app for HealthClinic.biz

 

UWP patient app

UWP patient app for HealthClinic.biz

 

Cross-platform mobile apps, and wearables

For patients, we built a cross-platform mobile app using Xamarin so we could deliver a native look and feel and great performance on every device across iOS, Android, and Windows.

We built another app for doctors of the clinic using web technologies and the Visual Studio Tools for Apache Cordova. This allows 100% code reuse across devices, with Cordova plugins providing access to native device capabilities not available in a browser.

Patient mobile app (Xamarin)

Patient mobile app for HealtClinic.biz

 

Doctor mobile app (Apache Cordova)

Doctor mobile app for HealthClinic.biz

 

When patients want to schedule an appointment with their favorite doctor, they need to know when the doctor is available. These apps let patients create appointments in both the doctor’s Office 365 calendar and in their own Outlook.com calendar using same API, the Microsoft Graph API.

Of course, mobility is not only about smartphones and tablets. Wouldn’t it also be great if the doctors of this clinic could provide continuous service? Using Visual Studio 2015, we built an app that provides medication reminders for the Apple Watch and Microsoft Band 2 so patients can have assisted care throughout the day.

Apple Watch and Microsoft Band

 

Watch Amanda Silver’s keynote talk and demo starting at 1:16:55 where she shows the latest on mobile development, including native cross platform apps (Xamarin), hybrid cross-platform apps (Cordova), and wearables.

Even more apps

During their segment, Brian Harry and Donovan Brown demonstrated (starting at 16:30) how Visual Studio Team Services plus different extensions work together to create an awesome DevOps experience for devices and services. And for the grand finale, Scott Hanselman showed a smart end-to-end diabetes monitoring scenario. He used multiple cloud technologies including health data from Microsoft Health, his own glucose data in the cloud, Azure Machine Learning experiment data, and the Microsoft Graph API to get insights from his own personal health data, such as determining the most stressful times in his calendar. Let’s just say the common thread had something to do with a man in a red shirt.

Scott Hanselman's demonstration of personal health data using Azure

 

Download the code and contribute!

By now we hope you’re ready to get into the HealthClinic.biz code yourself, which you can download from GitHub. And we certainly invite you to help build out this scenario further to help many other developers realize solutions that can be built with the latest developer technologies to serve the many needs in our world today.

Download the code: HealthClinic.biz on GitHub

Enjoy!

image

Erika Ehrli Cabral, Senior Product Marketing Manager, Developer Tools

@erikaehrli1

Erika has been at Microsoft for over 11 years, working first in Microsoft Consulting and enjoying later on different roles where she created content and code samples for developers. In her current role she is now focused on executive keynote demos and Visual Studio and Azure product marketing.


The .NET Journey: Recapping the last year

$
0
0

Having just completed Connect(); // 2015, we thought to take a moment to review everything that’s happened with .NET over the last year, between last year's and this year's Connect();. And what a year it’s been! We’ve seen significant developments in the .NET Framework, including the release of new versions, and also the release of two new technologies, .NET Native and .NET Core, both of which will change the ways in which the .NET Framework is used and the platforms on which it is supported.

The .NET Framework 4.6

The .NET Framework version 4.6 was released in July with Visual Studio 2015 and is automatically installed on all Windows 10 systems. As the latest release of a mature product known for its robustness and ease of development, .NET Framework 4.6 offers improved app performance and a variety of individual feature enhancements:

  • A new version of the 64-bit JIT (Just-in-Time) compiler significantly enhances performance and supports SIMD hardware acceleration. A compiled app that targets x64 or anyCPU automatically takes advantage of the new JIT compiler when it runs on a 64-bit operating system.
  • Improved loading of assemblies decrease virtual memory.
  • Greater control over the garbage collector lets you disallow garbage collection during the execution of a critical path by calling GC.TryStartNoGCRegion and EndNoGCRegion. You can also use an overload of the GC.Collect method to control whether both the small object heap and the large object heap are swept and compacted or swept only.
  • The addition of SIMD-enabled vector types, such as Vector2, Vector3, and Vector4, Matrix3x2, and Matrix4x4, to the System.Numerics namespace.
  • Support for the Windows CNG cryptography APIs. The .NET Framework 4.6 adds the RSACng class to provide a CNG implementation of the RSA algorithm, a set of extension methods for X509 certificates, and enhancements to the RSA API so that common operations no longer require casting or type conversion.
  • Methods to convert the .NET Framework's DateTimeOffset values to Unix time.
  • An AppContext class, which allows library developers to provide a uniform way for users of their application to opt out of new features.
  • Task-based asynchronous pattern (TAP) enhancements, including convenience methods to return completed tasks in a particular state (such as Task.FromCanceled) and a new class, AsyncLocal<T>, that allows you to store ambient data that is local to a particular asynchronous control flow. In addition, for apps that target the .NET Framework 4.6, tasks inherit the culture of the calling thread.
  • Improved rendering in Windows Presentation Foundation (WPF) and Windows Forms. WPF also has improved support for touch.
  • In Windows Communications Foundation (WCF), support for TLS 1.1 and TLS 1.2 in addition to SSL 3.0 and TLS 1.0. You can also select the protocol to use, or disable less secure protocols, programmatically, and you can send messages using different HTTP connections.

There are also enhancements in networking, Windows Workflow Foundation (WWF), transaction processing, and code page encoding. For a complete list of new features and additional detail, see What's New in the .NET Framework.

The .NET Framework 4.6.1

The .NET Framework version 4.6.1 was released on November 30 and is automatically installed with the Windows 10 November Update. The .NET Framework 4.6.1 features performance and reliability improvements, as well as a handful of new features. As part of the ongoing work to modernize the cryptography API, the .NET Framework's cryptography API now includes support for Elliptic Curve Digital Signature Algorithm (ECDSA) X509 certificates. In addition, Windows Presentation Foundation features spell-checking improvements and additional support for per-user custom dictionaries, while Windows Workflow Foundation now supports a distributed transaction manager other than MSDTC.

In-place and side-by-side upgrades

The .NET Framework 4.6 or 4.6.1 is an in-place upgrades for the .NET Framework versions 4.0, 4.5, 4.5.1, and 4.5.2. In other words, if any of those other four versions are already installed on a system, installing the .NET Framework 4.6 or 4.6.1 replaces them.

The .NET Framework 4.6 or 4.6.1 is a side-by-side upgrade for systems with any versions earlier than the .NET Framework 4 (the .NET Framework versions 1.1, 2.0, or 3.5); in other words, the .NET Framework does not replace these versions but instead is installed separately. Applications that target these older versions of the .NET Framework run on the older version if it is present. If the original targeted version of the .NET Framework is not present, they can instead run on the .NET Framework 4.6 if the following entry is made in the app's configuration file:

<configuration>

  <startup>

    <supportedRuntimeversion="v4.0" />

  </startup>

</configuration>

Application compatibility with .NET Framework 4.6 and 4.6.1

Will an application developed for an earlier version of the .NET Framework run under the .NET Framework 4.6 or 4.6.1? The .NET Framework maintains an extremely high level of backward compatibility from one version to another. Almost all applications that target the .NET Framework 4 and its point releases will run without modification on the .NET Framework 4.6 or 4.6.1. For a list of changes that may require recompilation, along with an assessment of their significance and possible workarounds, see Runtime Changes in the .NET Framework 4.6 and Runtime Changes in the .NET Framework 4.6.1. Some changes only affect apps that explicitly target the .NET Framework 4.6 or 4.6.1, but provide a different behavior for apps that target a previous version; for a list of these, see Retargeting Changes in the .NET Framework 4.6 and Retargeting Changes in the .NET Framework 4.6.1.

.NET Native

.NET Native is a compilation and deployment technology for Universal Windows Platform (UWP) apps written in C# and Visual Basic. It uses and optimized implementation of .NET Core (discussed in the next section) and compiles apps to native code. In other words, it compiles an app running on an ARM system to the ARM instruction set, and it compiles an app running on an x64 system to the x64 instruction set. This differs from most .NET Framework applications, which are compiled to intermediate language (IL) before they are deployed, and then are compiled to native code at runtime by the Just-In-Time (JIT) compiler.

Selecting the .NET Native options

.NET Native produces small, compact binaries that load and start up quickly. It statically links only those code elements from the .NET Framework Class Library and any other libraries you may use. Code paths that are not executed by your application are not linked into the binary. Along with your application code, .NET Native produces a small app-local runtime whose primary responsibility is memory management and garbage collection. For more information on .NET Native's compilation technology, see .NET Native and Compilation.

Normally, the .NET Framework Class Library includes rich metadata about each assembly, type, and member. When compiling apps to native code, however, .NET Native includes only the metadata that an app actually needs at runtime. For some reflection and serialization scenarios, the .NET Native tool chain may be unable to detect that it needs specific metadata. You can identify these scenarios and ensure that the .NET Native tool chain includes all the necessary metadata at runtime by testing the release version of your app and defining the required metadata in a runtime directives file. In addition, two troubleshooters that help supply the runtime directives needed to reflect on or serialize types and type members are available.

By default, the release builds of all UWP apps written in C# or Visual Basic are compiled to native code with the .NET Native tool chain. For faster compilation and ease of debugging, however, debug builds are not compiled with the .NET Native tool chain. This makes it important to thoroughly test the release builds of your app on each of its target platforms.

For more information about creating UWP apps that are compiled to native code, see Getting Started with .NET Native.

.NET Core

.NET Core is a modular, cross-platform, open source implementation of the .NET Framework that will run on Windows devices, as well as on Linux and Mac OSX. Unlike the .NET Framework, .NET Core consists of a set of runtime, library, and compiler components that can be used in various configurations, depending on the needs of your application.

To get a better sense of what .NET Core is, let's compare it to the.NET Framework 4.6:

.NET Framework

.NET Core

A sizable runtime, the CLR, that provides memory management and a host of other application services.

CoreCLR, lightweight runtime that provides basic services, particularly automatic memory management and garbage collection, to your app, along with a basic type library.

The .NET Framework Class Library, a large, monolithic library with thousands of classes and many thousands of members. Whether or not your application uses individual types and their members, they are always present and accessible.

CoreFX, a set of individual modular assemblies that you can add to your application as needed. Unlike the .NET Framework 4.5, where the entire .NET Framework Class Library is present, you can select only the assemblies that you need. That the assemblies are local to your application solves versioning problems and reduces the overall size of your applications. For example, if you are developing a vector-based application, you can download the System.Numerics.Vectors package without the overhead of a large class library.

Suitable for developing traditional Windows desktop applications.

Suitable for a full range of modern applications that operate on small devices with constrained memory and storage.

Aside from a basic setup procedure, each CoreFx module is independently downloadable as a NuGet package from the CoreCLR GitHub repo.

For more information on .NET Core, see Introducing .NET Core. For the basic .NET Core documentation set, see .NET Core: A General Purpose Managed Framework.

We hope you’ve enjoyed this recap of everything that’s happened in .NET over the last year. As always, we invite your feedback, suggestions, thoughts, and ideas on UserVoice, through the in-product feedback UI, or file a bug through the Visual Studio Connect site

Ron Petrusha

Ron Petrusha is a programming writer on the .NET Framework team. He is also the author or co-author of a number of computer books, including Inside the Windows 95 Registry, VBScript in a Nutshell, and Visual Basic 2005: The Complete Reference.

Installing the Unreal Engine in Visual Studio

$
0
0

As previously announced, Visual Studio has partnered with some of the most popular game engines to bring you an easy acquisition experience for game development tools.  Today we are pleased to confirm that we now provide the ability to acquire and install the Unreal Engine directly from the IDE. 

What is Unreal Engine?

The Unreal Engine is a cross-platform game engine targeting DirectX 11 and 12 for PC and Xbox, OpenGL for iOS, OS X and Android, and WebGL for the Web.  Console development on Xbox One and PlayStation 4 is also available on the Unreal Engine for registered developers of those platforms. Unreal Engine also supports virtual reality development targeting platforms including Oculus, PlayStation VR, SteamVR and Gear VR.

Unreal Engine games can be programmed using C++ and Unreal’s visual scripting framework called Blueprints.  Visual Studio serves as a powerful code editor and debugger when using C++ for Unreal development. 

Unreal C++ code inside Visual StudioUnreal C++ code inside Visual Studio

Visual scripting with BlueprintsVisual scripting with Blueprints

Getting Started

From Visual Studio you can open up the new project dialog using the FileàNew Project option and navigate to the installed templates, under which there will be a Game folder.  Inside you will see the options that Visual Studio currently provides for creating a game, which now includes Unreal Engine. The Unreal Engine template will not appear if Unreal Engine is already installed on your machine.

Visual Studio template item to install Unreal Engine

Selecting this template will automatically launch a series of dialogs that will guide you through the Unreal Engine installation.

Unreal Engine installer

After selecting install, the Visual Studio installer will launch with the Unreal Engine checked.  Click the Next button and you will be presented with a link to the Unreal Engine license, where clicking Update verifies that you have read and accept those terms and continues with the rest of the installation.

Visual Studio install options for Unreal Engine

Gametime

One the installer has completed, the Unreal application will launch and you are now ready to start making games!

UI of the Unreal Engine application

For more information on Unreal development, check out the following resources:

Getting Visual Studio Setup

Unreal Development Docs

Cheers,

The Visual Studio Team @ Microsoft

Adam Welch

Adam Welch, Program Manager, Visual Studio Team

Adam joined Microsoft in 2012 after graduating college, fueled by his passion for software development and game design. He has worked on the Visual C++ debugging and diagnostic tools, including the native memory profiler, and more recently began focusing on game development tools for Visual Studio.

Unit Testing Apache Cordova Apps with Visual Studio, Part 1

$
0
0

See Part 2 of this series.

Great apps—like great artists, actors, and athletes—are great performers. Human beings validate and continually improve their performances through extensive training, practice, rehearsals, and after-the-fact reviews. We achieve these same ends in software development through many levels of rigorous testing—or continuous validation—across the entire app lifecycle.

Chances are you’ve heard about unit testing, but you might not be clear on what it is, exactly, and how it fits into a cross-platform app project build with Apache Cordova. In the documentation for the Visual Studio Tools for Apache Cordova, we’ve recently added a whole section Author & run tests to explore the details of unit testing with Cordova apps through a series of comprehensive examples.

In this two-part post I’ll give a shorter version of those walkthroughs to familiarize you with the process. Part 1 here provides background on unit testing and a basic example with Cordova and Visual Studio. Part 2 will delve a little deeper into the subject of test-driven development and debugging unit tests.

 

Unit testing vs. other forms of testing

Unit testing is unique from other forms of manual and automated testing in a number of ways:

Unit Testing

Other Testing

Tests “units” of app code (classes, methods, properties, and functions) by calling/using them directly.

Tests the built app that’s been deployed to emulators or tests device through its user interface.

Is aware of how the app code is written (“white box testing”)

Is not aware of how the app was written (“black box testing”)

Tests are run on development and build machines via a test runner (for example, an independent JavaScript runtime like Node.js).

Tests are run on emulators or physical devices.

Tests are themselves pieces of code (typically written in the same language as the app code, e.g. JavaScript)

Tests are scripts (written manually or generated by a recorder) or are simply a set of steps that a tester performs manually.

Occurs early in the dev cycle, alongside coding or even before coding begins (test-driven development).

Occurs after a successful build of the app.

Ideally run very quickly so they can be performed with each build, which helps to quickly catch regressions introduced with code changes.

Are not time-sensitive (depending on one’s release management process)

Failed tests invalidate builds or commits to version control repositories.

Failed tests invalidate steps in a release management process.

 

The following figure illustrates how most forms of app testing (left) differ from unit testing (right), and illustrates that unit tests are typically run outside the app platform itself.

 

Note: when you set out to do unit testing, focus wholly on the code that you write or modify. You need not test libraries or other code you’re importing into a project but not modifying, as the authors of those libraries should have already tested them. If tests are lacking for a library you want to use, the right place to do that work is in the library’s source repo, not in your project.

 

Unit testing environments for JavaScript and Apache Cordova

A unit testing environment consists of the three components: the runtime, a test framework, and a test runner. The following table describes these and gives some examples.

Component

Description

Examples for JavaScript

Runtime

Loads and executes code being tested outside the app. This can happen in a browser or a separate runtime sometimes referred to as a “headless browser.”

Browsers, or Node.js, PhantomJS, Chrome V8

Test framework

Defines how to write pieces of code that are specifically identified as “tests,” typically in the same language as the code being tested so they can share the same runtime, but this is not required.

Jasmine, QUnit, Mocha along with libraries like Chai and assert.js

Test runner

Executes tests defined by a supported framework within a supported runtime, and produces test reports.

Chutzpah (uses PhantomJS), Karma (uses a browser)

 

All of these relationships are illustrated below:

 

 

Unit testing is then a matter of invoking the test runner at appropriate times and viewing the reports. This can be done manually or as part of an automated build process, and the test runner might be invoked through the command line or through integration with the Visual Studio IDE.

Some test runners, like Chutzpah, have a Visual Studio test adapter that integrates the tool and its reporting into Visual Studio’s Test Explorer. Other test runners, like Karma, don’t have a test adapter but can still be integrated into Visual Studio’s Task Runner Explorer in conjunction with tools like Grunt and gulp. Both options are covered in the documentation; for Karma and gulp, see Basic unit testing and Test Apache Cordova apps with Karma and Jasmine.

 

Unit testing in action

To better understand the mechanics of unit testing, let’s now follow a piece of code and an associated unit test through the basic process with Chutzpah, QUnit (jQuery’s unit test framework), and Visual Studio.

The “unit”

First, assuming you have the Visual Studio Tools for Apache Cordova installed, create a new app project through File > New Project, selecting JavaScript > Apache Cordova Apps > Blank App. Then in the www/scripts folder create a file called normalize.js with the code below.

/** @description Converts JSON data that may contain Name and PersonalIdentifier 
 *    properties to an object with the properties name (string) and id (positive 
 *    integer up to 9999999999.
 * @param {string} jsonIn The JSON data to normalize.
 * @return {object} An object with name (string) and id (integer) properties,
 *    defaulting to "default" and 0, or null if the JSON is null or invalid.
 */
function normalizeData(jsonIn) {
}

This simple normalizeData function is the “unit” we’ll be testing, and we’ll leave it empty for the moment. Understand that this code is strictly part of the app’s functionality: it has nothing whatsoever to do with our choice of test framework or test runner.

The unit tests

Next, each unit test is a piece of code that validates a unit by:

  1. Calling it with specific inputs, and,
  2. Checking the output against the expected value.

A unit test must follow the conventions of the test framework you’re using. Because we’re testing JavaScript code, it’s easiest to use one of the many JavaScript test frameworks available to us. For this example, we’ll use the one called Jasmine. It enjoys built-in support with the Chutzpah test runner that we’ll be using shortly, so we don’t need to install anything for Jasmine specifically.

For the unit tests, create a folder named test in the project, then create a file in that folder called normalize_tests.js with the following contents:

// First argument to "describe" is the name of this group of tests
describe("normalizeData tests", function () {
    // First argument to "it" is the name of the specific test
    it("accepts golden path data", function () {
        // Use the unit being tested as necessary
        var json = '{"Name": "Maria", "PersonalIdentifier": 2111858}';
        var norm = normalizeData(json);

        // Check the results; "expect" is a Jasmine method.
        expect(norm.name).toEqual("Maria");
        expect(norm.id).toEqual(2111858);
    });
});

In Jasmine, you create a group of tests with its describe method, and each test is a call to a function named it, which ends up reading quite well with the description of the test itself. Within each test you use the unit code however you want, and then check results with Jasmine’s expect method that generates the appropriate pass/fail report output.

We have just one simple test to start with here, but notice how it’s specific: it calls the unit under test with one set of inputs and gives an exact name/description for the test with those inputs. This follows the best practice of isolating each unit test to an individual test case, creating a 1:1 mapping between the name of the test, as it appears in reports, and the exact test case (that is, the arguments used in the test). When the test runner reports a failure, then, you know exactly where to look in your code and can easily step through that one test in the debugger to isolate the failure. This saves you time in the end, because if you combine tests, you’ll have to debug the whole set to find the one that failed, and you’ll likely end up separating all the tests anyway.

 

The test runner

With unit code and at least one unit test in place, we can now run the tests with the Chutzpah test runner. To install it, go to Tools > Extensions and Updates… in Visual Studio, select Online, then search for and install the “Chutzpah Test Adapter” (you’ll be prompted to restart Visual Studio):

 

To tell Chutzpah about the files it should work with, create a Chutzpah.json file in the project’s root folder with the following contents:

{
  "References": [
    { "Path": "www/scripts/js/normalize.js" }
  ],

  "Tests": [
      { "Path": "test/normalize_tests.js" }
  ]
}

The “References” section clearly identifies the code to test and the “Tests” section identifies the unit test files. You’d obviously list more code and test files as you add them to a project.

Now select Test > Windows > Test Explorer and you should see the available tests listed there:

 

Note: if nothing appears, there are likely syntax errors in your test files which prevent Chutzpah from finding those tests.

Click Run All to build the project, run the tests, and see the results. Because we don’t have any implementation in normalizeData, the test should fail:

 

This verifies that you have the mechanics of using Chutzpah working within Visual Studio.

If you’d like to make the test pass, implement normalizeData soit at least handles expected inputs and run the test again:

function normalizeData(jsonIn) {
    data = JSON.parse(jsonIn);
    return {
        name: data.Name,
        id: Number(data.PersonalIdentifier)
    };
}

Of course, this code can’t handle anything other than perfect JSON, so there’s definitely room for improvement! We’ll pick up that story in Part 2 where we’ll talk about test-driven development and debugging unit tests.

In the meantime, I’d love to hear how you work with unit testing in Cordova apps, how you’re working with UI testing (both manual and automated), and how we can further improve our support through the Visual Studio Tools for Apache Cordova. Add a comment below, drop me a line at kraigb (at) microsoft.com, or submit suggestions via http://visualstudio.uservoice.com/.

Happy testing!

See Part 2 of this series.

clip_image010

Kraig Brockschmidt, Senior Content Developer, Visual Studio

@kraigbro

Kraig has been around Microsoft since 1988, working in roles that always have to do with helping developers write great software. Currently he’s focused on developing content for cross-platform mobile app development with both Xamarin and Cordova. He writes for MSDN Magazine, is the author of Programming Windows Store Apps with HTML, CSS and JavaScript (two editions) and Inside OLE (two editions, if you remember those) from Microsoft Press, occasionally blogs on kraigbrockschmidt.com, and can be found lurking around a variety of developer conferences.

Unit Testing Apache Cordova Apps with Visual Studio, Part 2

$
0
0

Part 1 of this post provided some background on unit testing with a basic example in Visual Studio for an app written with Apache Cordova. In this post we’ll make many improvements to that example using the process of test-driven development, which helps you separate the process of thinking about how to challenge a unit of code to fail from the process of coding that unit to make it not fail! We’ll also discuss a little about debugging unit tests.

Again, these two posts are a shorter version of walkthroughs that we’ve recently added to the documentation for the Visual Studio Tools for Apache Cordova, in the section Author & run tests.

 

Test-driven development

It should be obvious that having one test for an empty (or overly simplistic) implementation of normalizeData is woefully inadequate. A robust normalizeData needs to handle all sorts of bad JSON that would cause utility functions like JSON.parse and/or property dereferences to fail. And of course we need to have tests that exercise all the data variations we can think of.

Question is, where to start? Write code, write tests, or go back and forth between the two? You’ve probably done plenty of the latter: write some better code into normalizeData, then write some tests, examine cases that fail, then write more code, write more tests for cases you haven’t covered yet, correct the code again, and so on. Although this is manageable, it forces you to switch back and forth between thinking about code and thinking about data, and switching between trying to make the code work properly and thinking up ways to make it fail. These really are two different mental processes!

This is where the approach of test-driven development shows its value. To fully exercise any piece of unit code, you eventually have to think through all the necessary input variations. Test-driven development does this thinking up front, which is very efficient because once you think of a few tests cases, you can quickly see additional ones. For example, if you think to include an object inside a piece of JSON, you’ll naturally think to include an array as well. If you think to include an integer where the unit code might expect a string, it’s natural to also try a string where it expects an integer.

With the normalizeData function, I found it took perhaps 15 minutes to think through a strong set of test inputs with different challenges to JSON.parse, challenges to assumptions about the structure of valid JSON, and challenges to assumptions about data types. Here’s that list:

'{"Name": "Maria", "PersonalIdentifier": 2111858}'
null
''
'blahblahblah'
'{{}'
'{{[]}}}'
'document.location="malware.site.com"'
'drop database users'
'{"Name": "Maria"}'
'{"PersonalIdentifier": 2111858}'
'{}'
'{"name": "Maria", "personalIdentifier": 2111858}'
'{"nm": "Maria", "pid": 2111858}'
'{"Name": "Maria", "PersonalIdentifier": 2111858, "Other1": 123, "Other2": "foobar"}'
'{"Name": "Maria", "PersonalIdentifier": "2111858"}'
'{"Name": "Maria", "PersonalIdentifier": -1}'
'{"Name": "Maria", "PersonalIdentifier": 123456789123456789123456789123456789}'
'{"Name": , "PersonalIdentifier": 2111858}'
'{"Name": 12345, "PersonalIdentifier": 2111858}'
'{"Name": {"First": "Maria"}, "PersonalIdentifier": 2111858}'
'{"Name": "Maria", "PersonalIdentifier": {"id": 2111858}}'
'{"Name": {"First": "Maria"}, "PersonalIdentifier": {"id": 2111858}}'
'{"Name": ["Maria"], "PersonalIdentifier": 2111858}'
'{"Name": "Maria", "PersonalIdentifier": [2111858]}'
'{"Name": ["Maria"], "PersonalIdentifier": [2111858]}'
'{"Name": "Maria", "PersonalIdentifier": "002111858"}'
'{"Name": "Maria", "PersonalIdentifier": 002111858}'

Again, once you get thinking about input variations, one test case naturally leads to another. And once you’ve worked out JSON variations for one unit test, you’ve essentially created a reusable asset for any other function that takes JSON, in whatever project.

With the input list in hand, it’s now a simple matter—with a lot of copy and paste!—to wrap the necessary test structure around each set of inputs. For example:

it('accepts golden path data', function () {
    var json = '{"Name": "Maria", "PersonalIdentifier": 2111858}';
    var norm = normalizeData(json);
    expect(norm.name).toEqual("Maria");
    expect(norm.id).toEqual(2111858);
});

it ('rejects non-JSON string', function () {
    var json = 'blahblahblah';
    var norm = normalizeData(json);
    expect(norm).toEqual(null);
 });

it('accepts PersonalIdentifier only, name defaults', function () {
    var json = '{"PersonalIdentifier": 2111858}';
    var norm = normalizeData(json);
    expect(norm.name).toEqual("default"); //Default
    expect(norm.id).toEqual(2111858);
});

it('ignores extra fields', function () {
    var json = '{"Name": "Maria", "PersonalIdentifier": 2111858, "Other1": 123, "Other2": "foobar"}';
    var norm = normalizeData(json);
    expect(norm.name).toEqual("Maria");
    expect(norm.id).toEqual(2111858);
});

it('truncates excessively long Name', function () {
    //Create a string longer than 255 characters
    var name = "";
    for (var i = 0; i < 30; i++) {
        name += "aaaaaaaaaa" + i;
    }

    var json = '{"Name": "' + name + '", "PersonalIdentifier": 2111858}';
    var norm = normalizeData(json);
    equal(norm.Name).toEqual(name.substring(0, 255));
    equal(norm.Name.length).toEqual(255);
    expect(norm.id).toEqual(2111858);
});

it('rejects object Name and PersonalIdentifier', function () {
    var json = '{"Name": {"First": "Maria"}, "PersonalIdentifier": {"id": 2111858}}';
    var norm = normalizeData(json);
    expect(norm).toEqual(null);
});

Note that the test names (the first argument to it) are what appear in UI like Test Explorer, so they should always identify what’s being testing and the basic nature of the test (e.g. “rejects” or “accepts”). Also, it’s certainly possible to put inputs and expected results into an array and iterate that collection instead of writing each test individually. I’ve just left everything explicit here.

The point here is that by first spending something like 30 minutes of focused work on input variations and wrapping them in unit tests, you’re now entirely free to focus on writing the code without having to wonder (or worry!) whether you’re really handling all the possible inputs.

In fact, if you run all these tests against an initially empty implementation of a function like normalizeData, many or most of them will clearly fail. But that just means that the list of failed tests is your to-do list for coding, mapping exactly to the subset of input cases that the function doesn’t yet handle properly. You improve the code, then, to pass more and more tests. When the function passes all the tests, you can be completely confident that it can handle all the possibilities it should. For a full walkthrough, which includes the completed implementation of normalizeData, see Improving the unit tests: an introduction to test-driven development in the documentation.

Test-driven development, in short, cleanly separates the task of coming up with input cases from the task of writing the code to handle those cases. Ultimately, if you’re going to do a really good job testing your code, you’ll have to separate these tasks one way or another. By acknowledging this up front, test-driven development can result in more robust code earlier in the development process, which can reduce your overall costs.

 

Debugging tests and runtime variances

One of the unit tests shown in the previous section is buggy. Do you see which one? I thought I’d written a complete implementation of normalizeData, which included code to handle the 'truncates excessively long Name' test case, but that case was still failing and I couldn’t see the problem right away.

Fortunately, Visual Studio gives you the ability to debug unit tests just like you can debug any other kind of code, with the ability to set breakpoints, examine variables, and step through the test code. Unit test code is still code, after all, and just a prone to bugs!

Setting breakpoints in the Visual Studio editor isn’t enough, however. Running tests through Test Explorer doesn’t pick up those breakpoints because a test runner like Chutzpah is spawning separate PhantomJS processes to load and execute all the JavaScript, but the Visual Studio IDE doesn’t have debug hooks into that engine.

You have instead use the Test > Debug > Run menu, where you’ll find options for Selected Tests and All Tests. You can also right-click a failed test and select Debug Selected Tests. Any of these commands will, for JavaScript, instruct the test runner to execute code in a browser, to which Visual Studio can attach the debugger. Reports from the test framework will also appear in the browser.

Gotcha alert! The Test > Debug > Run > All Tests and Test Explorer > Run All commands automatically save any files that you’ve modified in the project. However, commands that run individuals tests, do not save changed files, which can lead to some confusion when an expected change isn’t picked up. So be sure to save prior to running individual tests.

In the debugger, I was able to see that my unit test mistakenly tries to dereference norm.Name rather than norm.name:

After this fix I had just a single remaining test to satisfy, one that tested having a leading zero on an integer value in the JSON. I wasn’t sure why it was failing, so I started the debugger for that test as well. But in the debugger, the test passed! What was going on?

Turns out that I found a small difference between the implementation of JSON.parse in the PhantomJS runtime, which was used when running tests outside the debugger and throws an exception with the leading zero, and the Internet Explorer runtime, which was used during debugging and is just fine with the leading zero. See the topic Debugging unit tests in the documentation for that story!

What’s important to keep in mind here, is that you may find a few similar differences between the runtime used for unit testing and the platform runtime used when the app runs for real. For this reason it’s a good idea to occasionally run all your unit tests on each mobile platform. To do this, adding a special page to a debug build of your app that runs tests when you navigate there. In this case, the act of navigation serves as the test runner, and you’ll need to explicitly reference the test framework libraries so that they’re loaded for that page.

 

Closing

That wraps it up for parts 1 and 2 of this post, which is again a shorter version of content that we’ve published in the Author & run tests section of the documentation. There you’ll find more detailed walkthroughs, along with a discussion about using “mocks” to handle calls to platform APIs and other external dependencies that the unit testing runtime won’t have access to. Let us know what you think!

I’d also love to hear how you work with unit testing in Cordova apps, how you’re working with UI testing (both manual and automated), and how we can further improve our support through the Visual Studio Tools for Apache Cordova. Add a comment below, drop me a line at kraigb (at) microsoft.com, or submit suggestions via http://visualstudio.uservoice.com/.

Happy testing!

clip_image010

Kraig Brockschmidt, Senior Content Developer, Visual Studio

@kraigbro

Kraig has been around Microsoft since 1988, working in roles that always have to do with helping developers write great software. Currently he’s focused on developing content for cross-platform mobile app development with both Xamarin and Cordova. He writes for MSDN Magazine, is the author of Programming Windows Store Apps with HTML, CSS and JavaScript (two editions) and Inside OLE (two editions, if you remember those) from Microsoft Press, occasionally blogs on kraigbrockschmidt.com, and can be found lurking around a variety of developer conferences.

Visual Studio Tools for Apache Cordova Update 5

$
0
0

Welcome to the new year and a new Visual Studio Tools for Apache Cordova (TACO) update! We just released Update 5 of the tools for you—full details are in the release notes—and we’ve created a new developer blog that you can follow to keep up to date with tips, tricks, and articles from our development team.

New in Visual Studio TACO Update 5

In Visual Studio 2015, you should see a prompt to download and install the new Visual Studio TACO Update 5 release.

Visual Studio prompt to install TACO Update 5

The top changes in this release are:

  • CLI interop. If you switch between the command line and Visual Studio, your changes reflected in both development environments.
  • Node 5 / NPM 3 and Cordova 5.4.1 / 6 compatibility. Right now, NPM 3 does not work with Cordova versions 5.3.x and lower. In Update 5, if you are targeting a Cordova version older than 5.4.0 and you have NPM 3 or higher, we will fail your build and show you an error message with suggestions for fixing your build.
  • Over 50 bug fixes. These address issues such as supporting the iOS 6s simulator, various Ripple deployment matters, and support for MySQL.

Read more from our developers, or go to the release notes for Update 5.

Keeping in touch with you!

In addition to building out our tools, we’ve also been working on a few new ways to connect you with members of our team—to help you master the tools and move past issues blocking you from completing your projects.

New developer blog. We’ve just released a new Visual Studio TACO Developer Blog to which we’ll share out regular topics from our engineering team – including tips, tricks, and “behind the scenes” topics.

Visual Studio TACO Developer Blog

Cordova Tools Live Stream. We’re also continuing the Cordova Tools Live stream that we announced last November. In the months ahead, we’ll continue to have regular question and answer sessions with the community. We’ll also be expanding to include a regular set of interviews and topics of interest to Cordova developers at large. Finally, you’ll see us step up the video and audio quality dramatically with the help of our friends at Channel 9.

Cordova Tools Live

Visual Studio TACO Newsletter. In order to keep you updated on all the new samples, tutorials, and guides we are coming out with, we have started a Visual Studio TACO Newsletter with helpful tips on the topics we find you all are asking about. Sign up here and look for the first issue in late January!

 

Lina Zhong

Linda Zhong, Program Manager, Visual Studio Client Tools Team

Linda is new to the Tools for Apache Cordova team, but not new to the trials and tribulations of sad documentation. She spends her time thinking about how to make the VS Cordova user experience really rock!

Jordan Matthiesen

Jordan Matthiesen (@JMatthiesen)
Program Manager, Visual Studio Tools for Apache Cordova

Jordan works at Microsoft on JavaScript tooling for web and mobile application developers. He’s been a developer for over 18 years, and currently focuses on talking to as many awesome mobile developers as possible. When not working on dev tools, you’ll find him enjoying quality time with his wife, 4 kids, 1 dog, 1 cat, and a cup of coffee.

Viewing all 1076 articles
Browse latest View live