Thursday, April 25, 2013

Mobile devices are everywhere


Mobile devices are everywhere

Over a decade ago, while attending a Microsoft Professional Developers Conference, we were shown a video on the coming mobile future. The video showcased futuristic-looking, Windows-powered phones being used for tasks such as locating the closest doctor’s office. In an era where the Palm VII was the closest thing to a smartphone, the video showcased an impressive future.
Fast forward to 2013: There is no mistake that we are living this future. Smartphones and other mobile devices are everywhere. They are available at multiple price points and are increasingly affordable. In fact, for many in the developing world, their only computer is the powerful smartphone they own.

Mobile application development: growth predictions from Gartner

Gartner predictsi by 2016, at least 50 percent of enterprise e-mail users will rely primarily on a browser, tablet, or mobile client instead of a desktop client. Given the increase in the adoption of mobile devices, it is also expected software application development targeting these devices will also dramatically increase in the coming years. Again, Gartner predicts mobile application development projects targeting smartphones and tablets will outnumber native PC projects by a ratio of 4 to 1 by 2015. Gartner further says that smartphones and tablets will represent more than 90 percent of the new net growth in device adoption in the coming four years.
The Apple app store now boasts over 500,000 apps. Android has close to the same number and the Windows Phone marketplace, a much more recent contender, recently crossed 50,000 and is growing at a fast pace.

Line of business mobile applications: the challenge posed by fragmentation

Given this rather exciting backdrop, we can be certain most line-of-business applications will be made available on mobile platforms in the immediate future. As with any other opportunity, mobile application development, with all its promises, comes with its own set of challenges.
One of the primary challenges is the issue of fragmentation. Estimates from the third quarter of 2012 indicated the mobile operating system market is very fragmented. The variants of Android accounted for about 72% of devices sold during this quarter. iOS accounted for about 14%. Research in Motion (RIM/Blackberry) accounted for about 5% and the Windows Phone platform for around 2% (via Gartner).
Developing a line-of-business application to function on all these devices involves working with the following vastly different technologies:
Platform
Primary development platform
Primary development language
Primary IDE
Development platforms
Android
Java based
Java
Eclipse
Windows, Mac OSX, Linux
iOS
Cocoa Touch framework
Objective C
Xcode
Mac OSX
RIM
Java ME
Java
Eclipse
Windows, Mac OSX
Windows Phone 8
.NET/native
C#/C++
Visual Studio
Windows
The platforms, languages, and tools involved are substantially different, and the effort involved in producing a solution that will work on every platform is substantial.
It is also worth noting there is substantial fragmentation even within some of the platforms. This is especially true with the currently dominant Android platform. Given that Android is open and vendors are free to make changes, there are literally hundreds of Android-based devices available on the market today. Many of them work only with specific levels of the Android API. Some of them have issues with applications that target certain features even within a supported API level. In summary, there is no shortage of fragmentation in the mobile market. This makes the implementation of a native solution on multiple platforms quite daunting.

Mobile web applications: the solution for fragmentation?

Web applications are an alternative to native applications. All the major mobile platforms offer very capable browsers. In addition, with the exception of the Windows Phone browser, most other platform browsers are based on the open source WebKit browser platform powering the desktop versions of Apple Safari and Google Chrome. There is excellent support for JavaScript on these browser platforms; jQuery is fully supported on most current mobile devices. Also, increasing compliance with HTML 5 and related web standards is making the browser even more attractive as a development platform. It is possible to build very functional web sites that work very well on mobile devices with technology available today.

Mobile web applications: additional considerations

Building a mobile web site does not offer the same experience as a native application. Users on specific hardware platforms are accustomed to the enhanced experience offered by native applications. Such applications are installed natively and are always available on the launcher surface of the device. Native applications also obey user interface contracts on the device. For instance, on Android the left menu button usually displays a context menu. Users expect this. Web applications can be installed as shortcuts on the launcher surface for most devices, but they do not obey specific user-interface expectations on the deployed device. Another disadvantage to web applications is they have no native access to hardware beyond what is exposed by HTML and related web standards. For instance, there is no direct access to contacts, images, or the camera on the device. For many applications, access to key elements of device hardware is important.

Hybrid applications: the best of web and native applications

Hybrid applications are completely native applications that embed a platform-specific web browser control. All major mobile platforms including Android, iOS, Windows Phone 8, and Blackberry/RIM support embedding web browser controls as implemented on their platform. Since the wrapper is completely native, users are not often even aware they are interacting with a web application. It is quite possible for the native application to provide a seamless navigation experience.
It is also possible for web pages displayed in the browser to interact with native hardware through a JavaScript bridge, a form of which is available on every major platform. Using such callbacks to the native platform makes it possible to access contacts, capture or select images, and play media. In fact, anything you can accomplish through native code can be accomplished through the bridge. The bridge code will of course have to be re-written for every target platform, but this is usually a small fraction of your total application code.
Also, several JavaScript bridge frameworks exist; the most popular is the open source PhoneGapplatform, which provides a substantial part of this plumbing. We will not be using any frameworks for this purpose. We will instead illustrate the concept with a simple Android wrapper.

ASP.NET MVC: an elegant framework for your backend

Hybrid applications can be built with any web backend, but we firmly believe ASP.NET MVC is ideally suitedii for the implementation of hybrid applications. Below are some aspects that make ASP.NET MVC a good choice for such applications.

Clear separation of responsibilities

The clear separation of responsibilities afforded by the MVC environment makes it possible to have very precise control over HTML output. This makes it very easy to generate mobile-friendly HTML. There is no built-in, self-contained control model that makes it hard to control the markup produced.

Sharing most code with desktop or tablet web clients

If you have an existing ASP.NET MVC application that targets desktop browsers, much of the code can be shared with your mobile application. The controller and model code can be shared almost as is. Only the view needs to be changed. It is not difficult to specify a custom view for mobile clients even with the current version of ASP.NET MVC, but the next version of the ASP.NET MVC makes it even simpler. For additional details on mobile-friendly features in the upcoming version of ASP.NET MVC, please refer to ASP.NET MVC.

Minimal friction with underlying web development model

ASP.NET MVC does not build several layers of abstraction over stateless web applications. Instead, it offers a very simple model that works in alignment with the underlying platform, making it very easy to make AJAX calls or use jQuery on the client. There is no complex abstraction such as ASP.NET Web Forms’ ViewState to worry about.
In addition to the above, it is also worth pointing out the business and database layers that already exist in your current .NET applications can be effectively reused with ASP.NET MVC applications. ASP.NET MVC is completely agnostic about the business and database layers and can work effectively with any system currently in place.

Sample hybrid application

We will now walk through a very simple example to illustrate the development of a hybrid application end-to-end using the ASP.NET MVC platform. The sample displays information on students attending a fictional university named Contoso University. There are a couple of general information links as well as access to a student directory where students can be looked up by name. In order to keep the example clear, the sample does not implement any security or error handling. There is no complex code since the objective of the sample is not to showcase the power of the ASP.NET MVC platform, but to showcase its suitability as a backend platform for the development of hybrid, native mobile applications.
The complete code for this sample is available at bit.ly/mvc-native-mobile-apps.
Prerequisites to work with the sample code:
  • ASP.NET MVC 3 with Visual Studio 2010 (any version including the Express Edition).
  • Functional installation of the Android SDK and the Android Development Tools plugin for Eclipse.
  • Detailed instructions and requirements are available here.
  • jQuery and jQuery Mobile. Local copy is not required since the sample code will simply reference the jQuery CDN.

The ASP.NET MVC backend

In the sample code, the provided _Layout.cshtml contains script references to the jQuery and jQuery Mobile libraries. They are not required to build an ASP.NET MVC mobile application, but they do handle a lot of the grunt work. We use jQuery Mobile in our sample to simplify formatting content for mobile devices.
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
Most mobile web clients assume a web page is sized at about 900 pixels and will automatically scale to display the entire page on the device. With a mobile site optimized for a smaller device, we can provide a hint to the device that it should not scale but should instead use the width of the device. This is accomplished via the use of the viewport meta tag as shown below.
<meta name="viewport" content="width=device-width, initial-scale=1.0 ">
The default index action method on the home controller is mapped to the following view markup.
<nav >
    <ul id="menu" data-role="listview">
        <li>@Html.ActionLink("About Us", "AboutUs", "Home")</li>
        <li>@Html.ActionLink("Contact Us", "ContactUs", "Home")</li>
        <li>@Html.ActionLink("Student Directory", "StudentDirectory", "Home")</li>
    </ul>
</nav>
We have a simple unordered list with three action links. We specify the list should be automatically formatted as a list view by the jQuery Mobile runtime using the “data-role=listview” attribute setting. This is all that is required to display the following initial UI on a mobile device.
 Figure 1. Initial screen
The jQuery Mobile runtime takes care of formatting it as a list view. As mentioned earlier, jQuery Mobile is not needed. You can pick the formatting and scripting approach that suits your needs best.
The sample contains the views displayed when the About Us and Contact Us options are invoked. These screens are straightforward and do not require any further explanation.
The Student Directory link displays a page with student names grouped by starting letter. The page also displays the number of students listed under each letter.
Figure 2. Student directory initial screen
Clicking on any option displays a list of students, as seen below.
 Figure 3. Student directory
The student directory views are also fairly simple. They iterate through and display data in a list. The view displaying student details is shown below.
@{

    ViewBag.Title = "Student Directory";
    Layout = "~/Views/Shared/_Layout.cshtml";
    var random = new Random();
}

<ul data-role="listview">
@foreach (string student in ViewBag.Students)
{ 
    <li>

        @{var number = random.Next(1000, 9999); }

        <img src="@Url.Content("~/Content/images/UserImages/80-80/" + student + ".jpg")" alt="@student"/>
        <h3>@student</h3>
        <h4>919-555-@number</h4>
    </li>
}
</ul>
It is a good idea to run the ASP.NET MVC backend in a desktop browser and test it out before proceeding to review the Android wrapper that we will work with next.
You can also directly test on a mobile browser provided the test site is accessible from your test device. If both the development PC and your test device are on the same network, it is possible to make setting changes to the ASP.NET development browser or IIS Express to allow access to the web application from your test device. Such access is blocked by default.
An easier, alternate approach is to use a proxy, which simply redirects traffic on an external port to the internal server. This is the approach we often use. The proxy we use is available for download from GitHubiii.

Android wrapper

The code for the Android wrapper that hosts the web application inside a native Android application is reproduced below.
package com.syncfusion.contoso;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class ContosoActivity extends Activity {

    WebView mWebView;

    private class ContosoWebViewClient extends WebViewClient {
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            view.loadUrl(url);
            return true;
        }
    }
     

    /** Called when the activity is first created. */          
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        mWebView = (WebView) this.findViewById(R.id.webview);

        // Disable scrollbars 
        mWebView.setVerticalScrollBarEnabled(false);
        mWebView.setHorizontalScrollBarEnabled(false);

        // Scrollbar Overlay Content
        mWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);

        mWebView.getSettings().setJavaScriptEnabled(true);
        mWebView.getSettings().setAppCacheEnabled(false);
        mWebView.loadUrl("http://your-web-link");
        mWebView.setWebViewClient(new ContosoWebViewClient() );
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if ((keyCode == KeyEvent.KEYCODE_BACK) && mWebView.canGoBack()) {
            mWebView.goBack();
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }
}
The code is quite simple to follow.
  • WebView is the Android equivalent of the WebBrowser control. It is a wrapper around the default WebKit-based Android browser.
  • We obtain access to an instance of the Android WebView control (defined in an XML layout file and instantiated by the Android runtime at execution).
  • We enable the use of JavaScript on this WebView instance since JavaScript is disabled by default with the WebView control.
  • We then make a few adjustments to the display of the scrollbar–basically turning it off to mimic the look and feel of a native application.
  • We then load the actual web application using a call to the loadUrl API on the WebView instance. your-web-link should be changed to point to your web application.
  • The last section of the code handles the invocation of the hardware back button and causes the embedded WebView to navigate to the previous page.
As you can see this code is not tied to the web application in any direct manner and will not change substantially from application to application. You will only need to add additional code when you require access to specific hardware functionality on the device. We do not delve deeper into this topic here but if you are interested in investigating this further, please look up information on the addJavascriptInterface method of the WebView.
For simplicity, we have described the Android wrapper only. Similar wrappers and extension mechanisms exist on all other major mobile platforms.
Figure 4. Contact Us page displayed on Android 4.0 Emulator inside a native application shell

Conclusion

Hybrid applications are a very promising solution worth looking into for any line-of-business mobile application. They are not suited for scenarios where extensive access to native hardware is required (such as with games) but will work very well in most other scenarios. Any solution implemented with a web backend is also more likely to be future-proof. The HTML standard has evolved slowly over the years and is unlikely to dramatically change as proprietary solutions often tend to do. It offers a stable base on which applications can be built with the certainty that they will continue to work for the foreseeable future. Mobile platform vendors are putting an extraordinary amount of effort into the implementation of HTML 5 and related standards. This will also serve to make web applications more powerful and able to accomplish a substantial subset of what is possible with native applications.
You can leverage your existing .NET web development skills and produce powerful solutions that work on a broad cross-section of devices. At Syncfusion, we are excited by the immense potential offered by hybrid applications.

Secure ASP.NET Applications with Identity and Access Tool


Microsoft recently announced the released of Identity and Access Tool for Visual Studio 2012that enables you to secure ASP.NET, ASP.NET MVC and WCF services with claims based identity. It also provides an ability to accept users from multiple identity providers and adds the necessary configuration for the selected identity provider.
The extension works by updating web.config file with the required settings to enable the Windows Identity Foundation and includes a code generation module that generate a discovery page.
In order to work with Identity and Access Tool, you need to follow the steps mentioned below
  • Create a new ASP.NET MVC Project using Visual Studio 2012
  • Go to Tools | Extensions and Updates
  • Select the option Online from the left side navigation menu from the displayed dialog
  • Visual Studio 2012 populates the available extensions from the Visual Studio gallery
  • Select Page 2 from the bottom page navigator
  • Select Identity and Access Tool, click Download button and follow the on screen instructions to complete the installation process
  • Right click on the project name from the Solution Explorer and provide the required values on the Identity and Access dialog.
Figure 1 - Identity and Access Tool
Identity and Access Tool
Identity and Access Tool enables you to develop and test applications using a local development STS, corporate identity provider like ADFS2 via HTTPS including the usage of Windows Azure Access Control Service to connect to other identity providers such as LiveID, Google, Yahoo and Facebook.

ASP.NET - Data Access Guidance


Microsoft has published Data Access Guidance for ASP.NET 4.5. Most of the changes are related to new features in 4.5, such as those in Web Forms and the new ASP.NET Web API.Some notes from the guidance -
Use ORMs wherever possible with ASP.NET Web Forms and MVC, but ADO.NET directly (through the Database helper) in ASP.NET Web Pages
For WebForms data controls
For Displaying a Single Record - Use FormView to customize generated HTML; for maximum automation of HTML generation use DetailsView
For Displaying Lists - Use ListView to customize generated HTML; Repeater for customized HTML but read-only access and better efficiency (but lesser advanced features); and GridView for maximum automation of HTML generation
ASP.NET Web Forms data binding methods -
Data Source Controls for simple binding without writing any code
Model Binding when it is feasible to write data retrieval and update code
Manual Data Binding when fine-grained control over binding needed or model binding not supported
Data-Binding Expressions
Eval and Bind for weakly typed data
Bind and BindItem for strongly typed data
Use colon in opening delimiter (<%#:) to enable automatic HTML-encoding
Notably, there is a guidance on how to choose between WCF Data Services and ASP.NET Web API for your web services -Choose WCF Data Services if you want to quickly expose a database over HTTP for use inside a firewall on an internal company network.Conversely, choose Web API for Internet-based services because the whitelist approach is more secure than the blacklist approach.WCF uses a black-listing approach to security restrictions (by default everything is made available) whereas Web API uses a white-listing approach (by default nothing is made available)There are a lot of walkthroughs for various scenarios covered on MSDN – you can refer it for more details.

ASP.NET and Web Tools 2012.2 with Enhancements for MVC, Azure and SignalR


Microsoft has released ASP.NET and Web Tools 2012.2 with enhancements for Visual Studio Web Tooling, ASP.NET Web API, Web Forms, MVC, Windows Azure Authentication including support for SignalR.ASP.NET and Web Tools 2012.2 includes updated ASP.NET templates for jQuery, jQuery UI, jQuery Validation, Modernizr, Knockout and other open source NuGet packages. Moreover, you will be able to publish to Windows Azure web sites from within Visual Studio 2012 with an ability to update local to remote files and vice versa.ASP.NET and Web Tools 2012.2 includes Visual Studio 2012 Page Inspector enhancements which include JavaScript selection mapping and CSS live updates. With this release, Visual Studio 2012 code editor supports syntax highlighting for CoffeeScript, Mustache, Handlebars and JsRender. Moreover, HTML editor provides Intellisense support for Knockout bindings and enables you to paste JSON as a .NET class. It also enables you to add extensibility hooks so that third-party mobile emulators can be installed as a VSIX."If you have installed an earlier version of Mads Kristensen's excellent (and free) Web Essentials 2012 extension, you'll want to update it to the latest version before installing today's ASP.NET and Web Tools 2012.2 update," says Scott Guthrie, Corporate Vice President, Server and Tools Business, Microsoft.ASP.NET Web API provides support for OData endpoints that enables you to work with rich query semantics, paging, $metadata, CRUD operations and custom actions over any data source. The release includes a new tracing functionality which enables you to diagnose problems either using Visual Studio 2012 or on Windows Azure.Moreover, the updated Web API projects now include a link to an automatically generated help page that shows how to call your web API including the display of all of your API endpoints, HTTP verbs, parameters, sample request and response messages. It is also possible to customize the help page by adding custom documentation and test client functionality.ASP.NET and Web Tools 2012.2 includes Visual Studio 2012 template for creation of SignalR projects as well as adding SignalR support to existing Web Forms and MVC applications including full support for friendly URLs with an ability to pass parameters to pages as segments of the URL. The new release also provides support of friendly URLs for mobile devices. For instance, YourPage.Mobile.aspx is the format that will be rendered by default on a mobile browser."ASP.NET and Web Tools 2012.2 doesn't change any GAC'ed (Global Assembly Cache) files. It won't mess up your install of ASP.NET or change any existing projects. It's changes are either tooling within Visual Studio, or additions and improvements via local NuGet packages," said Scott Hanselman, Program Manager, Microsoft.ASP.NET and Web Tools 2012.2 enables you to build a Facebook application with the help of a new application template and are displayed inside the Facebook chrome via an iframe. It also includes a single page template for ASP.NET MVC which enables you to build interactive client-side web apps using HTML 5, CSS 3 and the popular Knockout and jQuery JavaScript libraries. Moreover, community contributed MVC templates such as BreezeJS, Ember, DurandalJS and Hot Towel are also included with the latest release.ASP.NET and Web Tools 2012.2 delivers a new Windows Azure Authentication mechanism for MVC, Web Pages, and Web Forms, that enables your application to authenticate Office 365 users from your organization including an ability to create users in your own custom Windows Azure Active Directory domain.Steve Gentile commented that he hope to see support for an AngularJS template in the next version.

Dhana says typescript enhancements are missing.

ASP.NET and Web Tools 2012.2 with Enhancements for MVC, Azure and SignalR


Microsoft has released ASP.NET and Web Tools 2012.2 with enhancements for Visual Studio Web Tooling, ASP.NET Web API, Web Forms, MVC, Windows Azure Authentication including support for SignalR.ASP.NET and Web Tools 2012.2 includes updated ASP.NET templates for jQuery, jQuery UI, jQuery Validation, Modernizr, Knockout and other open source NuGet packages. Moreover, you will be able to publish to Windows Azure web sites from within Visual Studio 2012 with an ability to update local to remote files and vice versa.ASP.NET and Web Tools 2012.2 includes Visual Studio 2012 Page Inspector enhancements which include JavaScript selection mapping and CSS live updates. With this release, Visual Studio 2012 code editor supports syntax highlighting for CoffeeScript, Mustache, Handlebars and JsRender. Moreover, HTML editor provides Intellisense support for Knockout bindings and enables you to paste JSON as a .NET class. It also enables you to add extensibility hooks so that third-party mobile emulators can be installed as a VSIX."If you have installed an earlier version of Mads Kristensen's excellent (and free) Web Essentials 2012 extension, you'll want to update it to the latest version before installing today's ASP.NET and Web Tools 2012.2 update," says Scott Guthrie, Corporate Vice President, Server and Tools Business, Microsoft.ASP.NET Web API provides support for OData endpoints that enables you to work with rich query semantics, paging, $metadata, CRUD operations and custom actions over any data source. The release includes a new tracing functionality which enables you to diagnose problems either using Visual Studio 2012 or on Windows Azure.Moreover, the updated Web API projects now include a link to an automatically generated help page that shows how to call your web API including the display of all of your API endpoints, HTTP verbs, parameters, sample request and response messages. It is also possible to customize the help page by adding custom documentation and test client functionality.ASP.NET and Web Tools 2012.2 includes Visual Studio 2012 template for creation of SignalR projects as well as adding SignalR support to existing Web Forms and MVC applications including full support for friendly URLs with an ability to pass parameters to pages as segments of the URL. The new release also provides support of friendly URLs for mobile devices. For instance, YourPage.Mobile.aspx is the format that will be rendered by default on a mobile browser."ASP.NET and Web Tools 2012.2 doesn't change any GAC'ed (Global Assembly Cache) files. It won't mess up your install of ASP.NET or change any existing projects. It's changes are either tooling within Visual Studio, or additions and improvements via local NuGet packages," said Scott Hanselman, Program Manager, Microsoft.ASP.NET and Web Tools 2012.2 enables you to build a Facebook application with the help of a new application template and are displayed inside the Facebook chrome via an iframe. It also includes a single page template for ASP.NET MVC which enables you to build interactive client-side web apps using HTML 5, CSS 3 and the popular Knockout and jQuery JavaScript libraries. Moreover, community contributed MVC templates such as BreezeJS, Ember, DurandalJS and Hot Towel are also included with the latest release.ASP.NET and Web Tools 2012.2 delivers a new Windows Azure Authentication mechanism for MVC, Web Pages, and Web Forms, that enables your application to authenticate Office 365 users from your organization including an ability to create users in your own custom Windows Azure Active Directory domain.Steve Gentile commented that he hope to see support for an AngularJS template in the next version.

Dhana says typescript enhancements are missing.

ASP.NET and Web Tools 2012 Update


ASP.NET and Web Tools 2012 Update


Microsoft has released an update for ASP.NET and Web Tools 2012. The update adds features to ASP.NET and Visual Studio. The update will be included as part of Visual Studio 2012 Update 2, and is also available for download.
The update adds syntax highlighting within the HTML editor, so you get syntax highlighting for client side template languages including CoffeeScript, Mustache, JsRender and Handlebars.
The HTML editor also adds Intellisense for Knockout.js bindings. If you’re editing LESS files, you’ll also get syntax highlighting, Intellisense, and validation. The other editor improvement is the ability to paste JSON as a .NET class, and have Visual Studio automatically generate .NET classes inferred from the JSON.
The mobile emulator has also been improved with the addition of extensibility hooks so that third-party emulators and unusual browsers can be installed as a VSIX. This means that if you’ve installed an emulator, you’ll be able to preview websites you’ve developed on the emulated devices.
Templates have been updated in the new release. All the ASP.NET templates have updated versions of jQuery, jQuery UI, jQuery Validation, Modernizr and Knockout, though existing projects will obviously use the older versions unless you update them.
The improvements to ASP.NET start with OData support in the ASP.NET Web API. You can make use of OData endpoints in both ATOM and JSON-light formats. OData gives you support for rich query semantics, paging, $metadata, CRUD operations, and custom actions over any data source. You can read more about ASP.NET Web API OData support here.
SignalR is now included out of the box and fully supported. SignalR gives you a simple API for creating server-to-client remote procedure calls (RPC) that call JavaScript functions in client browsers from server-side .NET code. It also has an API for managing connections. The new support includes templates for creating SignalR projects, and the addition of SignalR support to existing Web Forms and MVC applications.




Web Forms have been improved with support for Friendly URLs, so you no longer need to have the .aspx extension. Web Forms also now has support for device specific pages, so when you create a .aspx page such as mypage.aspx, it can also have mypage.mobile.aspx. You can also write your own code to map a user-agent string to a specific device name.
Other improvements include an updated Single Page Application template, MVC Facebook Application Template, and the ability to work on web sites using the same publishing tools as Web Projects. This includes the ability to publish to Windows Azure Web Sites. For a good roundup of the improvements see the release announcement on Scott Guthrie’s blog.

Asp-Net-and-web-tools-2012-2-update-announced.aspx


ScottGu announced the final release of ASP.NET and Web Tools 2012.2 Update.

From his blog:

I’m excited to announce the final release of the ASP.NET and Web Tools 2012.2 update.  This update is a free download for Visual Studio 2012 and .NET 4.5, and adds some great additional features to both ASP.NET and Visual Studio.

Today’s update makes no changes to the existing ASP.NET runtime, and so it is fully compatible with your existing projects and development environment. Whether you use Web Forms, MVC, Web API, or any other ASP.NET technology, there is something in this update for you.

Click here to download and install it today! This ASP.NET and Web Tools update will also be included with the upcoming Visual Studio 2012 Update 2 (aka VS2012.2).

1. About VS 2012, Scott mentioned:

The Visual Studio 2012 editor has several improvements. With today’s update VS now supports syntax highlighting for:

CoffeeScript
Mustache
Handlebars
JsRender
2. In ASP.NET Web API, Scott wrote:

New built-in tracing functionality now lets you easily diagnose problems with Web API whether you’re running in Visual Studio or on Windows Azure. Tracing output from Web API is automatically written to the Visual Studio output window, IntelliTrace, and any other trace listener that you would like, including Windows Azure Diagnostics. The output shows the full Web API pipeline for all requests, including any exceptions or errors that occur, what controller and action were selected, model binding, the format that was negotiated, and the response.

3. ASP.NET Friendly URLs are supported now.
4. ASP.NET MVC Enhancements

5. Included in today’s release is Visual Studio 2012 template support for creating SignalR projects as well as adding SignalR support to existing Web Forms and MVC applications. Read more about SignalR at http://www.asp.net/signalr.

Unable to see new features after installing ASP.NET and Web Tools 2012.2


After installing ASP.NET and Web Tools 2012.2 I am unable to see any new features (e.g. new MVC4 SPA templates).

Initially, I installed via Web Platform Installer and after it didn't work, I uninstalled everything. I then tried installing 2 MSI individual packages mentioned in Release Notes > Installation Notes. After successful installation I am still unable to see any new features.

My platform is :

Microsoft Visual Studio Ultimate 2012
Version 11.0.60115.01 Update 2 CTP
Microsoft .NET Framework
Version 4.5.50709
Any ideas?

Clarification

I am expecting new templates to show under

New Project -> Visual C# -> Web -> ASP.NET MVC 4 Web Application (click ok) -> (shows only original 8 templates)
Thanks

asp.net asp.net-mvc upgrade breeze upgrade-issue
share|improve this question
edited Feb 25 at 23:05

Ting
636218
asked Feb 25 at 14:00

zam6ak
1,45531035
Are you first selecting "MVC 4 Internet Project" and then clicking "next"? – bUKaneer Feb 25 at 14:05
There is no "MVC 4 Internet Project" (see clarification). Do you mean "ASP.NET MVC 4 Web Application" (project) -> "Internet Application" (template) ? If so there is no "Next", only "Ok" but even so, there should be new templates at that level... – zam6ak Feb 25 at 17:05
Which SPA templates are you talking about? There should be one "SPA" template which called Single Page Application... – nemesv Feb 25 at 17:14
look at the screenshots here (there should be 10 templates instead of 8) johnpapa.net/hottowel – zam6ak Feb 25 at 17:39
1 Answer activeoldestvotes
up vote
3
down vote
accepted
The ASP.NET and Web Tools 2012.2 Update contains only one SPA template.

If you want to have the other SPA templates (like HotTowel) you need to separately install them: Know a library other than Knockout?

From Announcing release of ASP.NET and Web Tools 2012.2 Update: here are some links for the templates:

If you don’t want to use the new Knockout template there are 4 new community-created templates. These templates were built using the improved Custom MVC Template support:

BreezeJS template that uses BreezeJS and Knockout for data binding and templating
Ember template uses the latest version of Ember and Handlebars
DurandalJS template is built using the new MVVM library DurandalJS as well as Knockout
Hot Towel uses BreezeJS, DurandalJS, Knockout, require.js and Bootstrap
share|improve this answer
answered Feb 25 at 17:47

nemesv
31.4k32354
how can I tell that ASP.NET and Web Tools 2012.2 Update was installed? Should there be any version info in About or not? – zam6ak Feb 25 at 18:01
In windows > Control Panel\Programs\Programs and Features and look for the Microsoft Web Developer Tools 2012.2 - Visual Studio 2012 – nemesv Feb 25 at 18:03

What’s New in ASP.NET and Web Tools 2012.2


What’s New in ASP.NET and Web Tools 2012.2

The most recent release of ASP.NET and the supporting Web Tooling in Visual Studio 2012 packs a powerful punch for any Web Developer. In this session we’ll look at the brand new features of ASP.NET and Tooling support which enables you to build next generation Web Applications.



Bio:

Cory Fowler is a Windows Azure Technical Evangelist focusing around PHP on Windows Azure. Before joining Microsoft Cory referred to himself as a Developer as a Service and was one of the inaugural members of the Windows Azure group of Microsoft MVPs. Cory takes great pride in being both Canadian and a Ginger. You can find Cory on twitter under the handle @SyntaxC4 or read up on Windows Azure and other insightful things on his blog http://blog.syntaxc4.net.

Announcing the ASP.NET and Web Tools 2012.2 Release Candidate


Announcing the ASP.NET and Web Tools 2012.2 Release Candidate

This week the ASP.NET and Visual Web Developer teams delivered the Release Candidate of the ASP.NET and Web Tools 2012.2 update (formerly ASP.NET Fall 2012 Update BUILD Prerelease). This update extends the existing ASP.NET runtime and adds new web tooling to Visual Studio 2012. Whether you use Web Forms, MVC, Web API, or any other ASP.NET technology, there is something cool in this update for you.

You can download and install the RC today: http://www.asp.net/vnext.

Great ASP.NET Enhancements
This update adds new ASP.NET templates and features, including:

New ASP.NET MVC templates.
Creating Facebook applications just became easier using the new Facebook Application template. In just a few easy steps you can create a Facebook application that gets data from the logged in user as well as integrates with their friends.
A new Single Page Application template allows developers to build interactive client-side web apps using Knockout, jQuery, and ASP.NET Web API.
Real-time communication support with ASP.NET SignalR.  This enables you to easily take advantage of the new WebSocket support in .NET 4.5, while also automatically degrading to long-polling and other protocols for older clients.  If you haven’t tried SignalR yet you should – it is awesome.
New ASP.NET Web API functionality, including support for OData, integrated tracing, and automatically generating help page documentation for your API.
New ASP.NET Friendly URL functionality. This new feature makes it very easy for Web Forms developers to generate cleaner looking URLs (without the .aspx extension). The Friendly URLs feature also makes it easier for developers to add mobile support to their applications with support for mobile .ASPX pages and  supporting switching between desktop and mobile views. It can be used with existing ASP.NET v4.0 applications.
Visual Studio 2012 Web publishing enhancements. Web site projects now have the same publish experience as web application projects (including to Windows Azure Web Sites), and you can selectively publish files, see the differences between local and remote files, and update local to remote files or vice versa.
Visual Studio 2012 Page Inspector enhancements. JavaScript selection mapping is now supported, and you can CSS updates in real-time.
Visual Studio 2012 editor support for Knockout IntelliSense and pasting JSON as a .NET class (which makes it even easier to consume Web APIs from others).
Visual Studio 2012 Project Template updates, including the latest versions of jQuery, jQuery UI, jQuery Validation, Modernirz, Knockout and more…
How it is delivered
You can download and install an integrated setup that contains the above enhancements today from http://www.asp.net/vnext.

The new runtime functionality is delivered to ASP.NET via additional NuGet packages. This means that installing this update does not make any changes to the existing ASP.NET binaries, and thus does not cause any compatibility issues with existing projects. New projects will contain the new functionality and existing projects can be updated with the new NuGet packages.

Summary
Web development is changing, and ASP.NET is rapidly delivering new capabilities to developers that help them take full advantage of new capabilities.  The ASP.NET and Web Tools 2012.2 update installs in minutes without altering the current ASP.NET run time components. For a complete description see the Release Notes.

Next week I plan to publish a tutorial showing how to build a cool Facebook application using the new Facebook template.

Hope this helps,

ASP.NET and Web Tools 2012.2 Update


ASP.NET MVC developers, have you had a chance to try the ASP.NET and Web Tools 2012.2 (see Release Notes also) update yet?

If not, you really should. Whilst the article linked above will cover everything if you read through it, I'll just go over a few of my favourite features from it.

First and foremost, if you've already got Visual Studio, I'd recommend downloading the offline installers of the tool. You need to get the base package, and then the extension for your version of Visual Studio. The Web Platform Installer version appeared to download VS2012 Express for me which I really didn't want.

Download ASP.NET and Web Tools 2012.2 Update: First Package (Required), and then the extension for either Visual Studio 2012 Full Version, or Visual Web Developer Express.

My favourite features:

LESS Intellisense / Highlighting Support
This should be a given as to why it's made my (and probably anyone elses) favourite list. LESS is CSS, but nicer to write. It stills ends up as CSS but gives your editing and source code experience a much better feel. Think of it like TypeScript, but for styling. If you're still unsure of what it is - check out lesscss.org, the official website. The editor support is great, you get to see the converted CSS in there whilst you're typing up your LESS in a side-by-side half/half view if you also install Web Essentials 2012.

If you start writing LESS, you may want to check out my code for ASP.NET LESS Bundling and Minification.
SignalR available by default
SignalR is a cool tool for writing dynamic websites that need content updating. If you're a veteran web developer, you're probably used to using AJAX and polling for any updates. Well, stop it. SignalR does the same, and more, and moreover supports the new Web Socket technology found in all modern browsers to make things even faster (and some server side niceties!). Don't worry, it falls back to AJAX for the older browsers too.

Now that it's included with ASP.NET by default, there's virtually no reason not to use it.
Paste JSON as classes
This is cool. Really cool. Edit -> Paste Special -> Paste JSON as class. Give it a try with one of the JSON Examples if you don't have any to hand, and you'll see that it's cool. It will recursively generate strongly typed objects for each element in the JSON you provide to it. It may seem like something small, but if you're working with external APIs a lot, this is a lifesafer.
Hope you enjoy the ASP.NET updates as much as I am right now :)

Web Tools for Shift 6 – Academic Vocabulary of the Common Core


Web Tools for Shift 6 – Academic Vocabulary of the Common Core

“One forgets words as one forgets names. One’s vocabulary needs constant fertilizing or it will die.” Evelyn Waugh

In the Common Core  State Standards (CCSS)- Literacy there are six instructional shifts that are needed to effectively implement the CCSS. In this post I am going to focus on shift 6.
We can use web tools seamlessly with shift 6 to build academic vocabulary. It is important to remember even if we teach math, science, physical education; vocabulary is crucial in learning. The shift 6 – Academic Vocabulary tiers are:
Tier 1: Words we use every day such as chair.
Tier 2: Words that frequently appear across all domains and have shades of meaning such as relieved.
Tier 3: Words that have a specific domain such as photosynthesis- domain: science.
The web tools I highlight can be used in any subject and within each tier.
1. VisualThesaurus is a free mind mapping vocabulary tool that takes one vocabulary word and branches out related words visually. The students can see the different parts of speech and these are color coded. If the student spells a word wrong they offer suggestions helping the student learn the vocabulary. You can have students make their own individualized tier 2 and 3 vocabulary lists to help differentiate. You can also search for word lists, such as this general academic vocabulary.
2. Make Beliefs Comix is a free comic strip maker that allows you too create simple free comics strips. Having the students show master of a vocabulary makes the students critically think, create and communicate their knowledge. Giving them a vocabulary word such as ‘absurd’ and having them demonstrate though making a comic. You can assess mastery without a paper and pencil vocabulary test.
3. Sketch Odopod is a free web tool that you can have the students draw out their vocabulary knowledge. Having the students represent a non-linguistic approach. You don’t need to have an account unless you want to save the pictures. Here is one done on the elements of fiction and on the water cycle.
Ninjawords is a fast dictionary students told me about the other day….they love it because it gives them the definition fast. (It is an iPhone app as well)
Want to learn three more web tools for shift 6 you can use in your classroom check out this blog post, 3 Digital Tools For Common Core Academic Vocabulary by Susan Oxnevad
Please share other ways you are teaching shift 6 in your classroom so we can learn and grow together!