Thursday, June 23, 2011

Your first Windows Phone 7 App is just a few keystrokes away.

Hi, just by looking at the title of the article don't think that this isn't for you, in fact this article is intended for all those who is interested in knowing how a mobile app is being developed and deployed. And to understand this you need not be a hard core developer or not even required to be working in telecom domain, but just an urge to know and learn is enough.

Before actually getting into our first app development, let me brief you about the current state of the art of mobile phone application development. Mobile apps are being developed for multiple platforms and the current well known platforms which are buzzing with high app development activities are,
Apple iOS
Windows mobile.

All of these platforms have their own well established developer communities well known as "ecosystems", developers from these ecosystems constantly contribute to the community by developing apps which fall into wide range of categories, like Business, Entertainment, Utility, Multimedia, etc..
The well known app stores of today are OVI store by Nokia, iStore by Apple, Market Places by Microsoft and Android Market by Google.

In this article, I'm going to show you how an app can be developed for windows phone 7. I have chosen windows phone not because I'm biased, but simply because of the fact that it's very easy to set up the development environment, straight forward to understand, and very less development efforts.

So, Let's get started.
By the time this article was written Microsoft had just released beta version of Window Phone 7.1 developer tools. But since this is an introductory article to Windows phone app development I'm sticking to Windows Phone 7.0 development environment.

The minimum requirement to have windows phone 7.0 development environment is that your machine should be running at least windows 7 OS, next
1) Download SDK from here
2) Apply patch
By now your dev environment for windows phone 7.0 is up and running, The windows phone applications are Silverlight applications written in "C#" language and will be running on  silverlight framework

As our first application I'll be showing how to create a log in page for Facebook application.
After you've installed the Windows Phone Developer Tools, the easiest way to create your first application is to use Visual Studio.
  1. On the Start menu, launch Microsoft Visual Studio 2010 Express for Windows Phone .
  2. On the File menu, click New Project .
  3. From the project templates select Silverlight for Windows Phone and choose Windows Phone Application .
  4. Name the project and click OK.

5.  A new Silverlight app tfor Windows Phone project is created and opened in the designer.
6.  Edit the user interface as required by adding controls from the tool box and editing "XAML"

7. Write event handlers for " Log in " and " Exit " buttons , In this example the user name and password is hard coded as "vdr" and "admin" for successful log in case.

namespace FacebookLoginPage
{ public partial class MainPage : PhoneApplicationPage
public MainPage()   {
   private void BTN_Login_Click(object sender, RoutedEventArgs e)
    if (TB_UserName.Text.Equals("vdr") && TB_Password.Text.Equals("admin"))
     MessageBox.Show("Login Successful");
     MessageBox.Show("Enter Valid Credentials");
   private void BTN_Exit_Click(object sender, RoutedEventArgs e)

8. That's all your app is ready to launch. Compile the code and run it  in windows phone 7 emulator.

Here are the screen shots of  application functionality.
1. Once the emulator comes up your application can be seen in the list of applications displayed. Here we can see  the app "FacebookLoginPage" which we have just created.

2. Launch the application, and you are directed to Home screen of the application.

3. Log in with valid credentials.

4. Successful log in.

5. Log in failed.

With this we have successfully created our first windows phone 7 app and also have reached the end of this article, but before putting a full stop I would like to highlight on few things.
Mobile phone application development is not a rocket science it's more of a fun filled and challenging activity. Since these days, as the mobile phones are becoming integral part of our lives the phone user base is also rapidly growing and this has exponentially triggered the need for various kinds of mobile apps for people working in diverse domains.
And it's time to put in all your creative ideas and create great applications to serve the human community in a much better way.

Good bye for now.

No comments:

Post a Comment