Freelance Jobs
Showing posts with label WP7. Show all posts
Showing posts with label WP7. Show all posts

Sunday, December 12, 2010

Hello World App in Silverlight for Windows Phone 7

In this section, I will help you to write the widely used “Hello World” application for the Windows Phone. This may seem little bit silly for hard core programmers and non-programmers like. But here the situation is little bit different, we are going to create and compile app in a pc and is deploying and running it in a mobile device or at least an emulator. According to me this simple code serves two purposes, it will help to understand and how easy is to write a text on to the Windows Phone Screen and secondly, it helps us to experience the process of creating, developing, compiling and running a program without too much difficulties.

I will guide you to write the “Hello World”, in both Silverlight and XNA. In most of the cases you will be using XNA for developing games, but I wanted to show that the functionality can be achieved using both technologies.

For writing your first application you need, Windows Phone 7 Developer Tools, which includes Visual Studio 2010 for Windows Phone, the Windows Phone Emulator and it is a free download from the Microsoft Download Center

Writing the App in Silverlight

Power up Visual Studio 2010 for Windows Phone from Start Menu or from Desktop.  From the File Menu select New Project -> Visual C# -> Silverlight for Windows Phone from the installed templates. Then from the middle area, choose Window Phone Application. Enter a Name for the project and also the location, if we don’t want to create a directory for the solution, you can uncheck the Create Directory for the Solution.


After clicking Ok button and project will be created with a lot files, which I will explain latter. You will be welcomed by a large screen of windows phone in portrait mode, to be more precise 480 * 800 pixels by far largest screen to this date in phone world.  This is shown in the design view and one can add more controls by dragging and dropping them from the control toolbox. Instead of drag n drop we will write markup for creating the controls. For that we need to switch to markup view and this can be one by clicking any of the icons which may appear to the bottom of your screen.


Sunday, November 28, 2010

Lifecycle of a Windows Phone 7 App

 
The model for for the entire lifetime of  an application, ie from the launch to the termination is called the Windows Phone Execution Model. Each Application moves through the stages of the life cycle.  The events are 
1) Launch/Start
2) Running
3) Pause/Deactivation
4)Resume/Reactivation
5) Close
 
image

Launch State
 
A Windows Phone Application is considered to be in a Launch state when it is initiated by a user, either from the list of installed applications or from the tile for the application in Start. When the application is started a Launch event is raised and it’s here we creates a new instance for the app. This event is raised before the application is visible or active. So loading data from isolated storage or performing time consuming tasks are highly discouraged coz it will increase the startup time of the app there by providing a bad user experience. 
Running State
 
Once the app is loaded, then it will be in the running state. In this state, the app keep tracks of its state as the user goes back and forth through the application pages. 
Paused State.
 
This is an interesting state in the lifecycle of an app.  The app enters Deactivated state when it is interrupted by an incoming call or other tasks such as taking a photo or sending an email or even starting another app. Any of these interrupts will cause the Deactivated event to fire. When an app is deactivated the OS will keep a record of the application and stores the state to the isolated storage. MS guys calls this process as TombStoning. 
Reactivated State.
 
When the user comes back to a deactivated or tombstoned app, the application is restored to the point where the user has left the app. There are chances that an user may or may not return to a tombstoned app. This can lead to drainage of the memory and storage space. Inorder to avoid this OS keeps track of long running tombstoned apps and terminates it appropriately so that the phone doesn’t run out on memory and storage.

Sunday, November 14, 2010

K-MUG UG Meet Nov 13 2010 - A Retro

During the Community Tech Days 2010 held at Kochi, K-MUG decided to conduct monthly user group meeting for Central Kerala region at Kochi. First meeting was conducted on Nov 13, 2010 and the venue was Mastermind Institute of Engineering,  Kakkanad, Kochi. I was given a chance by the K-MUG people to take a session on Windows Phone 7. 

Although I had started making slides and creating some demo applications, last minutes hiccups is unavoidable. The case is no different here, I didn’t wanted any issues to surface during the presentation coz of my unstable development machine, so I decided to demo the application inside a VM. For that I created a new one with Windows 7 64-bit as OS and then went on to install the Windows Phone Developer Toolkit which is a free download from MSDN. Even though I had 3GB memory and a dual core processor, it took a pretty decent time to install. But to my horror, I found out that the application is not loading in the emulator after a successful build. So after googling for a while I was able to get the problem behind that, Windows Phone Emulator will not work properly in a VM. The time was almost midnight and I had to catch the early morning train, so I decided to show it in my machine come what may. 

Next morning I got up early and reached the station in time. During  the journey I decided to go through the ppts and demo applications and made sure that everyone is working fine. I reached Eranakulam around 9.30 and thanks to ever present traffic blocks in Ernakulam, I was late by half an hour in reaching the venue. When I entered the hall, Yanesh was mid-way through his presentation on Test Driven Development and I was unable to listen to his talk coz I was busy with settling down and Safil was waiting for me to have my lap  to show his presentation. Although he had Praseed’s lap as a backup, I handed over mine to him to prepare for the session. By this time Yanesh wrapped his session and I was not able to pay attention. Really missed it, coz I had attended his last session on Generics at CTD Kochi and it was an excellent one.  In the meantime, if someone is wondering who Yanesh is, this is for them. He is a solutions architect with Millennium Consultants who has got 16+ years of experience in designing and developing application using Microsoft Technologies. Please visit the event page to know more about Yanesh .


Thursday, November 11, 2010

My Session on Windows Phone 7 - Usergroup meeting @ Kochi on Nov 7, 2010

I am talking about Windows Phone 7 application development at an user group meeting conducted by K-MUG at Kochi on Nov 13,2010. My intention is to give brief description about the history and time line of WP7 and will be demo demonstrating some applications built using the windows phone developer tools targeting the mobile platform. If you are really interested in it, please come and join me on 13th. There are also other sessions on Microsoft Surface, Windows Communication Foundation and Test Driven Development. For more details about the event, please visit the K-MUG events page and registrations can be done from here.

Sunday, November 7, 2010

Usergroup meeting @ Kochi on Nov 7, 2010


K-MUG has decided to conduct monthly user group meetings across Kerala. So on 7th of November, Kochi will be hosting the meeting for central Kerala region. And, I will be giving a session on Windows Phone 7, also there are couple more people giving sessions on very interesting topics. 

Venue
Mastermind Computer Institute, 
2nd Floor, New Kochappilly Building, 
Near Federal Bank, 
Civil Line Road, 
Chembumukku, 
Cochin-682030


09:15 - 09:30 Community updates
09:30 - 10:30 Test Driven Development
10:30 - 11:15 Microsoft Surface
11:15 - 11:30 Tea Break (15 min)
11:30 - 12:15 Windows Phone 7
12.15 - 01:00 Introduction to WCF 4.0

For more details and info about the speakers, please visit the event page in K-MUG site and registration can be done here.