Armen Kazaryan
Armen Kazaryan

Reputation: 25

How to work with fm radio?

I am going to study the mobile programming on windows phone platform. I decided to make custom fm radio. But I cannot find a appropiate class that implement needed functionality.

Radio and FMRadio classes are described in Microsoft.Devices. But that assembly is not accessible in NuGet, and i cannot find it at system.

How to work with fm radio?

Thanks.

==========

I found FMRadio in Microsoft.Phone.dll, nut I cannot reference it in my application.

Windows Phone (with runtime) application type give error: cannot find type system.systemexception in module mscorlib.dll

Windows phone silverlight application type after referencing needed Microsoft.Devices.Camera.dll. This assembly i found, but couldn't reference.

Upvotes: 0

Views: 2228

Answers (1)

Panu Oksala
Panu Oksala

Reputation: 3438

Add a using directive to include the Microsoft.Devices.Radio namespace

Create an instance of the FMRadio class and then set the power mode.

// Create an instance of the FMRadio class.
FMRadio myRadio = FMRadio.Instance;
// Turn the radio on.
myRadio.PowerMode = RadioPowerMode.On;

More info at https://msdn.microsoft.com/en-us/library/windows/apps/ff769541(v=vs.105).aspx

Notice: FM radio is supported only in apps that target Windows Phone OS 7.1. If you use the FMRadio class in apps that target Windows Phone OS 8.0 or later, a RadioDisabledException indicates that the FM radio feature is not available. On Windows Phone 8 devices with a build of 8.0.10322 or greater, the run-time exception may not occur if you use the FMRadio API. However, the FMRadio API is not supported for apps that target Windows Phone OS 8.0.

Upvotes: 1

Related Questions