Saturday, January 22, 2011

Windows Phone 7 : A White Elephant in India ?

Hey guys, I am back here after a months time. I underwent medical treatment in hospital and now back to Home and started office.Soon I will keep the pace of articles here as well.

Today,I am one of the Proud Owner of “Windows Phone 7”, I got a big HTC HD7 device for me. It cost me around 28,500 INR, Its Super Duper Sexy Phone !

My Phone Journey so far : Symbian to Windows

Nokia 3315 –> Nokia N72 –> HTC P4350 –> HTC HD7

Above is cycle of my mobility and devices I had in past.Here she comes :

P1010250

Why I am moving to Windows Phone 7 :

Do I need to tell anyone here that I love Silverlight and Silverlight is main Application Development platform for Windows Phone 7 ? Yeah ! This is one of the reason. My Old Windows Mobile 6.0 was not allowing me to upgrade to Windows Mobile 6.5, This kept me away from many interesting things. My HTC P4350 was too bulky as well (It was with sliding keyboard and Touch as well), I am doing some book reviews on Windows Phone 7 and also some application development is in pipeline, Hence I moved to Windows Phone 7

What’s my first reaction after starting the Windows Phone 7 :

WOW ! UX is Sexy ! ..Nice smooth navigation, Fast operations, Amazing People HUB and other features. Hardware specs are way better that my earlier phones.My HD7 is big in size but for my Lion like Paw hands,I am finding it comfortable to use.

What I like about Windows Phone 7 :

  • Very Rich UI / UX
  • Simplicity
  • People HUB
  • Hardware
  • 3 Buttons only
  • Silverlight platform and OS (OS is still need to improve)

Why I call this Phone as White Elephant in India :

White (albino) elephants were regarded as holy in ancient times in Thailand and other Asian countries. Keeping a white elephant was a very expensive undertaking, since the owner had to provide the elephant with special food and provide access for people who wanted to worship it. – From some random Website

In short, Its very valuable and to keep it running, A cost involved in this, A Device Cost ! Application Cost ! Tools for Application Development Cost ! Investments on learning the platform is a Cost ! Paying Developers and others in the ecosystem is a Cost ! Microsoft is final cost while going to Marketplace !

A Costly affair !

Below are some issues which I came across from past few months while taking this phone to the community, I am not here to throw shit on Microsoft that they are not providing us “Copy Paste”,Soon they will and will do much more but what about current fiasco happening in India?

Few things comes to my mind :

  • Will Common man of India can use this phone? (Salary man, Students,Government Servants whose salaries are normal scale)
  • Will Students learn to Develop Apps for this Phone if they get this phone in low cost, will that improve Education Process?
  • With the growing number of cyber crimes, will people feel safe to use apps for this phone?
  • Device cost ! (Expecting few cheaper devices)
  • What's the deal? for those who might want to migrate from Nokia(Symbian),Android,Blackberry or old WM guys (Android and iPhone % will be very low because of their strong presence in India)   

HTC HD7 Need to Improve ! :

  • Where is my free Phone Cover which use to come with Box ?
  • Back Slide cover of HD7 on Battery and Sim is so slim which I fear will get break sooner or later
  • There is a small hairline gap in back cover and base at back side which I have observed in other HD7 as well
  • I don’t like the Headphones, Not that classy !

List of Problems for Windows Phone 7 not becoming strong phone platform in India :

  • No damm clue about Marketplace for India
  • Out of 10 Devices, Hardly 1-2 available in stores
  • Locked Unlocked? Who cares?
  • Device availability and Cost
  • Service providers tie up for Add on services
  • Migration of Old WM 6.x apps, No guidelines for newbies
  • Learning Resources (MOC, Sessions from Microsoft locally)
  • Microsoft Partner awareness is not happening upto the mark
  • Learning Silverlight

Business, Outsourcing problems for Windows Phone 7 in India :

First question business fellows asks,if my US parent Co or partner/client not sending any projects on WP7 to India, why me and my team should explore it? We have tons of good things to do.

There is a need for Silverlight Resources to have grip on project if at all you get any still chances are low to get success expected.

No Marketplace for India,what will you do with your App? Show them to your neighbors? or Girl Next Door to impress her ?

Who will train my employees on Windows Phone 7, Where is Microsoft Official Curriculum for this ? Hands On Labs? Sessions?

If I build app for my own company, I distribute the phone to X number of employees, Do I need to upload my In house app to Marketplace? No Side loading !

So called “Problems” in Windows Phone 7 Ecosystem in India :

I am listening this from ages now “We are working”, “Keep the faith”, “In India it takes time !”, “Nothing gets first in India though majority of things are developed from here”, “Government Rules and Regulations is a massive headache and long process" due to that there is a delay”,”Payment gateways for Mobile transactions”.

People in India have no clue about this phone and its availability and Marketplace, Lack of Advertise and awareness. Sometimes I fear it might get killed big way in India. If above are the problems for Windows Phone 7, why are not the same for Android,Blackberry and other phone platform? Something needs to be fix !

Its 28.5 k phone for me and right now its just another phone for me because there is no Marketplace for India ! Isn’t it like keeping White Elephant??

So..should I continue using Windows Phone 7 ?

Now comes the part 2 !

Yes ! keep the faith in Windows Phone 7 platform. Look at the History of Microsoft products, They invest lot of valuable time and resources to shape this up ! This is not going to get kill.

Quality is the key !

Strict quality norms for Application Submission for Windows Phone 7 makes this app market unique.

Microsoft was the leader in past and will be leader in future :

With the strong presence of Windows Embedded and Windows Mobile series in last decade, Microsoft took a large gap and now they are coming back, They are not just coming back with yet another OS for mobile but coming up with some Vision which covers Phone, PC, Cloud and other Software Services talking to each other.

Microsoft is not doing like other vendors like launch device, give the tools and let whatever happen in the world. Microsoft is giving full Ecosystem for best experience to end users.

So keep the faith and get your Windows Phone 7 device today ! I did it..now its your turn !

A humble request to Microsoft for Windows Phone 7 in India :

  • Ads,Buzz – Let people feel there is something “Windows Phone 7” around in India.
  • Marketplace – As soon as possible before we lost our minds and phones.
  • Learning Resources – From Students to Enterprise App Developers.
  • Presence of Device in Consumer shows and to consumers.
  • Price (This is for Vendors and not for Microsoft)
  • Availability of devices in all possible hardware specs.
  • Multi-lingual aka Indic support – Render/Support Indic on Mobile (WM6 use to do that !)
  • Be more visible for Windows Phone 7

My last 2 cents !

Till now, you must have feel that I am not happy with the Windows Phone 7,No ! I am very much happy but not happy with the current scenario for Windows Phone 7 in India. Though I have thrown lot of stones here, I will be still going ahead with Windows Phone 7 (Silverlight in between as on when it comes) in near future. So do expect some more stuff on Windows Phone 7 in coming days ! Picture speaks 1000 words,so here it is :

ILWPmtp

Vikram.

Saturday, December 4, 2010

Silverlight 5 : What’s there for you and me

I am taking small break in our “Silverlight On Mobile” series for this post. I will not say I am glad but I will say I am happy after what happened at PDC 10. Microsoft Announced The Future aka “Silverlight 5" which is a great breakthrough build coming up if you look at the features list.However there is a still “To be..or not to be..” kind of situation for many of the people after PDC10,but after Scott Gu’s keynote, Vision and Mission is clear for Silverlight from Microsoft.So you can take a beer and relax !

This time..Message is clear : “Future is Bright and Future is Silverlight”

ScottGu

All the fiasco happen due to HTML5 statements in PDC10, tons of things happened across RIA community. Again, Let me tell you from my personal experience, Silverlight is far better choice for LOB/Enterprise RIA Apps than other RIA platforms available and it’s the only choice to build Windows Phone 7 Applications as well.

Before I Copy Paste Silverlight 5 Announced Features, Let me throw my expectations and also let me know your views on the same.

What I am looking at Silverlight to give me in near future …

  • Support for Enterprise Library
  • Support on Blackberry platform like we have on S60
  • Support for Reporting – SSRS specifically
  • Cross Platform – Write Once and run on various platforms
  • Better Profiler tool
  • Simple and Easy to understand Documents/HOL on Silverlight LOB and RIA Services,MVVM pattern

My 0.02 $ on Silverlight 5 and HTML 5, JQuery, Extjs, Flex and other friends :

I may sound Anti Silverlightian here but facts are facts, There is a great demand coming up from end users to get rid of Plug-in methodology and have consistent user experience across Browser and platform,let it be any browser on desktop or mobile devices. Tools and Technology cost should be such that all startups and big shots can go for easily.Right now,people already started Silverlight and HTML 5 comparison Head to Head and which is acceptable in the current business scenario in the world. I am not second to express failure of either and have equal keen interest in HTML 5 being WebDev guy but after announcement of Silverlight 5, I somehow feel that Silverlight has to be in game for a long and with much more different role. I personally do not think that HTML 5 or parallel technologies will kill Silverlight. However they will grow by design and even offer few things which Silverlight is doing today,but I think by that time Silverlight will be in much more good position and will be a unique platform with lots of offerings, So let’s not give away our faith and work we are doing or already done. So be happy..Relax..Silverlight is Silverlight ! ..and it’s the Future of RIA.

Silverlight 5 bits are not for download but you can download the Firestarter event stuff at :

Hands On Labs : http://www.silverlight.net/news/events/firestarter-labs/

Videos : http://channel9.msdn.com/Series/Silverlight-Firestarter?page=1

WCF RIA Services Toolkit December 2010 :

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6f834bf7-ffde-4d5d-8573-18541762118b&displaylang=en

Silverlight 5 Features announced by Microsoft :

Premium Media Experiences

Silverlight 5 offers improved media support and rich UI capabilities:

  • Hardware Decode and presentation of H.264 improve performance for lower-power devices to render high-definition video using GPU support.
  • TrickPlay allows video to be played at different speeds and supports fast-forward and rewind. At up to twice the speed, audio pitch correction allows users to watch videos while preserving a normal audio pitch.
  • Improved power awareness prevents the screen saver from being shown while watching video and allows the computer to sleep when video is not active.
  • Remote-control support allows users to control media playback.
  • Digital rights management advancements allow seamless switching between DRM media sources.
Business Application Development

Silverlight 5 is Microsoft solution for building next-generation business applications:

  • Fluid user interface enables smoother animation within the UI. Inter-Layout Transitions allow developers to specify animations to apply when elements are added, removed or re-ordered within a layout. This provides smoother user experiences when, for example, items are inserted into a list.
  • Text improvements make it possible to build rich magazine-style text layouts:
    –     Multicolumn text and linked text container allow text to flow around other elements.
    –     Tracking/leading set precisely how far apart each character is for full creative control.
    –     Text clarity is improved with Pixel Snapping.
    –     Text layout performance is significantly improved.
    –     OpenType support has been enhanced.
  • Support for Postscript vector printing enables users to create reports and documents, including the ability to create a virtual print view different from what is shown on the screen.
  • Applications can now work the way users expect with added support for double-click and Combobox type ahead.
  • Databinding enhancements allow more work to be done more easily via XAML:
    –     Debugging support now allows breakpoints to be set on a binding, so you can step through binding failures.
    –     Implicit DataTemplates allow templates to be created across an application to support a particular type by default.
    –     Ancestor RelativeSource allows, for example, a DataTemplate to bind to a property on the control that contains it.
    –     Binding in style setters allows bindings to be used within styles to reference other properties.
    –     The DataContextChanged event is being introduced.
    –     Markup extensions allow code to be run at XAML parse time for both properties and event handlers, enabling cutting-edge MVVM support.
  • Networking and Windows Communication Foundation enhancements:
    –      Reduced network latency by using a background thread for networking.
    –      WS-Trust support: message security — encrypted at the Windows Communication Foundation level; Security Assertion Markup Language authentication token.
  • Silverlight 5 performance improvements include these:
    –     Reduced network latency by using a background thread for networking.
    –     XAML parser improvements that speed up startup and runtime performance.
    –     Support for 64-bit operating systems.
  • Graphics improvements
    –     Graphics Processing Unit (GPU) accelerated 3-D application programming interface (API) provides rich graphics on the Web for building advanced data visualizations and rich user experience (UI).
    –     Immediate mode graphics API allows direct rendering to the GPU.
    –     Hardware acceleration is enabled in windowless mode with Internet Explorer 9.
  • Silverlight offers a new class of trusted applications that brings desktop capabilities to the browser for the first time. These features, when enabled via a group policy registry key and an application certificate, mean users won’t need to leave the browser to perform complex tasks:
    –     Host HTML content as a Web browser control within the Silverlight application. HTML pages, such as help content or e-mail, can be integrated within the application.
    –     Read and write files to the user’s My Documents folder, making it easier to find media files or create local copies of reports.
    –     Launch Microsoft Office and other desktop programs. Users can open Microsoft Outlook and create an e-mail message, or send a report to Word utilizing the power of Office.
    –     Access devices and other system capabilities by calling into application COM components. Users can access a USB security card reader or a bar-code scanner.
    –     Enjoy full keyboard support in full screen, which enables richer kiosk and media viewing applications.
    –     Call existing unmanaged code directly from within Silverlight with P/Invoke.
  • Out-of-browser trusted applications are further enhanced:
    –     Existing unmanaged code can be called directly from within Silverlight with P/Invoke.
    –     Child Window support allows multiple windows to be launched from the application.
  • Tools improvements include these:
    –     Microsoft Visual Studio profiling support including CPU, memory, thread contention.
    –     Visual Studio Team Test support.

So..Let there be light ! ..Silverlight !!

I will be back soon with Windows Phone 7 and much more on Silverlight in Year 2011

Vikram.

Sunday, November 14, 2010

Silverlight On Mobile : Lost Windows Phone 7 Device ? Here is quick help

Nice to open Live Writer after a long time. I was in hospital for one week and went under two surgeries,I was suffering from Hematuria due to kidney stones, Now much better and recovering but still locked at Home.Best thing is now I can use laptop and move bit here and there so I again started looking at Tech Stuff back. More I will start with full zest in coming weeks once I recover totally since I might go for one more operation in coming weeks.

Recently My friend lost his cellphone somewhere in crowd,He told me some story about how he can track device etc. Suddenly come to my mind, is something possible with Windows Phone 7? Windows Phone 7 though its good phone but its truly costly affair if you lost it.Especially the higher cost Devices like Dell and HTC HD7. So I started exploring this issue and found few good things which I want to share with you today. However it has already been shared by many who hold actual device, Since I don’t have device and neither it will be available in India soon, So I am trying my level best about how you can go for that.

Windows Live ID :

Windows Live ID plays a vital role here. If you have Windows Live ID, Life is easy for you.So if you don’t have, get one today !

To Do on Day One once you have Device :

Many common fellows who are non techy might not aware about this, There is a Live Service dedicated for Windows Phone or Windows Mobile in general which you can opt with Live ID at :

windowsphone.live.com

Here you will find screen like this :

Start

Though I don’t have device at the moment,but here are few things which you can get hold on once you have device in hand with help of windowsphone.live.com

Universal steps :

1. Go to your browser on PC, Login to windowsphone.live.com with Live ID

2. Choose “Find My Phone” Option and take it further

This option branched with multiple capabilities below this like :

  • To make your phone ring
  • To map your phone’s location
  • To lock your phone and show a message
  • To erase your phone
  • To change settings to Find My phone

Lets see what each option is capable of :

1. To make your phone ring : This option is not so powerful for lost phone since the actual device is far from you. But lets assume you lost device in your nearby area or home or office,Then all you need to do is sign-in with Live ID on windowsphone.live.com and then Under “Find My Phone” option choose “Ring it”. This will Ring your phone even if volume is off or its on Vibrate mode (Silent mode we call it as). Also you will be able to Preview the ringtone. (Remember the old Cordless Phones in our house with “Find Device” button and it use to buzz the device, this is something similar to that).

2. To map your phone’s location : This option will help you to give actual physical location of device via power of Bing Maps. It also have Print Map option which will allow you to take print out of the last known position of device on Map.Options like “Center Map on my phone” will help you to keep track if you by chance scroll the map and lost the location.Once you identify the location on map you can choose Option 1 to Ring it and go near to it. (No wonder ! Power of GPS and it will highlight the area under which Cell tower area it falls)

3. To lock your phone and show a message : This will lock your phone and no one can use it by any means, However you can unlock by entering 4 digit number,Also you can customize the screen with custom message something like this : “I have lost ! if you find me then please call at (+91)-020-1112-333 or email me at something@something.com or drop it to near by police station”. This will atleast make sure that no one will play with your phone,personal data,pictures,videos and other stuff on your device.

4. To erase your phone : I call it as “Do or Die” option, if all of the above three does not work and you lost all hopes, still it is important to make note that your data(Phone Data,SMS,Numbers,Pictures,Videos etc) are still there and can be misused.So to prevent this, This option will allow you to erase data on your phone and make it dumb device.Oh yes ! it does give “Yes” “No” option so be wise to choose any.(There is no comeback once you click on “Yes”)

5.To change settings to Find My Phone : This is core important option,It allows you to achieve two things : (For this you need to Flick left on Start dashboard and go to App list and choose Settings)

1. Save my location periodically for better mapping : Microsoft with this option will save your phone’s location details periodically (Hourly basis usually),So if your phone goes out of coverage area or battery goes ga ga and die still it will help to save last location position on map (Then onwards its Police job isn’t it?)

2. Get Results Faster : This might cause more battery consumption however by this Live Service will send text message to your device or Push notification is another cheaper option suggested.

So ! Once you get your Windows Phone 7 in your hand fully functional and operable, You must check out this options and do the needful so that by chance or due to bad luck you lost device, there is a hope ! Not all Non techy people are aware of this or not aware of such services, So I encourage you to pass on this information to them as best as you can.

I will recommend this post for more pictorial info on this topic :

http://antondnagy.wordpress.com/2010/09/06/ways-to-recover-your-lost-windows-phone-7-device/

Well in all case, if there is real lost of device, Advisable to let your Service Provider know about it and provide information for the same, This is very important to do as well once you lost your device. This is bit complicated topic and can lead to several branching discussions like damaged device recovery or insurance etc. which at least at this moment I don’t find worth to talk on, So keeping those things to you to explore. As I said I don’t have device in hand, But Once I get I am going to repost this again in much more details so that you can get more in-out stuff of this. Also I will drop more focus on such services for phone in coming future. Let me recover soon and I have few more good things to share with tons of Code and XAML, So give me some more time and I will be back with loads of stuff here. Do keep an eye on this place.

Vikram.

Thursday, November 4, 2010

Silverlight Vs HTML5 : You and Me

In India, we every year celebrate “Diwali” festival which is festival of Light which helps to find path, Its win over dark and all good days to start new things. I am celebrating Diwali festival with my parents in our new home, So I will blog our Tech stuff on Silverlight and WP7 very soon once the festival is over.

However, I am suffering from mild frustration from last week, The Day PDC 2010 Keynote got away, You all know what fiasco and discussions happening all over internet for Silverlight and HTML 5.I am not HTML 5 Guru and neither I am against of any technology.You all know I never write such articles and philosophical stuff which is infinite. I always do tech stuff,but this time pain is so much and so much I suffer in last week, I cannot help myself so I am kind of sharing this with you.Who better can talk on this-a Silverlight MVP.

This blogpost is for those people who just chosen “Silverlight” as platform and new to Silverlight and now victim of this endless fight of Silverlight Vs HTML 5.Idea behind this post is not to pat on back or praise any technology or company.Also I am not interested to put so many Hyperlinks in this post about who saying what on Silverlight Vs HTML 5. I know shit is all over and I don’t need to put it here.

History :

At Microsoft, There is a product “Silverlight” which created wonders in Rich Internet Applications arena around the world from last few years.Despite there were so many other parallel products already in market like Flash, JavaFx etc. Slowly over the period of time it got stable up with decent amount of features which one can imagine and its now a trend.

Cross browser – Cross platform,Rich in looks, Simple to Implement and flexible and which can address day to day business apps scenarios is the simple vision behind Silverlight. (Correct me if I am wrong here). Vision is still the same rather its getting mature by each version.

You :

Silverlight made its presence on Web, Then Out of Browser and now with Windows Phone 7 on Mobile. If some technology is addressing such things, How can it be dead in one day by just one announcement or blog post? Think Twice !!

I do not want to promo any links here just to showcase how Silverlight is wonderful, you all know, tons of apps are out there ! Choosing “Silverlight” for your application as a core platform and then going on with client, I know how much difficult life is ! But with the amount of resources available today, Life is simple.SDKs and Tools are available and decent enough to develop LOB/Enterprise apps.

Don’t waste your valuable time in thinking about HTML5 and what will happen in future. Right now keep focus on your current Silverlight development and upcoming Silverlight development and see how you can do it best with Silverlight.

So, Please please please ! Silverlight is not dead ! If someone told you that then he/she is not your well wisher !!

Me :

I will be here as long as Silverlight technology is here, Even though in future I may not have MVP title but still I will be blogging about Silverlight and related stuff at my best.So don’t worry, This blog is not dead and neither this is my last post. I will be back !

I am available here or on my email id, so please feel free if you have any questions about adopting Silverlight Technology.

In short :

  • Apps are mostly build on top of facts and reality and not only on predictions and philosophy,views of public.
  • Windows Vs Linux, ASP.NET Vs PHP, Silverlight Vs Flash – Ok to read on it while having cup of coffee. Don’t make your business decision only on top of them.
  • Clarify your doubts,concerns,feedback with Microsoft via Right Channels  - Forums, Community, MVPs
  • Create Simple POCs based on Silverlight before going to large implementations, Do deep dive analysis and then go ahead
  • Understand Silverlight Architecture and overall technology
  • Try your best to relate your business needs with features provided by Silverlight so as to come closer to final solution

Bottom-line :

Silverlight is not dead and got a great future ! Tech journalist will not come down to your office and help you in building POCs on Silverlight or HTML5, So make sure you verify the information.

“This Vs That” posts will not add value to you or your customer or your community, Live in real world !

Think first about your customer needs and how better you can serve him, then think about Technology then no matter what it is Silverlight or anything else, Go with it !

Well, I hope you got the message what I want to say here, Keep all the HTML 5 Vs Silverlight stuff aside, open your Visual Studio, File > New Project > Silverlight .. Start !

Silverlight..long live !!

Vikram.

Monday, October 18, 2010

Silverlight On Mobile : Launchers in Windows Phone 7

I hope you like my earlier article on EQATEC Profiler for Windows Phone 7. Today I am going to discuss on another interesting topic as ‘Launchers’.This is very important topic from application development perspective which will allow developers to use some phone specific functionality like Calling, Sending SMS via application which can be either done with functions who are built in the phone.

As per MSDN,Launchers defined as :

A Launcher is an API that launches one of the built-in applications through which a user completes a task, and in which no data is returned to the calling application.

There are many scenarios in which you need to integrate the Calling,SMS etc which are default features of the device but since it’s a sandbox modal you might not be able to grab that directly,Hence APIs comes into picture and this is how Launchers becomes unique for your Windows Phone 7 Application.

Launchers usually take parameters and execute tasks, Their job is not to return something back to the application since we always invoke them with some parameters which we want to process with specific task.Hence you will not find any thing getting return back to the application.This is the default behavior of Launchers.There are several types of launchers however today I am not going to talk much on Marketplace Task etc since its totally a different topic and I will address that in future. Today I am going to cover basic Tasks like Calling, Sending SMS, Search Task and WebBrowser Task etc.This is very useful in case you want build some notification or alert message sending app.

Lets see the Coding part here,I am taking simple Listbox having items as various Launchers or Tasks which can be used from underline API.

XAML Code :

<ListBox x:Name="lstLaunchers" SelectionChanged="lstLaunchers_SelectionChanged">
<ListBoxItem x:Name="lstmphcall" FontSize="24"  Content="Phone Call Task"/>
<ListBoxItem x:Name="lstmsms" FontSize="24" Content="SMS Task"/>
<ListBoxItem x:Name="lstmemail" FontSize="24" Content="E-mail Compose Task"/>
<ListBoxItem x:Name="lstmsearch" FontSize="24" Content="Search Task"/>
<ListBoxItem x:Name="lstmweb" FontSize="24" Content="Web Browser Task"/>
</ListBox>

Namespaces :

using Microsoft.Phone.Tasks;

C# Code :

private void lstLaunchers_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            switch (lstLaunchers.SelectedIndex)
            {
                case 0:
                    PhoneCallTask phcalltsk = new PhoneCallTask();
                    phcalltsk.PhoneNumber = "+919122333444";
                    phcalltsk.DisplayName = "Vikram Pendse";
                    phcalltsk.Show();
                    break;
                case 1 :
                    SmsComposeTask smscotsk = new SmsComposeTask();
                    smscotsk.To = "+919122333444";
                    smscotsk.Body = "Party @ Hard Rock Cafe 10 PM Onwards";
                    smscotsk.Show();
                    break;
                case 2:
                    EmailComposeTask emlcotsk = new EmailComposeTask();
                    emlcotsk.To = "sweetheart@example.com";
                    emlcotsk.Body = "Hello, How are you doing? Can we meet on this weekend? Do reply, Vikram.";
                    emlcotsk.Cc = "romeo@example.com";
                    emlcotsk.Subject = "Hi!";                   
                    emlcotsk.Show();
                    break;               
                case 3:
                    SearchTask sertsk = new SearchTask();
                    sertsk.SearchQuery = "XBox game trailers";
                    sertsk.Show();
                    break;
                case 4:
                    WebBrowserTask webrwtsk = new WebBrowserTask();
                    webrwtsk.URL = "http://www.microsoft.com”; 
                    webrwtsk.Show();
                    break;
                default:
                    break;
            }
        }

So this is how you can integrate Launchers in your application. I am calling each in my Switch() and each case represents each functionality like Calling,Sending SMS etc. Please make a note that since you are doing this on emulator which have some limited functionality,hence you might not able to see few things like email unless configuration is made which is limited due to emulator.

I demonstrated the simplest way,Now you must have understood that how easy it is to integrate in your app. See some of the output shots here which will give you feel of these Launchers.

laun1          launcall

launsms          launsearch

launweb

Hope you will find this useful while building your apps. Media and Marketplace Task I am leaving to you to explore.I might not talk on Choosers in next post but soon I will cover that as well, I have few more interesting stuff in upcoming post. So be here and keep visiting this place.Lot more to come on Windows Phone 7 in coming days.

Vikram.

Tuesday, October 12, 2010

Silverlight On Mobile : Using EQATEC Profiler for your Windows Phone 7 Applications

I hope you like my last article on Invoking WCF service in Windows Phone 7 Application, with that article we are soon moving to CRUD operations, Data Binding and will soon explore various navigations and other features of Windows Phone 7

Today I am writing down this small informative article just to let you all know that we now have World’s first ever Profiler for Windows Phone 7. Two days back I came across it,I downloaded and evaluated at my end. I find it very interesting and useful,so I thought I should go ahead and share with you all. So those of you are building apps or already developed apps for Windows Phone 7, This is the right tool for you to check in and out of performance and other things about your application.

Where to get Profiler :

Profiler is developed by EQATEC folks and you can check their website for more information. They have profiler for Silverlight,CF and others as well. Simple download, Free version I have downloaded and I will be using that for this article. You can find forums,FAQs and other information on their portal.

eqatec9

You can visit for more  : http://www.eqatec.com/Profiler/Home.aspx

Build :

Installation process is very simple and straight so no twists and turns in that. Once you installed this profiler, Start it !

eqatec1

This is the initial screen you will be getting once you start the Profiler. You are suppose to click on “Browse” button to locate your application dll (Not XAP) which you can find in Debug folder.You will also get various options for the overall Profiler environment by clicking on “Add options”, you will get following window for more options :

eqatec2

Once you pick your dll, then you need to click on build (profiled version) and then click on Run.

Run :

Once you hit “Run” button, it will prompt you and you need to specify whether you are connected to actual device or an emulator. In my case,its emulator :

eqatec3

Once you make a choice, it will port your app and you then need to wait till app gets started on any.

eqatec4

Once your application starts, you will find that “Take snapshot” and “Reset Counters” buttons on Profiler are enabled, so now you can start profiling and taking snapshots as per your requirements.

eqatec5

You can take multiple snapshots and you can see them listed in “snapshot reports” option from where you can view individual.

eqatec7

View :

Once your snapshot activity is over, you can see individual report (.eplog) file by selecting it and clicking on “View” like this :

eqatec6

eqatec_rep

eqatec_repo

In this way you can find each small details with your app.

Compare :

EQATEC Profiler provides facility to compare to profiling reports, In this way you can compare your results and can do needful with your app. You are suppose to select two which you want to compare from UI and then you will be getting comparison amongst the two.

eqatec8

That’s all from my side today about the Profiler for Windows Phone 7. I encourage you to kindly download and evaluate this World’s first Windows Phone 7 emulator, If you have actual device by chance or wish to see how it will work on actual device, then check this Channel 9 Video :

http://channel9.msdn.com/posts/Worlds-first-profiler-for-Windows-Phone-7

Keep visiting this place, tons of stuff coming on your way for Windows Phone 7 and Silverlight.

Vikram.

Sunday, October 3, 2010

Silverlight On Mobile : Invoke WCF Service and Data Operations in Windows Phone 7

I hope you like my last post on InputScope.Many of you dropped me email and asking about Data representation and Data binding,operations on Windows Phone 7.Till now I kept prime focus on basic structure and functionalities,capabilities of device.Now we are in good position to talk about data,So let’s talk about it today.In past, I have wrote decent amount of articles on Data Binding and CRUD operations using Grid,DataForm in Web version of Silverlight. Thanks for your massive positive response for that.Now let’s see what we can do on Windows Phone 7 with the Silverlight Framework available on it.

I am going to split this article in 2 parts :

  • Adding WCF Service to Windows Phone 7
  • Doing Insert Operation using WCF service with SQL as backend

For this example,I am using a simple table schema in SQL as :

Constraints Field Name Data Type Null / Not Null
PK (Autogen) empno int Not Null
  ename nchar(10) Allow Null
  deptno int Allow Null
  salary int Allow Null

* Data Types are just taken for sake of Demo,In reality I encourage you to choose proper Data Types which are suitable

I am using same Project Template i.e Windows Phone 7 Application, So nothing rest is changed for this. After doing above schema,you can put your records in it or have your own schema instead.Now lets talk about first part which is Adding WCF Service to Windows Phone 7

Adding WCF Service to Windows Phone 7 :

Many of my friends told me that they have some issues on Adding Reference through Visual Studio and also with generation of Config file with WCF. Frankly, I never came across this with my instance of Visual Studio, But by chance if you, then you can try with command line utility “SLSvcUtil.exe” for this purpose like this :

slsvcutil

In normal scenario, You need to add WCF Application Project to your solution like this :

addingwcf

Here goes the Service Code :

Service Contract :

[ServiceContract]
    public interface IService
    {
        [OperationContract]
        bool InsertEmployee(Employee emp);
    }

Operation Contract :

[DataContract]
   public class Employee
   {
       [DataMember]
       public int EmpNo { get; set; }
       [DataMember]
       public string EmpName { get; set; }
       [DataMember]
       public int DeptNo { get; set; }
       [DataMember]
       public int Salary { get; set; }
   }

Implementation :

public bool InsertEmployee(Employee emp)
        {
            bool Inserted = false;
            Conn = new SqlConnection("Data Source=.;Initial Catalog=EmployeeWP;Integrated Security=SSPI");
            Cmd = new SqlCommand();
            Conn.Open();
            Cmd.Connection = Conn;
            Cmd.CommandText = "Insert into  Employees Values (@EmpName,@Salary,@DeptNo)";
                      
            Cmd.Parameters.AddWithValue("@EmpName", emp.EmpName);
            Cmd.Parameters.AddWithValue("@DeptNo", emp.DeptNo);
            Cmd.Parameters.AddWithValue("@Salary", emp.Salary);

            int ins = Cmd.ExecuteNonQuery();
            if (ins > 0)
            {
                Inserted = true;
            }

            Conn.Close();
            return Inserted;
        }

* I am using “Select” query for demo purpose, it might not be in “Best Practice” format, so do the needful in your application or have Stored Procedure. Also Empno is Auto generated field so no parameter for that.

So,part one is over.This is how you can add WCF service to your Windows Phone application. Like Insert I have done here, you can add Update,Delete and Select methods as per your application demands.May be in coming days,I will demonstrate full CRUD operation scenario,but to start with it,its I think sufficient. Also not that,since it’s a demo, I have not hosted it on IIS and working fine for me,In reality, you need to host it as a “Best Practice”

Doing Insert Operation using WCF service with SQL as backend :

This is our second part of article, Here we will create a simple UI and invoke WCF service we created above, We will refer this service and pass data via UI to service and then finally service will do the needful and we will have relevant data in Database.

XAML Code :

Title Panel :

<!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="Explore .NET with Vikram Pendse" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="Add New Employee" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}" FontSize="40"/>
        </StackPanel>

Layout :

<!--ContentPanel - place additional content here-->
       <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
           <TextBlock Height="33" Margin="0,39,0,0" TextWrapping="Wrap" Text="Name" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Left" Width="88" d:LayoutOverrides="GridBox" FontSize="21.333"/>
           <TextBlock Height="43" Margin="0,114,0,0" TextWrapping="Wrap" Text="Dept No" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Left" Width="88" FontSize="21.333"/>
           <TextBlock Height="45" Margin="0,189,0,0" TextWrapping="Wrap" Text="Salary" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Left" Width="73" FontSize="21.333"/>
                      
           <TextBox Grid.Column="1" Height="73" Margin="108,22,8,0" x:Name="txtname" TextWrapping="Wrap" VerticalAlignment="Top"/>
           <TextBox Grid.Column="1" Height="73" Margin="108,95,8,0" x:Name="txtdeptno" TextWrapping="Wrap" VerticalAlignment="Top"/>
           <TextBox Grid.Column="1" Height="73" Margin="108,169,8,0" x:Name="txtsal" TextWrapping="Wrap" VerticalAlignment="Top"/>

           <Button Content="Submit" Height="75" Margin="116,0,185,250" x:Name="btnSubmit" VerticalAlignment="Bottom" Click="btnSubmit_Click"/>
       </Grid>
It will look like this :

 

Add Service Reference :

reference

C# Code :

General Declaration :

MyServiceRef.ServiceClient Proxy;
bool IsNewInsertFlag = false;

Constructor :

// Constructor
public MainPage()
{
        InitializeComponent();

       Proxy = new MyServiceRef.ServiceClient();
}

Code to Insert Record :

private void btnSubmit_Click(object sender, RoutedEventArgs e)
{
      IsNewInsertFlag = true;
      if (IsNewInsertFlag == true)
     {                
         Proxy.InsertEmployeeCompleted += new System.EventHandler<MyServiceRef.InsertEmployeeCompletedEventArgs>(Proxy_InsertEmployeeCompleted);
        Proxy.InsertEmployeeAsync(new MyServiceRef.Employee (){EmpNo=0,EmpName=txtname.Text,DeptNo=Convert.ToInt32(txtdeptno.Text),Salary=Convert.ToInt32(txtsal.Text)});
      }
}                  

void Proxy_InsertEmployeeCompleted(object sender, MyServiceRef.InsertEmployeeCompletedEventArgs e)
{
     bool Res = e.Result;
     if (Res == true)
     {
         MessageBox.Show("Record Added Successfully !!");
     }
     else 
     {
         MessageBox.Show("Unable to Insert record,Try Again !!"); 
     }
}

Done !, So now hit F5 and put one record to test like this :

InsertIntoAfter Clicking on Submit, It will insert new record and send note on UI like this :

success
So,here is end of our second part and hence the article. You can enhance the UI part as per your design skills and you can add some InputScope,Jazzy background or styles depends on your application. I will surely try to bring more jazz in this app in coming days and will try to cover full functional CRUD. Till that time you guys go ahead and give a try for this. I tried to make things simple,but if you feel or have or want to share more simple way than this, Please do give me feedback so that I will make note of that in my coming articles. I am coming with much more stuff soon including Silverlight 4 and Windows Phone 7,So keep visiting here..lot more to come !

Vikram.