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