Friday 28 January 2011

Writing Windows Phone 7 Applications

Overview:  Windows Phone 7 (WP7) was released in the end of October 2010 on the HTC Mozart, Samsung Omnia 7 & LG Optimus 7 in the UK.  WP7 apps are written in .NET and based on Silverlight or XDA.  As a C# enterprise developer I always use Silverlight as this is for Rich Internet Applications (RIA).  Microsoft XDA is for games development.

Tooling:  Microsoft have great free tools such as expression blend and Visual Studio 2010 express for WP7.
There is a single download for all the tools including the Windows Phone 7 emulator.
VS has dedicate template for the WP7 in VS2010 that are a good starting point.
There is Intelisense and full debugging integration with the WP7 emulator.
Xaml is responsible for the UI and it's pretty straight forward especially if you have done ant Silverlight development previously.


Training: Microsoft have done a great job on providing getting started examples and video learning via Channel 9.  It really can't be simpler.  Take a look at Channel 9's Windows Phone 7 Development for Absolute Beginners.

More info:
Updated 25/02/2011 - SharePoint integration with Windows Phone 7 by B.K. Winstead 

Thursday 27 January 2011

Information Architecture for SharePoint

Overview: I was speaking to a client recently about there SharePoint Intranet and I mentioned they should have a Information Architecture (IA).  This should preferably be done by an Information architect but at a minimum the organisation can get the IA from project stakeholders.  Below I list the 2 most commonly found IA representations approaches: Wireframes & Hierarchy/structure diagrams.

What is IA?
Wikipedia define IA as "Information architecture is the categorization of information into a coherent structure, preferably one that most people can understand quickly, if not inherently. It's usually hierarchical, but can have other structures".
For web based projects, the best 2 methods for defining IA are a hierarchy and a wireframe other useful tools are defining the taxonomy against the hierarchy IA diagram.  I have seen various techniques to achieve this but keeping it simple as listed below and having a separate annotated version defining the term set or formal business taxonomy at each level is useful.

Hierarchy IA Diagram
WireFrame
Read More:
http://www.informit.com/articles/article.aspx?p=1657659

Update 23 April 2011 - I have seen people looking for a starting point for an Intranet Menu structure, this is a generic option I propose for Intranets.  Please feel free to suggest your own structure.


Wednesday 26 January 2011

Smartphone Development

Overview:  Over the past few days I have been looking at writing apps for the Windows 7 Phone & an iPhone app and I thought I would share my findings.

Development for all smartphones is done at the browser or application level.

Browser development is usually a subset of xHtml and there are issues such as on Safari using an iPhone does not supporting all the html elements and attributes of XHTML.

Application Development Run Down:
  • There are 5 big players in the smartphone OS market (palm is not 1 of them).
  • Microsoft have entered the smartphone industry with there OS "Windows 7 Phone".  Windows 7 phone is going to gain a large marketshare in the app store market.
  • Application development is big business and iPhone has had over 10 billion downloads already i.e. more downloads than people on the planet.  The app dev platforms I'm interested in are iPhone(iOS), Windows 7 Phone, Android and blackberry/RIM.
  • The smartphone market is shared between Symbian (Nokia and previously others), Android, Windows 7 Phone, Blackberry (RIM) and iPhone (iOS).
  • Symbian/Nokia sells the most smart phone units by a long way however, they don't have a nice sales and developement market for 3rd party application market like the iApp from Apple.  Additionally, users don't tend to use alot of apps or surf as much as say an iPhone or Blackberry.  Symbian may support Silverlight going forwards so from an RIA perspective this would make it pretty simple to develop and could help achieve better apps with more app writers. 
  • Android has multiple hardware manufactures that use the OS and it is owned by google, app development runs on Java and there are multiple programming languages for developing apps.  It has a open store, the OS is widely used and is a very good option for mobile developers to explore.
  • Blackberry/RIM use to be the enterprise smartphone of choice it is still a market leader but with stiff competition, it is still growing quickly in units sold (as the smartphone market grows at about 35% year on year) but it appears to be loosing market share.  This is definitely a platform you can't ignore as a mobile app platform.
  • iPhone, only Mac builds phones for iOS (not Cisco OS).  It has huge market share and the impressive consideration is the number of apps and surfing people that use iPhones accounts for.  iPad, iTouch also use iOS.  This post assumes iPhone is the only smart phone from Apple. iOS is an extremely important platform and is my 1st choice of platform to target.
  • Windows 7 Phone is going to get popular especially as there are alot of .NET and silverlight developers that can easily adapt to the Microsoft Windows 7 phone platform.  Tooling for developers is good and free.  The app store is easy to use so this has to a big player for the future.  In the short time MS have released Windows 7 phone, manufactures like Samsung and LG have sold alot of smartphone units with the Windows 7 Phone OS.
Original Source: Wikipedia 26 January 2010
Update: 11 Feb 2011 - Microsoft and Nokia have an agreement to win market share in the smartphone market.  This looks like good business for both parties.  Nokia is loosing ground and doesn't have a decent platform.  Microsoft have a great platform but no market share.  With Nokia's distribution and Microsoft playform/devlopers it looks like agreat match.   BBC news article.

Update 3 March 2011 - Apple has now sold 100 million iPhones as of Feb 2011.  15 million iPads where sold in 2010.

Monday 24 January 2011

SharePoint certification exam thoughts

Overview:  I passed the 70-667 exam on Configuring SharePoint 2010.  This exam looks at installing, upgrading, deploying applications, environment menagement and basic configuration of SP2010.

Thoughts:  The exam is probably the easiest of the SP2010 certification exams I have taken so far but I scarcely  passed.  It's pretty easy passing MS exams if you use brain dumps, I downloaded a brain dump for this paper and it almost identical to the actual exam.  As a certification I think these exams don't prove the person knows SharePoint.  If a candidate for a job has experience and could be bothered to write the exams you probably are getting some degree of confirmation they know SharePoint 2010.

Personally I enjoy taking the exams to test my knowledge. It helps me identify SharePoint topics/areas I don't know well enough and it broadens my knowledge on areas within SP2010 I don't use regularly in my job. This improved my knowledge/diversity giving me better options for solving my clients solutions.  I think most people tend to use what they know well to solve problems.  Being a developer I tend to choose code as my preferred method of achieving a goal when it isn't necessarily the best option.

Microsoft offer a free retake on all their exams until the end of 2011, this is a good thing as it encourages me to do the exams without a brain dump as if you do fail it is a waste of £88.  The exam special also includes a discount for buying multiple exams.

70-573 & 70-576 Dev exams blog post

Thursday 20 January 2011

SharePoint for small companies - A Small server farm solution

Overview:  Today I met a small company looking to put in SharePoint 2010, I was surprised at the requirement for 35 users but after some review I realised such a small user base provided they are heavy usage information workers could get great benefits out of SharePoint.  BPOS is to limited and I think SharePoint 365 will be a better option but as it still in restricted public beta and therefore it's not an immediate option. 
Problem: The client needs a solution for an Intranet, collaboration and replacement of drives, phase 2 would be a couple of applications such as a new simple CRM and MySites.
Initial Hypothesis:  I refuse to put SQL on the same server as SharePoint.  Using Windows 2008 R2 I want to run SP2010 on the virtual machine, I would put SQL Server 2008 R2 on the physical machine.  This allows for a fairly easy upgrade and the ability to backup and restore data the farm.  Only 1 windows standard licence is required for the VM and the physical SQL machine.
SQL Server can be licenced in 1 of 3 methods namely: 1) per processor (most common), 2) per server plus user cals or 3) per server plus device cals.  If you use option 2, you can use multiple processors and get performance increases.  However, you need to buy additional CAL's at +-£85 each as new users join.  SQL Server Standard Edition is preferable to the SQL Server 2008 Express edition.
SharePoint 2010 needs to be for internal users only, the question is between using the paid for Standard edition or Foundation server.
Resolution: SharePoint standard edition has features that will help the client however they are leaning towards SharePoint 365 ASAP.  I recommend 1 single server containing 8GB of RAM x64 that supports hardware virtualisation.   Windows 2008 R2 standard edition will be installed on the physical server.  A single virtual machine hyper-V instance will spawn up for the SP2010 software.  SP2010 foundation will be used in the discovery phase with 4GB of dedicated RAM.  The SQL Server database could be the express edition but as the threshold is 10GB per database, really to small so the web or workgroup SQL Server editions are better but will have additional licence costs associated.  Standard edition is more common however, you do need Enterprise edition for features such PowerPivot, remote blob storage, backup compression.

Summary: You get no resilience on the small farm's discussed but there are options and each can easily be built upon at a latter stage. This approach also lends itself to disaster recovery using VM image, Acronis base image and SharePoint farm backup.

More Info: Updated 23 March 2011
SP2010 edition comparison for search
SP2010 edition comparison for composite/applications dev
Licencing calc tool

Wednesday 19 January 2011

Timesheet solution for SharePoint 2010 - Part 4 Application setup guide

Part 1 - Design & data storage 
Part 2 - Building the UI
Part 3 - Installation Steps
Part 4 - Final Part (This blog post)

Overview: Once the Timesheet wasp is installed, the new Timesheet database and the web.config changes have been made as described in Part 3 (Timesheet Installation), you need to add pages for users to input there timesheets and administration.  You will need to create at least 1 client, 1 project and add a person to a project before you can submit timesheets. 

Add pages to the Timesheet application within SharePoint 2010:
I create a "new publishing site" called "Timesheet" with the following url http://intranet.dev/timesheets/Pages/default.aspx.
I then added the following web parts to the page:
All the web parts are connected web parts (To connect the web parts, when the page is in edit mode,click the button to edit).
Create the popup page that is linked to on the page just created.
Ensure that the "New task" & Edit task links are working.
Create a new Administrators page, add the "Admin - Main" web part to the page.
Check the following 3 web.config settings and create the appropriate pages, each page has 1 web part as shown below.
Ensure all the popups work from the main administration page.

Part 1 - Design & data storage 
Part 2 - Building the UI
Part 3 - Installation Steps
Part 4 - Final Part (This blog post)

Monday 17 January 2011

Timesheet solution for SharePoint 2010 - Part 3 Installation

Overview:  Download the visual studio 2010 solution.  This contains the code to implement the timesheet application within SharePoint 2010.  The instructions give step by step actions to get the full timesheet application working.

Related posts in this series:
Part 1 - Design & data storage
Part 2 - Building the UI
Part 3 - Installation Steps  (This blog post)
Part 4 - Final Part


Simple Instructions for Timesheet deployment
==================================
You require a web application that contains a site definition, I used a new web application (http://intranet.dev/) with a Publishing Site as the site template for the root site collection.
1. Download PaulB-Timesheet.wsp (save it to the server/local machine, I put PaulB-Timesheet.wsp on the e drive for this post)
2. Open Powershell with SharePoint commands:
3. Install the wsp and activate the feature using Powershell (PS) as shown below (text version of the PS commands)

4. Check the feature has been installed correctly on your site
5. Create a new database and popluate it with tables, download the SQL script.

6. Ensure the Timesheet database is created and ensure an account has permissions to access the table for read/write opterations.

7. Edit the web.config files on each Web Front End SP2010 Server (this should be changed to a feature receiver).  The connection string below uses windows trusted and will pass through each users Windows identity, it will generally be easier to user a dedicated connection string account as it saves on SQL Server permions being required for each user.

To complete your setup you need to configure your timesheet application per part 4 - Seed data & page creation.
Summary:
This will be sufficient for most standard requirments however, it is preferable to implement logging to the ULS and your own logging mechanism if it exists.

The areas I would customise on a SharePoint custom deployment would be:
  1. Assemly and wsp solution naming;
  2. Add logging to error handling;
  3. Rename lables;
  4. Potentially add custom fields or logic to the application to meet specific business requirements.
Instructions for Timesheet deployment using Visual Studio 2010 (Advanced option)
===============================================
Download the Visual Studio 2010 project:
PaulBeck.Timesheet.zip (version 1 - 820 KB), unzip the files and place on you development machine.
1.> Build and deploy solution to SharePoint farm.  The Visual Studio 2010 project has the following structure.

2.> Run the Script\timesheet-script.sql file in a SQL instance (Creates the db).
3.> Change the web.config to contain the app setting connection info for timesheets.
Configure your Timesheet Application
4.> Add the "Timesheet - Consultant", "Week", "Timesheet - UserProjects" & "Timesheet - BookTime" web parts to a new page.
5.> Connect "Timesheet - Consultant" to "Timesheet - Week" & "Timesheet - UserProjects", then connect "Timesheet - Week" to "Timesheet - BookTime" web part.
6.> Create another page called "Timesheet Add or Edit" i.e. "Timesheet-Add-or-Edit.aspx" (set in the web.config) and add the "Timesheet - BookTimeItem" web part to the page.
7.> Add the Admin screens by:
7.1.> Create a new page named "Timesheet Admin Main", add the following web part to the page "Admin Main".
7.2.> Create a new page named "Timesheet Admin Client", add the web part "Admin - Client" to the page.
7.3.> Create a new page named "Timesheet Admin Project", add the web part "Admin - Project" to the page.
7.4.> Create a new page named "Timesheet Admin Project Resources", add the web part "Admin Resource Allocation" to the page.

Part 1 - Design & data storage
Part 2 - Building the UI
Part 3 - Installation Steps  (This blog post)
Part 4 - Final Part