Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
Go to DotNetFunda.com
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 14072 |  Welcome, Guest!   Register  Login
Home > Articles > Windows Phone > FM Radio Programming In Windows Phone 7

FM Radio Programming In Windows Phone 7

Article posted by Mahakgarg on 8/13/2012 | Views: 1384 | Category: Windows Phone | Level: Beginner | Points: 250 red flag


In this article, we will be discussing about the FM Radio programming in windows phone 7.

Download


 Download source code for FM Radio Programming In Windows Phone 7


Objective

The Objective of this article to describe some features of the FM Radio in Windows Phone 7


Using the code

In this article, we will be discussing about the FM Radio programming in windows phone 7.  For this Follow these steps:

Step1: 

First we add a namespace Microsoft.Devices.Radio (as it contains the FMRadio API).

using Microsoft.Devices.Radio;

using Microsoft.Devices.Radio;

Step2:

After that we write the following code after the InitializeComponent();

public MainPage()

{

InitializeComponent();

 

try

{

FMRadio.Instance.CurrentRegion = RadioRegion.UnitedStates;

FMRadio.Instance.PowerMode = RadioPowerMode.On;

FMRadio.Instance.Frequency =101.5 ;

if (FMRadio.Instance.SignalStrength == 0.0)

{

MessageBox.Show("Please connect your phone to the headset.");

}

}

catch (Exception ex)

{

MessageBox.Show("Error Message:-> " + ex.Message + "FM Radio is not connected");

}

}

Step3: (We will discuss the program)

In the first line, we specify the current region of the FM Radio like this:

FMRadio.Instance.CurrentRegion = RadioRegion.UnitedStates;

here we set two other countries name (Europe, Japan). Only these names are provided by .net.

In the Second line, we set the PowerMode of the FM Radio to On. we can  also set it to Off.

FMRadio.Instance.PowerMode = RadioPowerMode.On;

In the Third Line, we set the Frequency of the program. We can tune it into this frequency.

FMRadio.Instance.Frequency =101.5 ;

Here we specify 101.5

In the Forth Line, we sets the value of the SignalStrength, which is based on RSSI( Received Signal Strength Indicator). Here we check if the Signal Strength will be 0.0, the MessageBox will be appear.

if (FMRadio.Instance.SignalStrength == 0.0)

{

MessageBox.Show("Please connect your phone to the headset.");

}

                 

and if there was an error the following message will be appear:           

catch (Exception ex)

{

MessageBox.Show("Error Message:-> " + ex.Message + "FM Radio is not connected");

}

Conclusion


Here we discuss about that how we can listen the FM radio In Windows Phone 7.

Hope you liked it, do let me know any comments or feedback.

If you like this article, subscribe to our RSS Feed. You can also subscribe via email to our Interview Questions, Codes and Forums section.

Page copy protected against web site content infringement by Copyscape
Found interesting? Add this to:



Please Sign In to vote for this post.

About Mahak Garg

Experience:1 year(s)
Home page:http://www.dotnetfunda.com
Member since:Saturday, August 27, 2011
Level:Starter
Status: [Member]
Biography:
 Responses
Posted by: Vuyiswamb | Posted on: 18 Apr 2013 01:55:46 AM | Points: 25

This is a very interesting and simple article.

>> Write Response - Respond to this post and get points
Related Posts

In this article, will create our first Windows Phone application with the "MANGO" flavour.This is the first in the series of article about Windows Phone 7.1 and our journey will begin from here with the making of a simple calculator in Windows Phone 7.1

More ...
About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/19/2013 12:51:39 PM