Thursday, May 19, 2011

How to Play Audio, Video, Files transfer, Isolated Storage Explorer with Windows Phone 7 (WP7) Emulator


As a part of work I was gathering some information regarding playing media contents in Windows Phone 7 (WP7) emulator. I thought it is simple as similar with WM series devices. Though the code snippet for playing is not more than 5-7 lines but faced little problem while transferring media file from my hard drive to Emulator & playing the same.

In WM series devices we are transferring a file (manually) from desktop to Emulator either by using Active Sync or by using WMDC (Windows Mobile Device Center).
However in WP7 it is totally different. Here we need to install the WP7 Isolated Storage Explorer. It is local storage for WP7 applications & all I/O operations need to use it. You can download it from  HERE . Once you downloaded then follow the instructions .
Thanks to Microsoft Corporation for providing wonderful contents

Now its time for using MediaPlayerLauncher to play your media file.
Code snippet for playing media is as below :

 MediaPlayerLauncher objMPlayerLauncher = new MediaPlayerLauncher();
 objMPlayerLauncher.Media = new Uri("gags.wmv", UriKind.Relative); 
 //replace "gags" with your file path.
 objMPlayerLauncher.Location = MediaLocationType.Data;
 objMPlayerLauncher.Controls = MediaPlaybackControls.Pause| MediaPlaybackControls.Stop;
 objMPlayerLauncher.Show();

Please checkout this screen shot :


Hope this will helps.

Wednesday, May 18, 2011

Web Browser Control Windows Phone7 (WP7)


Recently I was just playing with the Web Browser in Windows Phone 7 (WP7) & got error as " You cannot call WebBrowser methods until it is in the visual tree " . 
So thought to share some basic ideas.


Once you drag and drop the WebBrowser control from tool box , you can see code below in .xaml file.
<phone:WebBrowser Name="WebBrowser1" Height="676" Width="450" />
Initially Screen looks like ( refer Screen1)


Now there are two ways to navigate to your web contents :
1. You need to update the Source property of the Web Browser control in  .xaml file:
 e.g. 
<phone:WebBrowser Source="http://www.mohzz.com" Name="WebBrowser1" Height="676" Width="450" />


If we update like above then your web contents will show default contents from specified source ( i.e. contents from "http://www.mohzz.com")
( refer Screen2)


2. Second way is ,
 No need to update the Source property of the Web Browser control in  .xaml file:
it will remains as it is 
<phone:WebBrowser Name="WebBrowser1" Height="227" Width="460" />


Now you need Set  URI location of the Web browser control your codebase accordingly.
You can set URI location by using either "WebBrowser1.Source" property or  by calling "WebBrowser1.Navigate('uri parameter') "


e.g. Written code on Click event of button "Click to visit Microsoft.com"  (from screen 2) 


WebBrowser1.Source = new Uri("http://www.microsoft.com");
Or
WebBrowser1.Navigate(new Uri("http://www.microsoft.com"));


Now you can see the contents of "http://www.microsoft.com" ( refer Screen3 )




Hope this information will helpful for someone


I found one more interesting article regarding with How to display content, embedded within the application assembly, using the WebBrowser , By Doug Holland.



Wednesday, May 11, 2011

Download MANGO SDK Windows Phone 7 (WP7) , release, news updates

Guys ,


After jail breaking the WP7 emulator we comes to know that the current version of WP7 is not supporting any access to the PIM items and developers can not access the camera, no more interaction with the calendar or contacts, also network  limiting to HTTP/HTTPS, and few more restrictions.

However these restrictions rolling out in next update for WP7, called "Mango"  in May2011. It seems to be most of these limits will disappear with Mango. Also came to know that Mango is going to expose around 1500 new APIs.

So Mango is the  MS's next big WP7 update. Hope Mango will rock in coming days.

Good news is that release date has been announced , Mango will gonna release on 24th May-2011. 
For more details visit link below:

Thursday, May 5, 2011

How to Unlock Windows Phone 7 (WP7) Emulator


Hello All,
Finally thought to write about subjected topic,

At the release of WP7 developer tool initially I faced problems for unlocking the WP7 emulator , however after surfing a lot and doing hell like Rn D got to overcome on the problem.
Below are some steps to unlock the WP7 Emulator :

1.I guess initially your emulator screen will looks like as below :
Initial screen

2. To unlock the screen I downloaded "wm70_copypaste" named file by referring
     http://windowsphonehacker.com/latest_windows_phone_7_emulator_unlocked-02-05-11.php 
   thanks for them


3. Once it got downloaded , I copied the file at path
    C:\Program Files\Microsoft SDKs\Windows Phone\v7.0\Emulation\Images



4. In the same path there is file names as "WM70C1.en-US" which is original emulator image file. For safety/backup purpose I renamed this file to "WM70C1.en-US-ORIGINAL".


5. Now its turn for  "wm70_copypaste" file to rename. Rename downloaded file to 
"WM70C1.en-US".


6. You are done here.


Now create/open any WP7 application from "Visual Studio 2010" you will observe the booting process of emulator as below :


(A) Complete OS boot
(B) Loading OS
(C) Home Screen
(D) Other options
Now you unlocked WP7 Emulator and now its ready for development
Hope this might be helpful for someone.