May 16

MacBook Pro Retina with Windows 8: projector issues

When I started my great MacBook Pro with Windows 8 via boot camp adventure, my intent was to use the machine for hosting client meetings and demonstrations while connected to a projector. Imagine my horror when the first few projectors I tried to connect to could only support a 640 x 480 screen resolution! It’s incorrect to say the projector was the limitation, as I had other laptops available to me that could output higher resolutions to the same projectors.

The MacBook Pro only has HDMI, or mini-DisplayPort ports (Thunderbolt actually, but it supports mini-DisplayPort) available for outputting the video. Sadly I’m yet to find a projector (in use) that supports HDMI in, so of course the tried and tested VGA cable gets a workout. To connect to these VGA cables I had purchased the official Apple adapter for the Thunderbolt port to convert to VGA. This was the beast that only allowed me to output 640 x 480 under Windows 8 though. I have a colleague who uses the same adapter under OS X and it works at much higher resolutions – no good for me, my work was in Windows.

After some research (sadly now which I’ve lost the link to), I found out there is apparently a concept of an active adapter and a passive adapter. The official Apple one was passive only, but it works fine in OS X because the OS handles it. Windows isn’t as aware of this adapter. I found an alternative adapter which was cheaper even with shipping and I’m happy to report it works a treat. I even managed a 1600 x 900 resolution on one projector over a VGA cable.

The alternative adapter can be found here: https://dx.com/p/mini-displayport-male-to-vga-female-adapter-1080p-27603

Permanent link to this article: http://blog.craigharvey.me/2013/05/16/macbook-pro-retina-with-windows-8-projector-issues/

May 14

CRM Advanced Find – Related entities missing

In Dynamics CRM 2011 you can create a Many to Many relationship between entities. This is great for associating entities to multiple reference data items – for example Projects to Project Locations, or Orders to Products.

When you go to filter an Advanced Find by this related entity you may find that it is missing. You need to ensure when you create the relationship that you set the Display Option both sides to Visible – as by default they will be created as Do Not Display.

For a more detailed explanation with images, check out this post from Allan Varcoe. As Allan points out, this automatically creates a new item in the Forms navigation pane which might not be what you want. This can be manually removed by customising the form navigation and publishing.

Permanent link to this article: http://blog.craigharvey.me/2013/05/14/crm-advanced-find-related-entities-missing/

Feb 01

Sir Tim Berners-Lee

Today I was fortunate enough to see Sir Tim Berners-Lee deliver a talk at the Linux Conference in Canberra, Australia. Sir Tim is best known as the genius who invented the World Wide Web. If you don’t know the difference between the Internet and the World Wide Web then the rest of this post will probably be above your head.

Firstly I never realised how fast Sir Tim speaks. The acoustics of the hall where we were made it hard to follow what he was speaking about, that and the fact that he is first and foremost a brilliant computer scientist, not necessarily a public speaker. I felt like I was in the presence of someone who had forgotten more about programming than I would ever know.

Generally the topics he covered were JavaScript, developing Web content to cater for different platforms and Aaron Swartz.

I didn’t follow all the detail of what he meant about JavaScript, other than he seemed pleased that there are frameworks like jQuery and node.js in existence. It appeared that there trend toward making JavaScript a more first-class citizen regarding programming languages meets with his acceptance.

He also spoke about how he would like to see people steer away from walled content in native platforms such as phone apps, and to keep the focus on responsive web content that caters for different devices. Examples of the problems he gave with phone apps that deliver content which could just as easily be pure web content were problems with not knowing the URL of a page of news content and therefore being unable to share it, comment on it or do anything else useful. Of course there needs to be web content on phones and that is the point – keep it to web content, stop making apps that merely repurpose web content and hobble it. I agree with this wholeheartedly. Of course it makes life more difficult for web developers, but so be it.

Sir Tim also spoke at length about Aaron Swartz who committed suicide recently. Sir Tim had met Aaron when Aaron was only 14 and recognised what a brilliant young mind he had. The short version of the story is that Aaron was an internet activist who was arrested and charged with federal charges after the US Secret Service pursued the case where he was accused of downloading content from JSTOR – a system that has archives of journals, manuscripts and more. I believe the problem was how he accessed the MIT network to perform this feat.

Aaron was facing up to 35 years in prison, something which was majorly disproportionate to the crime he had allegedly committed. There are plenty of better descriptions of the sad story all over the Internet so that’s all I will attempt to describe. What was interesting was that Sir Tim had been preparing to testify in Aaron’s defence and so he had obviously been troubled by the whole case and what he hadn’t been able to say as the case was set for February 2013. Sir Tim basically rammed home the point that the legal system was written before the Internet age and relies upon the wisdom of the prosecution to know which cases should be pursued and which shouldn’t. Sadly that didn’t happen in this case.

But it wasn’t all sad and gloomy. Sir Tim was funny. And at the end of the seminar he was asked questions from the audience via Twitter and microphones positioned in the hall. The thing that cracked me up the most was that he was asked by someone what he thought about the inherit security problems in TCP. His response was just 3 words: “Not my layer” which is hilarious to anyone who knows anything about networking. All those years at university learning the OSI 7 layer model paid off for me.

And the last question was about his opinion of the <blink> tag which was overused throughout the early days of the WWW. His response (not verbatim): “It sucked then, it sucks now and it will suck in the future”. Great stuff.

Permanent link to this article: http://blog.craigharvey.me/2013/02/01/sir-tim-berners-lee/

Jan 19

CRM 2011 and SharePoint 2010 integration

The out of the box integration between CRM 2011 and SharePoint 2010 / 2013 is one of those features that has a lot of potential, but it doesn’t fully deliver. It feels like a feature that is on the checklist of every prospective Dynamics CRM customer and so something minimal was thrown in by Microsoft to satisfy marketing needs.

“Hey look, we have CRM 2011 and SharePoint 2010 integration, out of the box!”

Well yes you do, but it’s a bit limited. The functionality it provides is:

  • From the CRM user interface a user can create a folder in a SharePoint document library on demand, on a per record basis.
  • SharePoint is iFramed into the CRM user interface in a neat way that simulates the look and feel of CRM 2011. An important part of this is it strips away all the normal page navigation and chrome and just shows the documents in that folder. 
  • The name of the folder is the name of the record at the point in time of creation – if the record gets renamed, the SharePoint string remains the same. This may be confusing – particularly if your user found the SharePoint based content through a different means, such as Enterprise Search.
  • CRM can be configured to have one or more document libraries per record. So in theory you could have two document libraries configured for one entity and provide different security or content types. It would be a clunky user experience though.

 

Things that I’ve found are commonly requested features in this area of functionality that are not part of the out of the box experience:

  • Common (or at least synchronised) security settings
  • Use of content types – and possibly different content types per entity type
  • Control over what gets created in SharePoint – i.e. using Document Libraries instead of a folder
  • Scalability issues – using different Site Collections depending on the number of sites already created
  • Control over how the SharePoint location is named – e.g. using a Customer ID for the URL and / or Title.
  • Creating the SharePoint location programmatically instead of ‘on-demand’ through a UI interaction. For example, you could be creating a record via a web service call and also want to save content in the associated SharePoint location.

 

This blog post provides a great walkthrough of how you would go about developing a CRM plugin that takes care of the creation of the SharePoint content. It is a great starting point if you want to customise what happens. In a nutshell it still relies on the SharePoint destination still having the CRM List Component installed so that the UI for SharePoint is styled correctly, but it takes control of the SharePoint creation side of things through a server side event in a CRM Plugin. This means that you can control what, where and when things happen in SharePoint. But you get the benefit of the native display of SharePoint content in the CRM without having to come up with your own SharePoint iFrame friendly view.

I would probably take the SharePoint creation logic out of the Plugin and put it into a callable web service, but you’d still have to call this from the Plugin. Within this web service you could then examine the existing number of folders / libraries / sites you’ve decided to create and determine if your container is reaching it’s limits and you need a new container, and also the web service could potentially be called from other systems.

But if you’re looking to enhance the integration between Dynamics CRM 2011 and SharePoint 2010 / 2013 then that blog post is definitely a great starting point for your development team to get their head around.

Permanent link to this article: http://blog.craigharvey.me/2013/01/19/crm-2011-and-sharepoint-2010-integration/

Oct 16

Save photo attachments from Gmail into Google+ photo album

One of the good features of Google+ and Android is the ability to automatically upload photos from my phone. Recently I had some photos taken with my phone that I wanted to supplement with some photos my wife took on her iPhone.

I created an album with my photos – nice and easy. My wife emailed me her photos individually. I could see these in my Gmail account – but how to easily combine these additional ones with the album I had already set up?

A manual way would have been to download these individually to my local computer and then re-upload them. Not very cloudy.

The clunky work-around I found was to:

  • On each attachment click ‘Share’ which started to create a Google+ post.
  • Cancel this post after the progress indicator animated GIF went away
  • Go into Google+ – I could now see these photos in an album called “Photos from posts”
    • From here I couldn’t work out how to amalgamate these into the original album
    • The photos are not technically shared because I hit ‘Cancel’ above
  • Now head over to Picasa web albums and from there you can ‘Organize’ these albums and move the photos one by one into the original album.

This is pretty clunky and relied upon me knowing that I could manipulate these photos through Picasa web albums.

To make life easier it would be awesome if the Gmail ‘Share’ functionality was supplemented with functionality to ‘Save to Album’, and the Google+ ‘Photos from Posts’ area allowed you to move photos more easily.

Permanent link to this article: http://blog.craigharvey.me/2012/10/16/save-photo-attachments-from-gmail-into-google-photo-album/

Oct 16

JB Hi-Fi NOW Review

When I got my Samsung Galaxy Nexus from JB Hi-Fi I got a complimentary 12 month subscription to their NOW music service. I’ve used it on and off for a few months and thought I’d write review.

Overall it is a pretty good service but it has some rough edges that make the experience painful at times. The service is a music streaming website that also has apps available for iOS and Android. It appears to only be available in Australia and this seems to be validated by your mobile number having to be your username. I’m not sure how this is validated to be your actual number, I don’t recall any confirmation SMS or anything upon registration.

With over 9 million songs from 250,000 artists it sounds like a pretty comprehensive catalogue when you hear those numbers. For comparison Spotify has 18 million songs according to Wikipedia. It’s safe to say that if you’re into mainstream music you should be happy with either offering.

There are essentially two sides to this review – accessing it from a PC and accessing it from a Phone.

Accessing from a PC

This is a browser only affair and the UI is slightly confusing. Being browser based means that there is no way to use keyboard shortcuts to start / pause playback and skip songs. I use this feature a lot with Winamp with my local music collection. So if I don’t like the next song playing I have to make the web browser tab with the NOW service my main focus and skip the song with a mouse. Not the end of the world but it makes it hard to compete with other services. However from an implementation point of view I’m sure this approach makes it easier to support many platforms!

Apart from that the music seemed to stream quickly and I never suffered any dropouts or jittery playback – I am on a pretty decent ADSL2+ connection that can get about 18-19Mbps download according to Speedtest.net.

Accessing from a Phone

So of course this was from my Android 4.1 Jelly Bean Galaxy Nexus. I found the app to be quite painful. Overall it gets the job done, but it seems to suffer from lag or unresponsive UI. Several times you would press a button and nothing would happen. This wasn’t just when trying to play songs it seemed to happen throughout the app.

The app has some settings including the option to determine if you want to only play music over WiFi or over both mobile data connection and WiFi. Of course I opted for both!

On Telstra NextG the streaming of songs seems to work pretty quickly. Sometimes there is 5-10 seconds before a song would start and this annoyed me no end and is why I dislike streaming services like this. If only I could have these songs offline…

Well the app supports offline synching of songs – but it took me at least 20 attempts to get this to work. I had previously loaded up a playlist of songs and attempted to sync them for offline use but to no avail. So I trimmed the playlist down and then tried synching again. Finally some action and it started to work – but with all the previous songs I had elected to make available offline also. I couldn’t work out how remove these from the ‘offline’ world to prevent them being synched in the first place. And synching seems to be a foreground activity only – if you navigate to something else then synching appears to stop and you have to come back in an trigger it to work again.

And just take a look at this screenshot of the app playback screen below.

Screenshot_2012-10-16-17-05-25

Ignore the terrible playlist and tell me the difference between the blue progress bar at the top and the yellow progress bar below the playback controls. The answer is the yellow is for the app volume and the blue is for the progress of the track. Why does it even need app volume?

Above the playlist there are two tiny icons for repeat and shuffle. Icons, not buttons. You enable these settings via the cog icon towards the bottom right. Maybe these icons are buttons, but my fingers are too fat to click them without clicking the song.

The music player responded to me hitting ‘next track’ on my car stereo when paired via Bluetooth which pleasantly surprised me. But there are no lock screen controls. So if I am listening at my desk and want to skip a track, I need to unlock the phone and make the app the foreground app and press the button. That sucks, and could be improved to be more like the native Music app.

But the biggest offense was not stopping playback when I remove my headphones from the jack. Doing this keeps the music playing on speak which sucks the big one if you’re in an office environment. Especially if you have to then unlock the phone, make the app the focus and them frantically jab the pause button.

The other downside to the app is that it is a walled garden of JB Hi-Fi only content. I can’t use the same app to play NOW content and my local music files which is a shame. Likewise I see now way to pair up my existing local files with the cloud based equivalent to give me a larger playlist / collection like the Google Music app allegedly does. I say allegedly because it’s not available in Australia.

 

Conclusion

This is not a bad effort and if the rough edges outlined above could be improved then it could be a solid service. I don’t see how JB Hi-Fi are going to compete long term with the likes of Google Music, the new XBox Music offering, or iTunes + iCloud, Spotify or even the new Bigpond backed Mog. There’s a lot of competition and the bigger your budget the more effort you can put into your apps. The JB Hi-Fi NOW offering is better than I expected but might still fall short for some people.

Permanent link to this article: http://blog.craigharvey.me/2012/10/16/jb-hi-fi-now-review/

Oct 15

Windows 8 – two months on

So I’ve been using Windows 8 RTM for 2 months now, it’s probably a good time to reflect.

 

Prior to installing Windows 8 I had grave reservations about the Metro UI. While I was keen to try I knew that it was going to be a disruptive user experience until I got used to the new world order. I thought Microsoft were mad for trying to have a unified experience across PCs, tablets and phones. The goal of trying to have developers only write code for one platform and have it available across all those screens was noble but the cost was going to be in the user experience.

 

In the end I think I am partially right, but I don’t think it is a showstopper for Microsoft. Plenty of people have predicted doom and claim Microsoft are making a huge mistake. I don’t think things are that drastic – and mainly because I bypass the Metro world with a simple keystroke.

 

My way of explaining this is that there are essentially two worlds in Windows 8 – the Metro world with it’s magical scaling (which looks great on a Retina MacBook Pro!) and own Apps that are available from the Store. And then there’s the desktop world with it’s good old ‘normal’ applications. The Metro world is where you’re going to spend your time if you’re on a Windows 8 phone or a tablet. I just don’t see it making a lot of sense if you’re on a PC or laptop. Even with a touch-enabled laptop I don’t see it being a drawcard.

 

I spend most of my life in the desktop world that Microsoft is trying to move us away from. As soon as the Metro screen pops up I hit the Windows key + D and go straight to the desktop world. Which for me makes the Metro experience pretty pointless. And without that, what benefits are there over Windows 7?

 

Well the following are also pretty good to have:

  • Pretty streamlined setup process (but how many times do you install Windows?)
  • Much faster boot time
  • Windows Defender on by default and now includes anti-virus
  • Improved ‘progress’ dialog for copy operations and Task Manager
  • Native mounting of ISOs
  • Windows key + X – brings up power list of things you want access to
  • Hyper-V on Windows Pro up (if that’s your thing)

 

As for the lack of a Start button? Just hit the Windows key and type – exactly as you did before. No big drama there.

 

To be clear I spend most of my time in the desktop environment because the day to day applications I use are there – Outlook, Word, Visio, Chrome etc. Yes I can get Chrome in the Metro world but to my knowledge you can’t run extensions. No Ad-Block Plus? That’s a shitty way to view the web!

 

Living in the desktop world isn’t always plain sailing – for example, a PDF reader is included out of the box but this is a Metro app. So double-clicking on a PDF file in Windows Explorer opens this up in full-screen glory. Looks nice and distraction free for reading the PDF, but confusing for a user who now can’t see the taskbar or work out how to exit.

 

Without a touch enabled laptop a lot of the context sensitive menus / commands require a magical mouse movement. This is kind of like foreplay – when you get it right it’s awesome, when you get it wrong you fumble around and end up pissed off and feel inferior.

 

You end up having to manage two worlds – do I want to use the Metro Evernote app, or the full-fledged Evernote application I was using in Windows 7? Using Evernote as an example I found the Metro app to be basic and had less features. I could wear this if the device was a phone or tablet, but why would I want to use this over the normal desktop application? These Metro apps will get better with time I’m sure.

 

Overall Windows 8 is pretty good – kudos to Microsoft for making a bold new move and trying something different. I don’t think it will be the disaster that some people claim it will be, but I can see Windows 8 ending up in Vista territory – it will cop enough bad press from disgruntled users to scare off organisations from upgrading until it improves. Windows 7 is a pretty slick operating system, if an organisation is on this and primarily only using desktop / laptop PCs I cannot see a compelling reason for them to upgrade. Let’s see how things go later this month when it becomes generally available.

Permanent link to this article: http://blog.craigharvey.me/2012/10/15/windows-8-two-months-on/

Oct 07

Life with a MacBook Pro – 2 months on

It’s almost 2 months since I decided to purchase the new MacBook Pro with Retina display to run Windows 8. Time to take stock and see how that is working out.

I am still a big fan of the hardware and think it’s a great laptop. Performance has been fantastic for me in terms of:

  • Boot time
  • Copying files (for example VMs)
  • Launching and running applications

 

The main niggles I’ve had appear to be related to Windows 8 – although I’m sure some of it is the combination of Windows 8 and this specific hardware. Hopefully some of that dies down as the drivers get updated for various bits and pieces. Specifically I have problems with the machine sometimes not sleeping or even shutting properly – it ends up getting really hot and the fans are going nuts, requiring me to press the power button to really turn it off.

 

I use a Logitech Bluetooth mouse which now works flawlessly after I fiddled with the Wireless card driver settings. The track pad supports basic gestures in Windows, but nowhere near as complete as OS X does. I can get a good 4 – 4.5 hours of batter life out of the machine running Windows. I could probably get 9-10 hours running OSX but I’ve never had to push it that far.

 

I really do live in Windows (installed via Boot Camp) for the majority of my time. It’s just where my computing life lives – Visual Studio, Outlook etc. I have no compelling reason to make OS X my primary operating system and then use VMWare Fusion or Parallels Desktop to get the Windows things I need. I did try those setups, but for me the most comfort came from running Windows primarily.

 

I’ve realised I’ve become a hardware snob. I noticed that when I used my wife’s Toshiba laptop, or a colleague’s Dell and realised how ‘plasticy’ those machines were (to be fair neither are high end machines). And so looking down upon this hardware from the snooty pride of owning a MacBook Pro my transformation was complete.

 

The display is great and I run Windows with the maximum resolution of 2,880 by 1,800. To be fair, lower than this and things seem fuzzy. To compensate for the ridiculous small text I run a DPI of 150%. Sometimes this comes unstuck with dialogs in programs (usually setup programs) not catering for the different DPI setting properly. The Windows 8 metro world works flawlessly with this screen resolution, it’s only the desktop world that has hiccups. Usually the quick workaround is to just adjust the resolution.

 

Another winning factor for me is the weight – 2 kilograms is about the weight limit of comfort when carrying this thing around between buildings as I walk around. Of course anything lighter would be better, but I’ve never stopped and thought ‘this thing is too heavy, I should get my backpack’.

 

I ended up buying and applying a Wrapsol cover for the outside and the top surface below the keyboard to avoid scratches and marks. My inner critic was shouting “See, you’ve bought into the vanity of ‘beautiful’ products!” and is probably right, but this machine will last me a while and I would like to be able to re-sell it one day.

 

Overall I am happy. I’m just looking forward to improvements in hardware drivers which will hopefully see some of the niggly inconsistent issues go away over time. That is the price I pay for being bleeding edge at the moment using a product that is RTM but not generally available.

 

So if you’re looking for kick-arse laptop that can pack enough RAM and with a high overall build quality, it is worth checking this out.

Permanent link to this article: http://blog.craigharvey.me/2012/10/07/life-with-a-macbook-pro-2-months-on/

Sep 14

TechEd – Application Hosting Models in SharePoint 2013

Shyam Narayan (@dotnetbounce), a Microsoft Premier Field Engineer took us through the approaches to application hosting in SharePoint 2013.

 

Application Identity models in SP2013

  • SP2010 provided two models for custom code – Full Trust and Sandboxed
  • Apps in SP2013 now have their own identity
  • Fine grained permissions can now be configured – analogy of the app on your smartphone asking for specific permissions

 

Example App:

  • Site Collection – I want Full Control
  • User Profiles – I need Read access to this
  • Taxonomy – I want Write access to this

 

App Hosting Models

  • SharePoint Hosted
  • Auto Hosted
  • S2S

SharePoint Hosted Apps

  • Custom code or solutions you’ve built that get provisioned and hosted out of SharePoint.
  • Completely hosted within SharePoint or iFramed in
  • Only client side scripting supported - no server side code
  • Isolated web created to host the app
  • SharePoint artefact provisioning supported via CAML
  • Data storage location – Content Database
  • Supported in On-Premise and SharePoint online
  • Cannot write feature receivers in this model
  • Remote event receivers are the new way for doing this – a callout to a remote web server

 

Client Side code – the object model (CSOM) is now RESTful and includes full server side API access. You can access all these services:

  • User Profiles
  • Search
  • Taxonomy
  • Feeds
  • Publishing
  • Sharing
  • Workflow
  • E-Discovey
  • IRM
  • Analytics
  • and more…

 

Then there was a Visual Studio 2012 based demo.

  • You can now write code off a SharePoint box (round of applause from the room), no longer need to be writing code on a SharePoint server itself.
  • AppManifest.xml is where you manage permissions requirements for your app.
  • Consists of Scope, Permission, Properties – see http://msdn.microsoft.com/en-us/office/apps
  • You can still provision lists and libraries declaratively
  • App deployment is essentially XML files being provision to SharePoint
  • Even external content types can be deployed declaratively – the example was a data source from Netflix
  • Need to configure the farm in Central Admin to support app provisioning
  • New service application – the App Management Service, also need the SharePoint Foundation Subscription Settings Service (enables multi-tenancy).
  • Also need to ensure the Settings Service Application has been provisioned
  • Apps get a DNS style prefix – needs DNS wildcard configuration for the main domain and then SharePoint will resolve the requests for the app name.
  • For example http://appffgfgfg04343.app.wingtip.com

 

 

Auto Hosted Apps

  • The Office365 app hosting model – not available in on-premise
  • Leverages integration between Office365 and Windows Azure
  • Leverages Azure Web roles and SQL Azure
  • Auto Provisioning of Azure components
  • Really easy to build locally and then deploy to the cloud – all the configuration settings are handled for you behind the scenes
  • Leverages ACS (Access Control Services) as the app identity broker. Think of it as ADFS in the cloud
  • Visual Studio F5 deployment to the cloud

 

OAuth – Interaction

  • Request comes from Browser to SharePoint
  • Gets bounced off to ACS
  • ACS returns a context token to SharePoint, which is returned to the Browser
  • Gets routed via o365apps.net
  • 3 key tokens
    • Context Token
    • Access Token
    • Refresh Token
  • This is only for the App authentication, not authentication of the user

 

S2S

  • For on-premise development
  • High trust applications behind the firewall
  • Can assert any user’s identity
  • Requires configuration to establish trust between SharePoint farm and S2S app
  • Needs to be done for every app you run / deploy

 

Configure S2S – challenging to get right.

  • App Isolation needs to be configured
  • Disable App Pool Principal check (set value to 0)
  • Generate Public / Private certificate pair
  • Generate Client Id
  • Set up Security Token Issuer
  • Register App Principal
  • Update Web.Config and ensure user profiles exist

 

At this point in the session I am feeling that the new way forward for app development in SharePoint is looking mighty complicated. They’ve obviously done a lot of work to make the cloud stuff smooth, but for on-premise stuff it seems pretty clunky and complex. And looks nothing like what came before it in SP2010. Hopefully I’m just having a brain fade and it’s not that hard – but coming right after the responsive web apps session this SharePoint content seemed pretty jarring.

 

http://dev.office.com

http://blogs.msdn.com/b/shyam

 

 

 

 

 

Permanent link to this article: http://blog.craigharvey.me/2012/09/14/teched-application-hosting-models-in-sharepoint-2013/

Sep 14

TechEd – Building Responsive Web Applications with MVC4, WebAPI and HTML5

This session was presented by Brendan Kowitz (@brendankowitz) a Senior Developer from Readify and covered building responsive mobile web applications with MVC4, WebAPI and HTML5.

 

Overview

  • Building a great user experience
  • Data + WebAPI
  • Going offline
  • Packaging

 

Why responsible mobile web applications?

  • Responsive, fluid usage, respond to online and offline events
  • Interact with device hardware and storage to create a personalised experience
  • Build and package for app stores across platforms

 

Why responsive web applications?

  • Best of desktop smart-client apps
  • Combined with the very latest and best of the web.
  • Great for enhancing web sites

 

Responsive options (or maturity model – my analogy)

  • Do nothing – just add the mets viewport tag <meta name=”viewport” content=”width=device-width” …
  • Adaptive layout – CSS3 media queries (same HTML for all clients)
  • Adaptive rendering – tailored HTML for different devices
  • Responsive client-side apps – the goal

 

Common client-side patterns for organising JavaScript libraries

  • Module pattern
  • Namespaces (MS AJAX toolkit)
  • MVC (Spinejs, Backbonejs, JavaScript MVC
  • MVVM (Knockout, WinJS)

 

Knockout - http://knockoutjs.com/

 

Responsive UI toolkits

  • jQuery UI + jQueryMobile
  • Telerik’s Kendo UI + Mobile
  • Twitter bootstrap

 

HTML Form elements

  • Use browser and device native features whenever possible
  • Input types – e.g. number, email, url, data should be used
  • Use Polyfills to broaden compatibility
  • Modernizr library - http://modernizr.com/

 

Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.

 

Structuring responsive apps requires thinking different – need to allow for the fact that the underlying connection the user is using may be transient,

Application composition

  • Using libraries in your page
  • CommonJS specification
    • RequireJS
    • Node.js (Modules/1.0)
  • Script Loaders (load scripts in paralle)
    • YepNode
    • Yabble

 

MVC4 WebAPI - http://www.asp.net/web-api

  • Great for building convention based REST APIs
  • Great support for JSON, XML data types

 

Working with Async

 

Cache manifest - http://en.wikipedia.org/wiki/Cache_manifest_in_HTML5

  • Tells the client which elements to cache
  • Leverage MVC4 to programatically build this

 

Using Localstorage

  • Under the HTML5 group of technologies
  • Access can vary based on privacy settings on the device
  • Limited stooge – varies per device, generally 5 to 10 MB but no guarantees
  • Available in PhoneGap (after device ready event) - http://phonegap.com/

 

Bundling and minification

  • System.web.optimisations
  • Node.js tools:
    • Require.js optimiser
    • Stackservice Bundler

 

Node.js – if you don’t have it, it’s time to download it: http://nodejs.org/

 

 

Source code the Tiny Contact Manager demoed in the session.

http://tinycontactmanager.codeplex.com
This session was pretty good, but made me realise how far things have come since I was last writing code on a daily basis, plenty of progress. Lots to catch up on!

Permanent link to this article: http://blog.craigharvey.me/2012/09/14/teched-building-responsive-web-applications-with-mvc4-webapi-and-html5/

Older posts «