Thursday, 22 September 2011

EF Mapping with POCO Errors

If you ever receive the following error messaging containing this wording “Mapping and metadata information could not be found for EntityType”, it is a rather anonymous message saying that in the Model folder of the EF mappings in the .edmx file, something has gone wrong in the mappings of the XML somewhere.

For anyone else dealing with the error,  it's clearly stating the likely scenarios which I've found that cause this (extremely unhelpful) error:

  • Misspelled properties (case-sensitive!) This is the most likely problem, if somewhere in your model fields/attributes are missing to the conceptual model of your database, Visual Studio will complain like nobody’s business, make sure all fields/attributes/variables right down to the types match correctly. E.g.

    <EntityType Name="test">
      <Key>
        <PropertyRef Name="testID" />
        <PropertyRef Name="secondtestID" />
      </Key>
      <Property Type="String" Name="test" Nullable="false" MaxLength="16" FixedLength="true" Unicode="false" />
      <Property Type="Int32" Name="secondtestID" Nullable="false" />
      <Property Type="String" Name="CLI" MaxLength="25" FixedLength="true" Unicode="false" />
      <Property Type="DateTime" Name="ReceivedTime" />
      <Property Type="String" Name="testparam" MaxLength="100" FixedLength="true" Unicode="false" />
      <Property Type="Boolean" Name="testbool" />
    </EntityType>

    This has got to match with the variables in the model class of your web service.

  • Properties missing in the POCO class. (You need to write everything down correctly!) This also includes things lime Nullable=”false” for keys, you need to include this otherwise it won’t work.
  • Type mismatches between the POCO and entity-type (e.g., int 32 instead of long)
  • Enums in the POCO (EF doesn't support enums right now, so don’t include them)

Friday, 16 September 2011

DataBinding in WP7–The Quick and Easy Way

Here is something I found for those who wish to perform databinding on a  List Box using ItemsSource using static data the quick and easy way!

I started by added a static reference to the MainViewModel in the App class of App.xaml.cs

 private static MainViewModel viewModel = null;

public static MainViewModel ViewModel
{
get
{
// Delay creation of the view model until necessary
if (viewModel == null)
viewModel = new MainViewModel();
return viewModel;
}
}


My two lists in the MainViewModel class of MainViewModel.cs looked like this:



 public MainViewModel()
{
// Insert code required on object creation below this point
Items1 = new ObservableCollection<ItemViewModel>() {
new ItemViewModel() { LineOne = "runtime one", LineTwo = "Maecenas praesent accumsan bibendum", LineThree = "Facilisi faucibus habitant inceptos interdum lobortis nascetur pharetra placerat pulvinar sagittis senectus sociosqu", },
new ItemViewModel() { LineOne = "runtime two", LineTwo = "Dictumst eleifend facilisi faucibus", LineThree = "Suscipit torquent ultrices vehicula volutpat maecenas praesent accumsan bibendum dictumst eleifend facilisi faucibus", },
new ItemViewModel() { LineOne = "runtime three", LineTwo = "Habitant inceptos interdum lobortis", LineThree = "Habitant inceptos interdum lobortis nascetur pharetra placerat pulvinar sagittis senectus sociosqu suscipit torquent", },
};

Items2 = new ObservableCollection<ItemViewModel>() {
new ItemViewModel() { LineOne = "runtime one", LineTwo = "Maecenas praesent accumsan bibendum", LineThree = "Facilisi faucibus habitant inceptos interdum lobortis nascetur pharetra placerat pulvinar sagittis senectus sociosqu", },
new ItemViewModel() { LineOne = "runtime two", LineTwo = "Dictumst eleifend facilisi faucibus", LineThree = "Suscipit torquent ultrices vehicula volutpat maecenas praesent accumsan bibendum dictumst eleifend facilisi faucibus", },
};

}

public ObservableCollection<ItemViewModel> Items1 { get; private set; }

public ObservableCollection<ItemViewModel> Items2 { get; private set; }


Now I changed the initialisation of DataContext in MainPage.xaml.cs to reference the static object



  if (DataContext == null)
DataContext = App.ViewModel;


Removed the direct reference to the Items1 list in MainPage.xaml so it only had the binding



  <ListBox x:Name="ListBoxOne" ItemsSource="{Binding}" MouseLeftButtonUp="ListBoxOne_MouseLeftButtonUp" Style="{StaticResource PhoneListBox}">


And now I can use my conditions check to set the ItemsSource using the following code in MainPage.xaml.cs



  ListBoxOne.ItemsSource = App.ViewModel.Items2;

Thursday, 15 September 2011

How to install Microsoft SQL Server Management Studio on desktop

A common dilemma is to see that you have MS SQL Server 2008 installed but not the Microsoft SQL Server Management Studio on your PC, to do it go to : -

http://www.microsoft.com/download/en/details.aspx?id=7593

This link installs the Express edition which does essentially everything you need associated with MS Server 2008, as it says its an integrated environment for accessing, configuring, managing, administering, and developing all components of SQL Server 2008!

sqlserver2008

What I found also is that the installation file wouldn’t install it automatically, you have to select New Install on the SQL Server 2008 Setup, and manually tick the one and only (yes one) shared feature which is Management Tools – Basic to install the Microsoft SQL Server Management Studio on your PC Desktop. Wait for 10 minutes. Voila!

Also if you are programmer, you want to test certain database files for local use in Microsoft Visual Studio 2010, and that means that you want to be able to attach the database on another server (well locally on Visual Studio 2010), then this is what you can do:

  1. Detach the database (right click the database and click Detach)
  2. Copy the mdf and ldf files to your backup location
  3. Attach the database (right click Databases and click Attach)

Wednesday, 14 September 2011

More information on checking if an element exists in JQuery

The simplest mistake sometimes costs several hours of debugging. One of these is checking if the target exists before trying to apply some changes to/using it.

How to check if element in DOM exists, i.e. if the selector $(‘.some_class’) is not empty?

The simplest:

if ($('.some_class')) {

//some action

}

will not work!

The correct condition uses the .length function:

if ($('.some_class').length > 0) {

//some action

}

Note no brackets after .length.

How to check if JavaScript object’s property exists?

This is tricky, as there are two types of properties: own properties and prototype properties. Not going into details, we can assume, that own properties are the one that are for example serialized by JSON, and prototype properties are the one that can be empty or not, but are given in the object’s definition.

So, in most cases you want to check if the own property exists for the given object. This can be obtained using the hasOwnProperty() method:

if (the_object.hasOwnProperty("name)) {

//some action

}

If you only want to check whether there is the prototype property, you may use in operator to determine the existence of the property:

if ("name" in the_object)) {

//some action

}

Tuesday, 13 September 2011

How to Swipe gesture on JQuery Mobile}

 

Here is the code for how to do swipe gesture in JQuery Mobile, here it checks the body tag, and sets a “live” event to detect the swipe gesture, and shows an alert.

  $("body").live('swipe', function() {
         alert("swiped");

}

Monday, 12 September 2011

Bug fixed for Samsung Galaxy SII

For some reason when viewing a dialog page for JQuery Mobile using Android 2.22 on Samsung Galaxy SII, if you close the dialog box when opening from main page, such that it goes back to the main page again, and click a submit button, on the application I am writing it goes back to the dialog page which is not what I wanted. That is a real surprise considering its the latest Android device, and hasn’t been thoroughly tested on the latest version with JQuery Mobile. The long fix is to manually remove the submit button, and manually append the same button with the ID, and with the binding click event from the main JS file, which means copying the right functions.

Monday, 5 September 2011

Sorted out IIS 7.0 Issues and fixed most of AtomSite blog for mashupweb.co.uk

Finally, on Friday and today I have fixed at what it seems a simple error as to why I couldn’t log in to IIS 7.0, having trying to reinstall AtomSite on Web Platform Installer which is the supposed official program wizard from Microsoft to install new programs for IIS.

However, the same error message kept on appearing as shown: -

webplatforminstaller3

The message had read Filename: \\?\C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config

Line Number 141

Error: Configuration section not allowed in a <location> tag.

I had even attempted to reinstall the IIS 7.0 components as shown in the screenshot below, by removing the roles for Web Server, but to no rprevial, the same error had shown up again the following day!

DasBlog2

After an hour the next day of baffling how to solve it but trying to install new programs like Wordpress, the same error had shown. The fact was that extra tags had been added in the machine.config on that line which was a fatal mistake, it had something to do with allowpermissions and allowoverrides added into the line. Fact: don’t tamper with the file at all!

IIS 7.0 ran perfectly after that without having to ask you to log in.

On some good fortune as well, I solve part of the problem as to why AtomSite wasn’t working properly with the blog entry links, it had something to do with the the with the theme settings in Administration, so switching all to Blue setting in the same theme for www , blog, and all other entries made it work.

Friday, 26 August 2011

Rob Miles JumpStart Training on Windows Phone 7

Yesterday, I had the privilege to watch a bit of the Jumpstart training on Windows Phone 7 with Rob Miles and Andy Wigley after work, even though it was two hours,.

I did gets some great tips on creating great applications especially on advice when creating a “light version” of an application rather than the trail mode as it entices them to purchase the full application more via a link rather than being put off by the word “trial” with its limited features that it imposes.

Other tips were to make full use of the application submissions as a dedicated app published reviewer from Microsoft reviews and takes note of if the application is deemed worthy to be published, so only 100 application attempts for publishing are free, after you need to pay for publishing your app, this is for the free version of your application that is.

Here is some screenshots made from the online event.

robmiles7

robmiles8

Monday, 15 August 2011

JQuery Mobile Tips #3

Here are some more JQuery Mobile Tips I have found today.

For textual updates on your JQuery Mobile Dialog box you want to make, it is best to do a <p> update on a text in the javascript in your ascx or aspx page for the content of your JQuery Mobile dialog page. For example: -

<% Html.BeginForm() %>
<script language="javascript" type="text/javascript">
    $("#selectBox").bind('change', function (e) {
        var str = "";
        $("select option:selected").each(function () {
            if ($.jStorage.storageAvailable()) {
                $.jStorage.set('SelectedValue', $(this).val());
                $('#setText').text("You have selected: " + $(this).text() + ". ");
            }
        });
        e.preventDefault();
    });
</script>
<!-- Form content goes here -->
            <%= Html.DropDownList("selectBox")%>
<% Html.EndForm() %>

<p id="setText"></p>

As you can see here, I want to change the <p> tag with ID setText with the selected list box value you have selected from ID selectBox, abnd the results are far quicker than placing it in the .js file you added in the header in the Master Page, it is almost instantaneous, this is to improve performance loading issues. Hope that helps!

Windows Phone Training with Andy Wigley and Rob Miles

Just to let you know there is online training for Windows Phone 7 courtesy of Andy Wigley from Appa Mundi and Rob Miles from The University Of Hull, which is based mainly on the new features of Mango (Windows Phone 7.1) including relevant topics like Multi-tasking, Application Data Storage with Database CE, and Windows Azure.

Day One August 23, 2011 | 8am-4pm PDT | Live online training

• Building Windows Phone Apps with Visual Studio 2010

• Silverlight on Windows Phone – Introduction

• Silverlight on Windows Phone – Advanced

• Using Expression to Build Windows Phone Interfaces

• Windows Phone Fast Application Switching

• Windows Phone Multi-tasking & Background Tasks

• Using Windows Phone Resources (Bing Maps, Camera, etc.)

Day Two — August 24, 2011 | 8am-4pm PDT | Live online training
• Application Data Storage on Windows Phone

• Using Networks with Windows Phone

• Windows Azure and Windows Phone
• Notifications on Windows Phone

• XNA for Windows Phone

• Selling a Windows Phone Application

What’s a “Jump Start” Course? | Training specifically designed for experienced developers and technologists whose jobs demand they know how to best leverage new, emerging Microsoft technologies. These advanced courses assume a certain level of expertise and domain knowledge, so they move quickly and cover topics in a fashion that enables teams to effectively map new skills to real-world situations.

Here is the sign up link https://www.eventbuilder.com/microsoft/event_desc.asp?p_event=m58m12c5

Thursday, 7 July 2011

Plants vs Zombies review

Having heard all about the rave of Plants vs Zombies in the mobile gaming world, and that Microsoft have backed the game to be top 6 games, I had to find out yourself why this game got some commotion and praise.
The simple tower defence game entails you to set various plants on the outlay of the garden to block hordes of zombies going along the same of line of path to the house, you have to prevent them from entering and strategically put them for them to fire projectiles (flower power I guess) to the kill the zombies after several attacks till they simply drop and fall apart.
Even though I had thought that graphically, Popcap had made it as simple in design as possible in terms of cheery cartoon visuals I thought they have bitten off more than can chew (excuse the pun for the title), but I was wrong. The thing I like is that it is simple as possible, the menu at top to select sunflowers, pea shooters and cherry bombs, and other plants are clear and simple, with the notion that 100 sunshine items gives you another plant to purchase to place in the garden. I thought that maybe too simple but the faster the sunshine drops, the quicker you need to place convert these to plants and place them on the garden (if you are too slow, you're gonna get bitten and infected, not literally).
The thing I like is the sheer simplicity of it all which is why it is my top 6 Windows Phone games, the instructions are brief and clear even the storyline is so ever simple, and you can see how many zombies you need to attack at the start of each stage. The thing that entices you in, is the fast pace action of it all, and the quirkiness of the enemy zombies which they are dressed as leading protesters holding signs up, to wearing eighties' back-up dancer leotard's, the light humour of it all even gives you the happiness to possibly hug the zombies rather than destroy them.
For the arsenal, the various plant types you can do to attack such as daisies in the first stage, to cacti and cherry bombs that make the attacks very interesting like blasting zombies to smithereens usually ending in a nasty mess, and there's even wall-nuts to block enemies to go further to save you time.
Achievements are easily viewable in the game and attainable as well linking with Xbox achievements like Soil Your Plants for planting ten peashooters to Explodonator for planting 10 cherry bombs that explode successfully.
The other thing is the multiversity of strategic gameplay, you can place the pea shooter attackers to throw projectiles to the back so they can attack further without being eaten whilst the sunflowers can be near the front, and you don't know where to see the zombies walk on which path so its all guesswork, and whether you wait 1 minute more to get the more devastating attack plants, it's this open end style to gameplay which makes the game worthwhile.
All in all, the game is brilliantly poised.

Wednesday, 6 July 2011

Isolated Storage Tips #3

It has been a while since I wrote more Isolated Storage Tips, so I am going to explain a bit more about the various useful coding implementations in Isolated Storage in terms of creating text files, writing to it, and then later reading that data and appending to it.

Here is the code: -

using System.IO;
using System.IO.IsolatedStorage;
using System.Windows;
using Microsoft.Phone.Controls;

namespace WP7IsolatedStorage
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
}

private void btnSave_Click(object sender, RoutedEventArgs e)
{
string fileName = "mytestfile.txt";

using (var isoStorage = IsolatedStorageFile.GetUserStoreForApplication())
{
// 0. Check to see if the file exists
if (!isoStorage.FileExists(fileName))
{
// file doesn't exist...create it.
isoStorage.CreateFile(fileName);
}

// 1. As we are appending to the file, we use FileMode.Append
using (var isoStream = new IsolatedStorageFileStream(fileName, FileMode.Append, isoStorage))
{
// opens the file and writes to it.
using (var fileStream = new StreamWriter(isoStream))
{
fileStream.WriteLine(txtText.Text);
}
}

// 2. Cannot read from a stream that you opened in FileMode.Append.
using (var isoStream = new IsolatedStorageFileStream(fileName, FileMode.Open, isoStorage))
{
// opens the file and reads it.
using (var fileStream = new StreamReader(isoStream))
{
txtCurrentText.Text = fileStream.ReadToEnd();
}
}
}
}
}
}


In point 0, we have created an IsolatedStorage File object that creates and holds the physical location of the Isolated Storage, and we then check if a current object file exists, if it doesn’t then we can create a new one.



In point 1, once we find out the file exists, we open the file which we called the object here isoStream, and set it to FileMode.Append which we then use the StreamWriter class to write to it. It is then, the contents of txtText.Text is stored into the object isoStream, where that line is appended to the file.



In point 2, finally, we have to use the using annotation again as you cannot read whilst appending. We then set the StreamReader, and use the code fileStream.ReadToEnd() to read the whole file, and place it into the txtCurrentText textbox.

Monday, 4 July 2011

How to redirect to error page in view?

Recently I made a forum answer post to how you can redirect to a customised error page in ASP NET MVC 2 for error pages?

Here is the answer: -

<customErrorsmode="On"defaultRedirect="CustomErrorView" >
<errorstatusCode="404"redirect="Error/Error404" />
<errorstatusCode="500"redirect="Error/Error500" />
< /customErrors>

The controller:

public class ErrorController : Controller
{
// Return the 404 not found page
public ActionResult Error404()
{
return View();
}

// Return the 500 not found page
public ActionResult Error500()
{
return View();
}
}


This could be done with a static page if needed:



<customErrorsmode="On" >

<errorstatusCode="404"redirect="Static404.html" />


< /customErrors>



The link to the forum post is http://forums.asp.net/t/1693685.aspx/1?How+to+redirect+to+error+page+in+view+

Friday, 1 July 2011

Free icon set for GUI designers on WP7, Android and iPhone

I wanted to make a blog post on some really good simple toolbar icons in particular for the WP7, and I have found a few of these.

First is the Noun Project which has a “Metro” themed design style to the icons, it is a collective collaborative effort by designers that uses free pictograms and icons and contains so far 500+ icons in the “Metro” theme. It is run and community funded by www.kickstarter.com (the largest funding platform for creative projects) which the CEO (Perry Chan) gave some really insightful talks at the Guardian Summit (thumbs up to them). It is called www.thenounproject.com and its funding is going really well at $14,366. You get a free t shirt of 3 icons of your choice if you fund them of over $30.

The other is Gentleface Toolbar Icon Set made for GUI designers, it is along the same vein of “Metro” styled icons with 8 sets of cursors and 296 icons in black and white versions. The free version gives away the entire set totalling 304 original icons in 32-bit PNG format optimized for 16x16 pixel size and available in 16x16, 32x32 and 48x48 pixel sizes. This is given as a license for the Creative Commons as a non commercial product but if you want the royalty free license which includes .eps and even Flash SWF formats, this costs $29.99 if you want to use these commercially. See http://www.gentleface.com/free_icon_set.html.

Monday, 20 June 2011

WP7 Mango Phones leaked out used in Italy

According to some reports, some people have got their hands on the WP7 Mango developer phones a bit earlier than anticipated according to the Dude WIMU application which shows that 67 phones run “other versions” of the OS out of the 14,595, and as a WP7 developer, its most probably from the user agent taken from the phone and logged into their application when they made the HTTP request notably the 7.10.7605 build.

See the below snippet: -

WMPU today dug up a couple of instances of Mango running on current handsets, first off they picked up on Alessandro Teglia @alead, Community Program Manager for CEE and Italy Microsoft, tweeting about using Mango features on his HTC Mozart. and continues to do so.

alead_mango_tweets_thumb

alead_bingmusicsearch_thumb

There is also a video associated with this also.

This will cause a slight uproar on when they are actually releasing the WP7 Mango phone, as already developers have their hands on it a lot sooner than most people expected. If they keep to their word rather than guessing and throwing surprise updates and announcements, this update on the phone and new handset releases can help dampen the damage that’s already caused to the Microsoft ecosystem or will it play down again to the guessing game.

You can see on the video that the guy is showcasing mostly the Avatar, and it can interact more than the standard version 7, but I expect there to be more notable updates in the future, but obviously you can see they have made full use of the Shake gestures in WP7.

Friday, 17 June 2011

Pet List

Here are snippets of code which I found really useful when setting a drop down list element using HtmlHelpers in MVC 2 to a ViewData to be displayed on the view pages.

Dim petList As List(Of String) = New List(Of String)
petList.Add("Dog")
petList.Add("Cat")
petList.Add("Hamster")
petList.Add("Parrot")
petList.Add("Gold fish")
petList.Add("Mountain lion")
petList.Add("Elephant")

DialogScreenView.ViewData("pets") = New SelectList(petList)

or…..

Dim petList As List(Of String) = New List(Of String)

For Each petName In oPetList.PetList
    petList.Add(petName.Text)
Next

DialogScreenView.ViewData("pets") = New SelectList(petList)

DialogScreenView.ViewData("Screen") = TempData("Screen")

or….


Dim petList As New List(Of SelectListItem)()

For Each petName In oPetList.PetList
    Dim petItem As SelectListItem = New SelectListItem
    petItem.Text = petName.Text
    petItem.Value = petName.Value
    petList.Add(petItem)
Next

DialogScreenView.ViewData("pets") = petList

DialogScreenView.ViewData("Screen") = TempData("Screen")

Sunday, 5 June 2011

Pivot Controls discovered

I started working on my WP7 again, only to discover that I need some form of tabbing on it, and having investigated Pivot Controls but never use it, now would be the best time to look into in depth.

Having used the tag <controls:Pivot >….</controls:Pivot> inside the <Grid> tag, Visual Studio didn’t recognise this tag, baffled I looked a various samples, but most of them seem to point that you need the controls tag, else there was no namespace for WP7 to adhere to.

Upon discovery by accident, I realised from the Panorama demo, you must require the header reference in the XAML, the naming inside the PhoneApplicationPage: -

xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"

Finally I could get the Pivot Controls working as a result Smile

You can denote your Pivots as structured below as the barebones: -

<controls:Pivot Title="header" Name="pivot1">

    <controls:PivotItem Header="item1">

     ………..contents of PivotItem of item1 here…….

    </controls:PivotItem>

     <controls:PivotItem Header="item2">

     ………..contents of PivotItem of item2 here…….

     </controls:PivotItem>

     <controls:PivotItem Header="item2">

      ………..contents of PivotItem of item3 here…….

      </controls:PivotItem>

</controls:Pivot>

Having seen the way Pivots are structured, they seem very simple to code, and for effective as a result, and makes your application less cluttered and more ordered in its layout.

Friday, 20 May 2011

Mark Pilgrim on HTML5

I wanted to find out a little more on developments on HTML5, and with a guy called Mark Pilgrim, who recently joined Google and is working on Google Chrome with emphasis on HTML5 and author of www.diveintohtml5.org. I decided to write him an email asking about what were the latest features of HTML5, and what to look forward to, he took a while to reply but here are his answers. Enjoy!

On Sun, Mar 20, 2011 at 1:41 PM, Hon wrote:
Hi Mark, my name is Hon and I'm a web developer in London, I write a blog at http://guinnesslee.wordpress.com and
http://www.mashupweb.co.uk, and would like to ask a few questions, if you do have time feel free to answer them.

Do you work closely in HTML5 with Google?


I work on Google Chrome, developing tests for interoperability with other browsers and fixing bugs where those tests fail. At the moment I'm working on IndexedDB compatibility.


What would you consider the best feature of HTML5?


In terms of maturity, canvas is the best. The fact that you can play Angry Birds in a browser ( http://chrome.angrybirds.com/ ) is huge,
and it will be a big part of Flash's inevitable downfall.



How are the Web Hypertext Application Technology Working Group
(WHATWG) close to finishing HTML5 and that W3C would put a stamp of approval upon it? It really has been a long time in waiting.


AFAIK, the W3C is publishing another draft next week and publishing the "final" version of HTML5 in October. But work continues on HTML.next. The web moves ever forward.


People are started to develop in HTML5 already which is great, but it has taken a while for large corporations to release web browser to be
compatible with HTML5, some organisations are still using IE6 to this day for their enterprise browsers, will they ever adopt to HTML5?


When Microsoft stops supporting Windows XP with security updates, these corporations will be forced to migrate. Until then, there's nothing we can do. They have internal applications that rely on quirks
in IE6 -- they don't even work in IE7. Even getting them up to IE8 will be a big improvement, and I suspect many of them will simply skip
to the latest version at the time (IE9 or IE10).


Finally, what official list of features does Google Chrome support for HTML5? You've also listed some features that IE9 don't support on your website, do you have the full list at all?


[These are not guaranteed to be up to date, but they are the best resources I know of.]

http://www.chromium.org/developers/web-platform-status
http://www.chromium.org/developers/web-platform-status/forms

http://msdn.microsoft.com/en-us/ie/ff468705

Hope this helps,
-Mark

Wednesday, 18 May 2011

HTC HD 7 Review

As the second and better of the two devices I will be getting from Microsoft, this is the device that’s really popular with the developers that I want to have, it is the HTC HD 7.

At first impressions, the device is certainly the bigger and classier at 162g, although it feels big, and making calls on it a bit cumbersome, the thinness of the device makes up for it and it feels more comfortable than the Omnia 7.  It has a whopping 4.3 inch screen with surfing the web, using the camera, and watching videos a luxury using this device. With it interface at 800 x 480 pixels capacitive touchscreen, it is lovely, and the processor is the same at Qualcomm 1Ghz Snapdragon but feels much more responsive than the LG Optimus 7. Everything from the tiling to the transitions, it slides, swoops and bounces with responsiveness on the device.It has an aluminium kick stand at the back for watching movies as well.

It has the usual specifications like the other Windows phones are the Wi-Fi,3G, and GPS, including HSDPA support a 7.2Mbs download with five megapixel camera, but the outstanding feature is the browsing experience. The thing however that is let down is the battery at only1,230mAh for such a large device, it only lasts less than a day. However it is the browsing experience that wins the order of the day with tabbed browsing enabled and browsing history although it does sometimes display to upgrade your flash player and the browsing speed isn’t always up to optimum speed. Other than that, the the framework allows caching, and loading up previous sites is fast, you can see more information as well as the offering more when zooming in, at times almost feeling like a tablet in terms of the browsing experience.

Read more: http://reviews.cnet.co.uk/mobile-phones/htc-hd7-review-50001091/

Summary of Windows Phone 7 Application Certification Requirements.

Updated for Version 1.3 released September 2010.

For reference, and having seen so many talks/slides/websites of the Windows Phone 7 Application Certification Requirements, and I may be releasing an app soon into the Windows phone 7 market, I decided to place a summary of the Windows Phone 7 Application Certification Requirements, from Shazami Design.

Here it is: -

Size:

· Over the air install up to 20MB;

· disclose additional data package if greater than 50MB;

· max XAP size 400MB;

Images:

Description
Pixels
File Type
Required
Location

Application Icon
62 x 62
PNG
Required
XAP

Application Tile Image
173 x 173
PNG
Required
XAP

Device application icon
99 x 99 small173 x 173 large
PNG, 262 dpi
Required
Marketplace catalog

Desktop application icon
200 x 200
PNG, 262 dpi
Required
Marketplace catalog

Panoramic background art
1000 x 800
PNG, 262 dpi
Optional
Marketplace

Screenshot
480 x 800
PNG
1-8 Required
Marketplace catalog

Performance:

· First screen render within 5 seconds (use splash screen)

· Responsive to user input within 20 seconds

Prompt User:

· Chat, instant messaging, or other person-to-person communication applications that all creation of accounts via phone device, must verify that user is at least 13 years old

· “Opt-in” consent for publishing personal information to any service or other person

· “Opt-in” consent for push notifications

· User-friendly error message on exception

· Visual progress bar with cancel option for time consuming activities

· Back button in games to present in-game pause menu or main menu with resume option

· Message if Location Service turned off in a location-aware application

· Explicit permission on first use of toast or tile notification

· Explicit permission on first run of application under a locked screen

· Apps that play their own background music must ask before stopping or adjusting music playback from Music + Video Hub

Settings screen:

· Enable/disable toast notification

· Enable/disable tile notification

· Enable/disable application from running under a locked screen

· Use/Override music from Music + Video hub

· Control own background music/adjust hub music (ex: volume)

Restrictions:

· May not require the user to pay outside of Windows Phone Marketplace to activate, unlock, upgrade, or extend usage of the application

· May not sell, link to, or promote mobile plans

· May not consist of, distribute, link to, or incent users to download, or otherwise promote alternate marketplaces for applications and/or games

· Must not jeopardize the security or functionality of phone devices or Marketplace

· Advertising must comply with http://advertising.microsoft.com/creative-specs

· Apps that allow purchase of music content must include Windows Phone music Marketplace as an option.

· For music not purchased through Windows Phone music Marketplace, app must include its own playback

· Content restrictions include: licensed, copyrighted, illegal, obscene, indecent, violent, defamatory, libelous, slanderous, threatening, hate speech, discriminatory, adult-related, promotes illegal activities, excessive alcohol, tobacco, weapons, drugs, violence, profanity

· PInvoke, COM interoperability, debug symbols, reflection were it affects phone capabilities, uncaught exceptions

· Must not include viruses, malware, or malicious software

Tuesday, 17 May 2011

Windows Phone 7 so far is doing fine in terms of growth rates in marketshare

I had randomly stumbled upon a blog site called myapplenewton.blogspot.com, and this person gave some interesting facts about WP7: -

His views are: -

* MS shipped 2 million units in the first 10 weeks after WP7 was launch.
* Google took 6 months to reach the 1 million mark with Android
* Apple took 10 weeks to sell its first 1 million iPhones
* 93% of WP7 users are satisfied or very satisfied
* 90% of WP 7 users would recommend it to others
* The market for Smart phones is huge and these WP7 sales figures are small in comparison
* It took Apples App Store 105 days to reach 7,500 apps
* It took WP7 Marketplace 83 days to reach 7,000 apps
* It took MS 135 days or 4 months and 15 days to add copy and paste to its OS
* Apple took 722 days or 1 year 11 months and 22 days to add copy and paste to its OS

* 9 months after its initial release Androids market share was at 2.8%. It took 18 months from initial release for Android's market share to reach 9%.

The last one being the most significant in my opinion, although it will slow down in the subsequent months later on this year it will be interesting what total market share it would by the end of the year, as PC World claims it has already reached 7% in the smartphone market, over double the growth of Android in the same period. But remember that Android was a relatively unheard of smartphone player at the time, and it took a lot longer to market the product as oppose to Microsoft which already has a brand established already.

If it trebles to 21% at least, then it is on course to be a contender, and also if Android increases more to 60-65% considering it is reaching its peak then they will be the major player. Will be interesting to see how it pans out.

Removing Latebinding using Pushpins to Bing Maps in WP7

 

Here I have specified an Bing Map Control XAML in WP7, and if you wish to add a pushpin with the content “you” on the map, the best way is inside that map control: -

<map Name="Map" CredentialsProvider="{Binding CredentialsProvider}" ZoomLevel="{Binding Zoom, Mode=TwoWay}" Center="{Binding Center, Mode=TwoWay}">

</map>



You write the following code:-



<map:MapLayer Visibility="{Binding UserPosition, Converter={StaticResource GeoCoordinateVisibilityConverter}}">



<map:Pushpin Location="{Binding UserPosition}" Content="you" />



</map:MapLayer>



This allows you to insert a pushpin in a layer, and collapses the layer as well, thus reduces the need for late-binding for setting a data context in Loaded event.



Hope that helps.

Monday, 16 May 2011

Asus EEE 1201N Review

Today, I collected my Asus EEE 1201N I had bought at Maplins, and I will explain why it was a fantastic deal and specification for a netbook, I reserved and bought it at Tottenham Court Road for £275 plus a notebook bag and screwdriver on a special discount offer taking £25 off £300. It is an amazing value for its price, and I haven’t seen any other netbook at that price that can top its graphics performance.

The chassis is reasonable, but a little plastic laered, but it is very good in terms of stability. The glossy surface does let it a little down, but the keyboard is clear and big to use for accurate input as it has a width of 280 mm.

asus1201n

The netbook is conventionally larger at 12.1 inch screen, at 1366 x 768 pixels due to HD resolution with fairly low distribution of brightness which can be seen as good and bad, good in terms of battery usage, bad due to poor lighting conditions and having a reflective display surface.

It houses an awesome 250Gb of hard disk, 2GB RAM to keep multiple programs running fine, if you use power hungry intensive applications, so switching them is at ease, and very responsive with chance to upgrade to 8Gb RAM.

The processor is so so as it uses the more power intense and older processor Atom 330 dual processor with clock rate of 1600MHz, although it can handle most things, it does deplete battery life to 4-5 hours leaving with disappointing battery life at average 4 hours 28 minutes.

The best thing of this netbook, clearly by a  mile is the graphics processing card, it is an Intel ION graphics, enough to play World of Warcraft at 30fps and FEAR 2 at 20.7fps, and Call Of Duty 4 at 33fps, and playing HD video perfectly fine as well displaying images very bright and vivid with HDMI support, it is a fantastic netbook for games and multimedia quite simply. It even has Asus’s Super Hybrid Engine that allows integrated overclocking in it for a plus 2% in the CPU performance. Its what I got it for frankly, and I hope to write more about it in the next months or so.

Windows 7 Experience Index

Processor

Calculations per second 3.3

Memory (RAM)

Memory operations per second 4.5

Graphics

Desktop performance for Windows Aero 3.9

Gaming graphics

3D business and gaming graphics 5.1

Primary hard disk

Disk data transfer rate 5.9

Nokia E7 Phones 4 U Advert

Here’s my Phones 4 U press advert for the Nokia E7, applied on facebook for a chance to win the Nokia E7, which I initially wanted to test out.

The competition will select the best definition of Succss is, and I hope mine can win it, as my definition is more of a caring, thoughtful, and meaningful definition of success.

Success is… not gaining in life or accomplishing for yourself. It’s what you can do to help others.

nokiae7advert

Thursday, 14 April 2011

My Open Letter about WP7 to Steve Ballmer

A week ago, I decided to write some collected thoughts about the progress so far with WP7, and especially about the Nokia collaboration on handsets using WP7 with Microsoft, through emails and the Nokia developer event I went to in February, with thanks to Tony Fish, I decided to research further into the factor that define why WP7 would be beneficial that now Nokia is a player in the marketplace as well. What I wanted to do is let a high profile name from Microsoft hear this, as well as my negative thoughts of the Windows updates which is recently well responded by MIX 11. What better person to listen to all these issues (in terms of business talk) than Steve Ballmer, CEO of Microsoft, he had actually responded with the reply via Gmail.

Steve Ballmer
to me, Joe


show details Apr 7 (7 days ago)

Thanks so much

Here is what I had wrote to my “open letter” to him from my own personal perspective of my thoughts of WP7 collaborating with Nokia and the updates: -

----------------------------------------------------------------------------

Hi Steve,


Just to let you know I am a very avid fan of Windows Phone 7, and you have made a great speech on the WP7 announcement at the CES and Mobile
World Congress in particular the collaboration with Nokia, I believe
it has the potential to be a real competitior in the market with
iPhone and Android, this is in terms of its increase in value for
being the provider of Payment, Identity, Location & Reputation, and the collaboration with Nokia can be benefitial here to raise this bar.
I am happy that the following points are to be the future critera for Windows Phone 7 with the colloboration with Nokia as seen below: -
Nokia will adopt Windows Phone and together they will closely
collaborate on development.


Bing will power Nokia’s search services.
Nokia Maps will be a core part of Microsoft’s mapping services.
Exploit Nokia’s extensive operator billing agreements.
Microsoft development tools will be used to create applications, and;
Nokia’s content and application store will be integrated with
Microsoft Marketplace.


Let me elaborate on the above four points I had mentioned in Payment,


Identity, Location, and Reputation: -
Identity
If you think about it that Nokia is by and large still the largest
manufacturer of mobile handset devices to this date with its global device market share was 31% in the fourth quarter 2010, up from an estimated 30% in third quarter of 2010 and the rate it sells its devices is quite phenomenal at a rate of 260,000 Handsets Per Day in comparisons with Google's 200,000, and Apple's 230,00, you are looking
at a clear numbers game advantage at the moment. They have a big global market with Ovi in China, Germany and India being the top three biggest app store market players (currently worldwide at 4 million downloads per day), to be able to be potentially identifiable in that
market would be a big plus in terms of downloads per day and traffic conversion to downloads which is 80% in Ovi.


Payment


If Microsoft can exploit Nokia's extensive operator billing agreements to great effect, the ratio of placing the operating system to the Nokia handset device with operator billing would generate potentially
good revenue based upon the fact that the Ovi Store is fairly
established already in the global arena. The reason why it would be a good thing is Ovi's global reach is fairly established in which it distributes mobile content in more than 190 countries, with content available in 32 languages, and especially the payment options that include mobile billing through 109 operators in 34 countries and credit card billing in more than 170 countries. Have a look at the Ovi Store distribution map attached.


Location


If the integration of Ovi Maps with Bing Maps does go well, the
winning formula would be the innovative technology notably the biggest perk in accessing the Nokia subsidiary Navteq, the company has showcased very elaborate and visual products in the past, and it could be well that the maps be integrated with Microsofts Bing search engine. In terms of the business aspect, it can also form a unique local search and advertising experience based on the adCenter advertising platform.


Reputation


Onto reputation, from a development perspective Microsoft can be top notch in this, although the app marketplace is really small in comparison with Google and Apple with only 1,500 applications
available, there is an quite an active community out there promoting the development with the Tech Days, WP7 workshops, and conferences like MIX11 which I regularly go to. Also, 36,000 individuals and studios are now members of the Windows Phone developer community, with 1,200 more joining every week, with these 40% registered developers have already published their first app or game for WP7, and 12 apps are downloaded per month per user.
Combine this with the Nokia community (despite some few divides), you can visualise the numbers. I can give you a blog entry for the ease of use & potential revenue for which developers can develop WP7 applications to market and sell, see
http://www.nilzorblog.com/2011/01/android-vs-wp7-for-developers-case.html


Problem: Phone Updates


Now my thoughts on operating system updates, that's where the problem lies, don't get me wrong although I am fairly patient, there are clearly "teething problems" in this area, since the WP7 major update last month not everyone has been given the "NoDo" update on time, or at all in my case, phone users not only have been seemingly resorting to "homebrew solutions" to get the much-touted copy and paste functionality on their devices, but some of the first releases for
Samsung mobile device users were "bricked", and from a consumer level that is really poor. Although British mobile operator O2 and French outfit SFR have been offered the "Cut and Paste" feature, the rest of the operators have not been given the update and are still waiting which means not every WP7 user is willing to wait too long for them.
By having a look at the retailed eXtra on explaining hthe support of the Wp7 in comparison with Android and Apple, you can see why the integrated support for functionlity of the phone falls short of expectations. Ideally this should of been leveraged in the first release and not as a prolonged update release from my point of view for some of these functionality like "cut and paste", unified email integation, video calling, and HTML5 support.
I believe WP7 still has got great potential, and leveraging these
solutions can be a big plus, but focusing "more" on what the phone can do for the consumer in this current time and market would help just as much.


Many thanks for listening,


Hon
(WP7 Fan)

----------------------------------------------------------------------------

WP7 Network Connection Check

Not everyone can have instant internet network access on the Windows Mobile 7, so here I will give a really quick pointer to how you can code to check network connection, in the namespace there is Microsoft.Phone.Net.NetworkInformation; 

You can then use this namespace, to run the method that checks if a network connection is available via a boolean accessor done via: -

if (NetworkInterface.GetIsNetworkAvailable())

{

    Do some conection stuff or alert here…

}

or alternatively, you can write: -

bool hasNetworkConnection =
NetworkInterface.NetworkInterfaceType != NetworkInterfaceType.None;

It is as simple as that using one linr of code for a bollean check, hope that helps!!

WP7 Design Guidelines

After randomly searching through the WP7 MSDN webpages on http://msdn.microsoft.com/en-us/library/gg680270%28v=pandp.11%29.aspx, I had found a very useful design guideline which WP7 developers should follow: -

Design Guideline

Navigation, frames and pages

  • Make sure to consider the Back button and user interactions with the Application Bar when creating your navigation map.

Application Bar

  • Use the Application Bar for common application tasks.
  • You are limited to four Application Bar buttons.
  • Place less frequently performed actions in the Application Bar menu.
  • If the action is difficult to clearly convey with an icon, place it in the Application Bar menu instead of as a button.
  • You are limited to five Application Bar menu items to prevent scrolling.

Back button

  • You should only implement Back button behaviors that navigate back or dismiss context menus or modal dialog boxes. All other implementations are prohibited.

Screen orientations

  • Portrait is the default application view. To support landscape view, you must add code.
  • If an application supports landscape, it cannot specify only left or only right landscape views. Both left and right landscape views must be supported.
  • If your application supports text input, you should support landscape orientation because of the possibility of a hardware keyboard.

Themes

  • Avoid using too much white in applications, such as white backgrounds, as this may have an impact on battery life for devices that have organic LED displays.
  • If the foreground or background color of a control is explicitly set, verify that the content is visible in both dark and light themes. If the specified color is not visible, also explicitly set the background or foreground color to maintain contrast or choose a more appropriate color.

Application settings

  • Application actions that overwrite or delete data, or are irreversible must have a cancel button.
  • When using additional screens with commit and cancel buttons, clicking those buttons should perform the associated action and return the user to the main settings screen.

Touch input

  • All basic or common tasks should be completed using a single finger.
  • Touch controls should respond to touch immediately. A touch control that lags or that seems slow when transitioning will have a negative impact on the user experience.
  • For time consuming processes, developers should provide feedback to indicate that something is happening by using content to indicate progress, or consider using a progress bar or raw notification as a last resort. For example, show more and more of the content as it is being downloaded.
  • The touch and hold gesture should generally be used to display a context menu or options page for an item.

On-screen keyboard

  • You should set the input scope property for a text box or other edit controls to define the keyboard type and enable the appropriate typing aids.

Canvas and Grid controls for layout

  • The Canvas control uses a pixel-based layout and can provide better layout performance than the Grid control for deeply embedded or nested controls in applications that do not change orientations.
  • The Grid control is the best choice when the application frame needs to grow, shrink, or rotate.

Panorama and Pivot controls

  • Both Panorama and Pivot controls provide horizontal navigation through phone content, enabling the user to flick and pan as necessary.
  • Use Panorama elements as the starting point for more detailed experiences.
  • Use a Pivot control to filter large data sets, providing a view of multiple data sets, or to provide a way to switch between different views of the same data.
  • Do not use the Pivot control for task-based navigation, like in a wizard application.
  • Vertical scrolling through a list or grid in Panorama sections is acceptable as long as it is within the confines of the section and is not in parallel with a horizontal scroll.
  • Never place a Pivot control inside of another Pivot control.
  • Never place a Pivot control inside of a Panorama control.
  • Applications should minimize the number of Pivot pages.
  • The Pivot control should only be used to display items or data of similar type.
  • You should not use Application Bar buttons to provide navigation in a Pivot control. If the Pivot requires navigation aids, you are probably misusing it.

Text

  • You should primarily use the Segoe font. Use alternative fonts sparingly.
  • Avoid using font sizes that are smaller than 15 points.
  • Maintain consistent capitalization practices to prevent a disjointed or jagged reading experience.
  • The application title in the title bar should be all capitals.
  • Use all lower case letters for most other application text including page titles and list titles. In the Application Bar, any text you include is automatically displayed in all lowercase.

Wednesday, 13 April 2011

A Slice in C#, not literally

For writing my WP7 application, it had involved some string slicing, and because the code I had been looking at was Javascript where string slicing is fairly easy, doing this in C# was slightly trickier. However, having researched this, if you wanted to slice a C# string, the implementation is quite easy.

So what does it mean to string slice: -

By slicing a string, you can extract the characters from index one to index two, essentially calling Substring with two index values.

Although no framework exists, you can create an extension class that handles this.

public static class Extensions
{
    public static string Slice(this string source, int start, int end)
    {
        if (end < 0) // Keep this for negative end support
        {
            end = source.Length + end;
        }
        int len = end - start;               // Calculate length
        return source.Substring(start, len); // Return Substring of length
    }
}

Quintessentially, you pass a start index, which is >- 0 and second parameter can be an integer, which is takes a substring of that string as its index, if it is negative, you start from the end and count backwards, if you want to go to the end, its the length of the string minus one.

E.g.

string s = "Hello World!";
Console.WriteLine(s.Slice(0, 1));  // First chars Console.WriteLine(s.Slice(0, 2));  // First two chars
Console.WriteLine(s.Slice(1, 2)); // Second char Console.WriteLine(s.Slice(8, 11)); // Last three chars
 

Monday, 11 April 2011

Shake Gestures in WP7

Here is a quick and easy step to using the Shake Gesture Library in Windows Phone 7 which I had discovered at the first WP7 workshop in Birmingham, this is essentially an accelerometer built in the phone that identifies a shake movement, and triggers an event handler to do something with that action.

The library detects directions in the left-right (X direction), top-bottom (Y direction), and forward-backward (Z direction).

To use the Shake Gesture Library, you need to: -

1. Add reference to shake gestures library: ShakeGestures.dll.

2. Add a using statement to file header:

using ShakeGestures;

3. Register to the ShakeGesture event:

// register shake event


ShakeGesturesHelper.Instance.ShakeGesture += new    


    EventHandler<ShakeGestureEventArgs>(Instance_ShakeGesture);


 


// optional, set parameters


ShakeGesturesHelper.Instance.MinimumRequiredMovesForShake = 4;


4. implement the ShakeGesture event handler from step 3, this essentially will call this method once a shake has been detected, you can customise the code within the BeginInvoke method.



private void Instance_ShakeGesture(object sender, ShakeGestureEventArgs e)


{


    _lastUpdateTime.Dispatcher.BeginInvoke(


        () =>


        {


            _lastUpdateTime.Text = DateTime.Now.ToString();


            CurrentShakeType = e.ShakeType;


        });


}


The ShakeGestureEventArgs holds a ShakeType property that identifies the direction of the shake gesture. This ShakeType can be one of three, X, Y or Z direction as described above.



5. Finally, activate the shake gesture helper, which binds to the phone’s accelerometer and starts listening to incoming sensor input events.



// start shake detectionShakeGesturesHelper.Instance.Active = true;

Trying to removing caching on JQuery Mobile

Having used JQuery Mobile beta 1.0a4.1 using the files jquery.mobile-1.0a4.1.min.js and jquery.mobile-1.0a4.1.min.css, when ever you open the dialog box in the main page, this causes JQuery Mobile to cache the history state of the page, adding the syntax #&ui-state=dialog which is fairly frustrating.

I have tried the following two methods to hide the content element so it is not saved in cache but to no prevail.

$("div[data-role*='page']").live('pagehide', function (event, ui) {
    if ($(this).children("div[data-role*='content']").is(".command-no-cache"))
        $(this).remove();
});

$('.ui-page').live('pagehide', function () { $(this).remove(); });

There has got to be a solution to this in the later versions of JQuery Mobile without altering the css or js files, or is this a known bug?

Otherwise from experience, you have to go back to v 1.0a2.1 to completely removing the cache but then you lose all the functionality of the select box which I use.

Friday, 8 April 2011

WP7: Tilt Effect on Menus

The Silverlight Toolkit for Windows Phone contains a Tilt Effect implementation as mentioned by Pete Vickers from Appa Mundi.

This basically allows you when pressing the ListPicker or MenuItem in WP7 to tilt slightly when you press it briefly on the screen.

To add it to your controls, you need an addition of an XML namespace definition and one dependency property set in your page XAML.

<phone:PhoneApplicationPage

xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 
toolkit:TiltEffect.IsTiltEnabled="True">

From my knowledge the implementation of tilt can only work with the ListPicker and MenuItems within the ContextMenu control. You can add additional types to receive the Tilt effect but check Codeplex for this. You can add the following to your App constructor:-

TiltEffect.TiltableItems.Add(typeof(ListPicker));
TiltEffect.TiltableItems.Add(typeof(MenuItem));

However this alone does not fix the implementation of the tilt effect inside the Context menu. If you apply the property to each entry in your ContextMenu it does use the feature:-

<toolkit:ContextMenuService.ContextMenu>
   <toolkit:ContextMenu>
      <toolkit:MenuItem toolkit:TiltEffect.IsTiltEnabled="true" Name="firstMenuItem" Header="edit" Click="FirstMenuItem_Click"/>
      <toolkit:MenuItem toolkit:TiltEffect.IsTiltEnabled="true" Name="secondMenuItem" Header="delete" Click="SecondMenuItem_Click" />
   </toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>

So in actual fact, the Silverlight Toolkit can be used for implementation of P7 tools, and is a great resource for additional controls and features which are not present in the Windows Phone 7 SDK. You can also use the Nuget which has even more packages to which you can apply within WP7.

Thursday, 7 April 2011

WP7 Emulator Screen Capture

For those that can’t seem to grab the screenshot correctly of their WP7 application, Pete Vickers from the WP7 Workshop had mentioned a program that can take a screenshot of your WP7 emulator with or without the image of the device in it.

The details of the application is here in this link (it is written by a developer called Cory Smith) which it essentially screen grabs the emulator of WP7. From what I have heard it works on 32 bit, but has issues with multiple monitors, and the screenshots are saved anywhere in the directory specified.

Remember to set the emulator zoom to 100% as Mike Ormond specifies for it to be a 480x800 PNG required by the Windows Phone 7 marketplace submission process.

http://www.innovativetechguy.com/?p=13

WP7-Simulator-Cropper

Monday, 4 April 2011

Useful Isolated Storage Tips #1

I had been very curious about IsolatedStorage in WP7 which is mentioned very much in application usage during the P7 workshops. basically it has been around in the framework for a long time, and it stores data in a file that us isolated by the user and by assembly for usage to minimise in such a way that another application cannot use that data.

The good thing about IsolatedStorage is that it is persistent in the application meaning it is permanent in storage, and can be used countless times, which is great, but used sparingly if possible as WP7 does not have an imposed quota size meaning it will continue using the phones storage until it can potentially run out, although it will give a warning when the WP7 phone has 10% of storage left.

Here are some code samples for IsolatedStorage for a text file: -

Saving New Text File To Isolated Storage

IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication();

//create new file

using (StreamWriter writeFile = new StreamWriter(new IsolatedStorageFileStream("myFile.txt", FileMode.Create, FileAccess.Write, myIsolatedStorage)))

{

string someTextData = "This is some text data to be saved in a new text file in the IsolatedStorage!";

writeFile.WriteLine(someTextData);

writeFile.Close();

}

Writing to Existing Text File In Isolated Storage

IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication();

//Open existing file

IsolatedStorageFileStream fileStream = myIsolatedStorage.OpenFile("myFile.txt", FileMode.Open, FileAccess.Write);

using (StreamWriter writer = new StreamWriter(fileStream))

{

string someTextData = "Some More TEXT Added:  !";

writer.Write(someTextData);

writer.Close();

}

Reading Existing Text File In Isolated Storage

IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication();

IsolatedStorageFileStream fileStream = myIsolatedStorage.OpenFile("myFile.txt", FileMode.Open, FileAccess.Read);

using (StreamReader reader = new StreamReader(fileStream))

{    //Visualize the text data in a TextBlock text

this.text.Text = reader.ReadLine();

}

Deleting Text File In Isolated Storage

Use IsolatedStorageFile.DeleteFile.

using(var store = IsolatedStorageFile.GetUserStoreForApplication()) 
    store.DeleteFile("myFile.txt");

Friday, 1 April 2011

Nokia Launchpad offers free Nokia E7 and WP7

nokialaunchpad

According from the news source Slashgear, Nokia is offering to members of the new launchpad application development program a free Nokia E7, and later a Windows Phone 7, that’s two free mobile devices with very large generosity, and I have been handed a Nokia N8 in the past so it’s all for real. 

My thinking is that Nokia would probably like to have a smooth transition from Symbian 3 to WP7 but also to satisfy the needs for both developers of QT and WP7 so to keep both communities happy. From what I know, the E7 would be very similar to the N8 with a 4” AMOLED screen and 8MP camera with HDMI support plus a textpad keyboard, so it should be slightly better than its predecessor. They are also offering free tech support for Nokia devices for next free months plus invitation to key regional and global Nokia events and trainings. Not a bad deal at all!

Join Nokia Launchpad at http://www.forum.nokia.com/Developer_Programs/Launchpad.xhtml

Wednesday, 30 March 2011

Social Media Buzz at the SMWF Olympia London

Today, after the scheduled office move today, was just settling in when I still decided to go to the Social Media World Forum in Olympia Conference Centers in London, to see what was the hype about social media marketing, and I wasn't to be disappointed.

There were so many companies showcasing their CRM and social media tools in this new age of social media marketing, that I simply couldn't keep up with all the terminology and brand names.

I went to hear the talks from Pete Simmons, European Web Producer from EA on Syncapse with Michael Wilson, Phil Szomszor, Director, Corporate Practice, Citigate on Brandwatch and Sara Davar, Area Director, Meltwater Buzz on Meltwater Buzz,   you can see the agenda here at http://www.socialmedia-forum.com/europe/workshop/agenda.

WP_000126

WP_000127

They were very interesting talks indeed especially from Phil and Sara, which they both shared similar views that the consumer is now in control of your brand, and it is about listening and providing value. Also to share viewpoints across the board, and offer any advice when needed to consumers. If it does get messy, take it offline, and don't end up like the PR Kenneth Cole on Egypt where tweets go wrong! They believed that branding is a strong point, and empowering your consumers with all the help and resources are very useful for building up the reputation.

I did manage to get a few leaflets and business cards from several companies at the stands, and its a great way to network!

Here are is a good link for some social media marketing tracking: -

http://paper.li/pekkapuhakka/Social-Media-Brand-Tracking

http://blendingthemix.com/

http://socialmediatoday.com/

And also a lot of hype about how social media marketing is successful at Old Spice: Responses Case Study http://adage.com/u/anjmrb

Tuesday, 29 March 2011

Long day at the office with moving & Moo Business Cards received

Today, was officially moving day, and with two days left before the final leave date, we had to pack our stuff into boxes and move to the next office building, it was slightly sad to leave our current office, but for reasons I don't clearly know, the building had to be knocked down in time for the Olympics. Here is the photo of packing my things into the SafeStore Boxes, and were given huge plastic containers for our PCs; I stayed later to move the customer care PC, and my boss's PC with 26in monitor whilst removing all the tangled cables in time for the maintenance engineers to unscrew the wide desks.

movingboxes

After a long day, I got good news that I received the Moo Business Cards for myself alongside the Android Orange San Francisco phone I ordered last week; the selected striping design with red and black messages in front are very stylish indeed and they were just as I intended them from the designs selected on the website, well done Moo for getting them sent earlier than expected! It ended on a particularly busy yet positive day!!

moocards

Registering Your WP7 as a Developer Device

As I had found out at the WP7 Workshop in Birmingham, I needed to register phone as a developer device, before I can run the project application onto the device in real time, and not on the emulator, as I had seen when connecting the device to Zune, running Visual Studio 2010 and press the Run button as “Windows 7 device”, the message was shown up as follows: -

applicationlaunch

To register the phone as a developer device, you needed to have downloaded the development tools for WP7 already, then once installed, you click the folder Windows Phone Developer Tools on the start menu, and click Windows Phone Developer Registration, with your phone plugged into the USB and connected to Zune already. You should see the following window: -

From there fill in your Windows Live details, and you are registered as a developer. Hopefully I should write more blogs like this in Windows Phone Developer as I learn more about the environment, and it would be my last post before the office move. Hope that helps!

Monday, 28 March 2011

Windows Phone 7 Workshop– Birmingham 26th March 2011

Over at the weekend, I went to the Windows Phone 7 workshop, the first one of four in the following weeks hosted by AppaMundi who create several WP7 applications Like Where’s My Car? & AppaTraffic.

The turnout wasn’t too bad, and it seemed pretty relaxing, and my friend and I really just got on with making the application, and they were at hand in helping out with Pete Vickers at our table.

We were given lots of free stuff including $299 worth of Mindscape controls http://www.mindscapehq.com/store?p=phone%20elements courtesy of AppaMundi, and many prize draws were done including a free XBox 360 with Kinect controller, books and phone cases. If you request this, I can supply the code for you.

I predominately spent the time setting up Zune, and was unfortunately that whilst the phone was downloading the updates, it crashed, and the only resolution was to reinstall Zune as I tried the phone on Pete’s computer and it had worked.

I was also running the WP7 Geolocation Emulator, which i eventually got working by supplying some sample data and using an external CS file that hardcoded the geolocation points, but wanted to test this live on my phone, which using Zune was the obstacle.

A useful thing I learnt was that GeoLocation API relied heaviliy on event handlers, and you can change to optimise the location accuracy of your GPS detection via the code below: -

geolocation

This also allowed you to pinpoint and write the latitude and longitude of your geo location onto a text box.

After reinstalling Zune, the phone detection worked but I realised you needed a developer account registered to the phone (sigh!), I will discuss this further in a later blog.

Mike Ormond even discussed standard guidelines on how to publish your WP7 application successfully on the market, and the do’s and dont’s of what to do.

After lunch, I worked predominately on layouts and databinding for my first that i am going to create which is a weather forecaster but will extend this capability to do more things. What I had found trouble was setting up the databinding to see the text in the designer view of the XAML code and spent several hours trying to find this out, eventually Pete had mentioed to use the templates in the Startup box of Windows Mobile 7 templates called the DataBinding, and in there you can actually hardcode an example data XAML file into the header of the main XAML page, and it worked!

Despite a very long train journey back with major delays to London due to a rare fatality in Wembley, causing most trains to be delayed for an hour and a half. I did find the event really useful and would like to go again next weekend at London.

Friday, 25 March 2011

Organising the train for tomorrow

For tomorrow’s Windows 7 Mobile workshop, I had researched what the cheapest price was to get from London to Birmingham, despite finding the very cheapest at £17.50, the times seemed too late to arrive to Birmingham as well as leaving at midnight. I had then been able to select a single ticket at £13.00 but does involve missing two hours of the event, as well as being on a relatively slow train at 2 hours 15 minutes.

trainfromlondontobirmingham

Once off the train at Birmingham New Street Station, the location is not too far away, about a ten minute walk to The Studio on Cannon Street.

 trainfromlondontobirmingham2

Today, I had booked the train ticket at a reasonable £30.00, £15.00 per single ticket one way which is fairly reasonable with reasonable train journey time of 1 hour 25 minutess, but does involve getting up at 6am, to catch the 7.25am fast train from London Euston to Birmingham New Street. Hopefully I can get some good ideas and a base project for a WP7 application by then.

trainfromlondontobirmingham3

Microsoft UK Tech Days 2011

Save the date 23-25 2011, as once again Microsoft is hosting the very elusive UK TECH DAYS at London Vue Cinema, Fulham Broadway, London.

Follow uktechdays on twitter for more information and registeration.

Register here at http://uktechdays.cloudapp.net/techdays-live.aspx

What’s on?

Just like last year, we’ll be running two tracks during the event, one aimed at IT professionals and one at developers. Here’s a taster of the content we’ll be covering:

IT Professional

- Deploying Windows 7 and Office 2010

- Virtualisation, Hyper-V and the private cloud    

- Moving infrastructure and platforms to the public cloud

Developer

- Building and deploying applications onto the Azure cloud computing platform

- The latest features and futures for Windows Phone 7

- Building rich applications with Silverlight 5

- Deep dives on the web platform, IE 9 and the HTML5

Register here at http://uktechdays.cloudapp.net/techdays-live.aspx