What happened to FM Radio in Windows Phone 8? - windows-phone

FM Radio was a mandatory HW requirement in Windows Phone 7, but it's not present on any current Windows Phone 8 device.
Why there is no FM radio in Music Hub in WP8? Can we at least use the FMRadio API?

According to MSDN:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206947(v=vs.105).aspx
Windows Phone 8 does not support the FM radio feature. If you use the
FM radio API in a Windows Phone 8 app, a RadioDisabledException will
occur.
Also from what I heard:
...the FM radio feature was planned to be included but got cut from this
release due to stability vs. time constraints.
(... I don't know if
there are any plans to re-enable this feature in a future update.)
You can use this test to safely determine if FMRadio can be used on current phone:
/// <summary>
/// Flag is radio device is available in this phone.
/// </summary>
public bool IsRadioAvailable
{
get
{
if (!radioInitialized)
{
radioInitialized = true;
try
{
radio = FMRadio.Instance;
isRadioAvailable = true;
}
catch (RadioDisabledException e)
{
isRadioAvailable = false;
}
}
return isRadioAvailable;
}
}
private bool radioInitialized;
private bool isRadioAvailable;
private FMRadio radio;
Update:
According to various sources FM radio will be enabled in upcoming Windows Phone 8 update that should arrive in Summer 2013.

I read that the Lumia 920 has FMRX and just needs to be "utilised". Not sure if they helps in any way

FM Radio returns, on supported hardware, in Windows Phone 8 'GDR2' (8.0.10327.77/78).
It's not clear whether the API support also returns and how it behaves:
Caution:
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.
http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.devices.radio.fmradio.frequency(v=vs.105).aspx
In other words, there is no Windows Phone Runtime API to control the radio.
I've just tried out an FM Radio app from the store, which does work.

Related

Problem adding "pro mode" for Huawei Camera Kit

I followed the sample code on their developer page, and I'm not sure how to add the pro mode camera feature into my app after initializing the Huawei Camera Kit instance.
private CameraKit mCameraKit;
mCameraKit = CameraKit.getInstance(getApplicationContext());
//If the current mobile phone does not support the kit or the SDK version is incompatible, NULL is returned. Compatibility processing is required.
if (mCameraKit == null) {
return;
}
Based on the Huawei Developer guides section, pro mode should be one of the supported camera modes, but I did not find pro mode in the Camera Kit API reference. Does anyone know how to enable pro mode?
There is no specific mode definition for Pro mode. Pro mode is defined by the open keys. You only need to:
Set mCurrentModeType to PRO_PHOTO_MODE or PRO_VIDEO_MODE.
Use mCurrentModeType to create a Mode object.
Call the setParameter method of the Mode object to enable the corresponding capability.
Use the takePicture, startRecording, and stopRecording methods of the Mode object to take photos and record videos. Refer to details.
After the preview function is enabled, you can configure the capability values of Pro mode, such as the ISO, exposure time, and white balance. Below are some sample code.
// Query the functions supported by the mode.
List<CaptureRequest.Key<?>> parameters = mModeCharacteristics.getSupportedParameters();
// Query the supported ISO range.
List<Integer> values = mModeCharacteristics.getParameterRange(RequestKey.HW_PRO_SENSOR_ISO_VALUE);
// Set the ISO value. The first value is used as an example.
mMode.setParameter(RequestKey.HW_ PRO_SENSOR_ISO_VALUE, values.get(0));
Currently, Pro Mode is supported only on devices with Kirin 990 and Kirin 9000.
The following code is provided for your reference on how to add a mode to your app. Currently, only the rear camera supports Pro Mode.
// Query the camera list of the device.
String[] cameraLists = mCameraKit.getCameraIdList();
// Query the modes supported by the current camera.
int[] modes = mCameraKit.getSupportedModes(cameraLists[0]);
// Create a mode.
mCameraKit.createMode(cameraLists[0], mCurrentModeType, mModeStateCallback, mCameraKitHandler);

Xamarin forms win phone silverlight 8.1 Toast notifications not working

I am trying to make a toast notification show in a Xamarin Forms, windows phone 8.1 silverlight project. Inside the Windows Phone project I have a method that creates a toast notification, however, nothing happens when it is executed. No error is thrown everything seems to execute correctly but nothing happens on the phone.
I have tested it on an emulator and an actual cell phone. Everything I have found online until now is practically the same as what I have (with slight differences, but nothing that should make a difference).
The code in the method is the following:
private void CreateNotification(string title, string message)
{
ToastNotifier toastNotifier = ToastNotificationManager.CreateToastNotifier();
XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02);
XmlNodeList toastTextElements = toastXml.GetElementsByTagName("text");
toastTextElements[0].AppendChild(toastXml.CreateTextNode(title));
toastTextElements[1].AppendChild(toastXml.CreateTextNode(message));
ToastNotification toast = new ToastNotification(toastXml);
toast.ExpirationTime = DateTimeOffset.UtcNow.AddSeconds(5);
toastNotifier.Show(toast);
}
Any help would be greatly appreciated.
Thanks in advance!
If you are using Xamarin Forms there is a NuGet package: https://www.nuget.org/packages/Toasts.Forms.Plugin/
It doesn't use the standard toast notification system in windows phone though as it needed to expand beyond it.
As for showing Toast Notifications have you set Toast Capable to Yes in your Package.appxmanifest?

How do I detect that the Windows Mobile transitioned to continuum mode?

Is there a way to detect that Windows Mobile 10 transitioned into continuum mode?
The message-box on Windows Phone does not look anything like the one on Desktop and our designers want parity. I want to write our own version, but I only want it to work on Phone - I want the default one on desktop or when the app transitions to continuum on phone.
Any ideas?
I could not find anything on the web nor find any API that allows me to detect it.
I may be wrong but I don't think there is an API for Continuum. The idea of Continuum for Phone is that you're going from a fixed display size to something that is variable. The best way to detect this would be using the Visual State Triggers or checking if the size of the window has changed.
By also checking that the device family, AnalyticsInfo.VersionInfo.DeviceFamily, is Windows.Mobile, you'll know that you're using a phone device which is currently in the Continuum mode.
To detect if app is running in Continuum mode you'll need to check two things: DeviceFamily and UserInteractionMode.
public static bool IsInContinuum()
{
if (DeviceFamily() == DeviceFamilyType.Mobile && UIViewSettings.GetForCurrentView().UserInteractionMode == UserInteractionMode.Mouse)
return true;
else
return false;
}
Quote from this post:
"With Continuum, “touch” will always be returned when your app is on the mobile device, and “mouse” will always be returned when your app is on the connected display."
So you'll need to check if app runs in Continuum in SizeChanged event.
Due to MSDN Documentation Below,
There's no spesific trigger for Windows 10 Mobile continuum feature detection.
Continuum for Universal Apps
In order to find a solution on Mobile Apps, you can benefit from adaptive UI, you can check the app via screen resolution change Window.Current.SizeChanged, then you can combine with Device family AnalyticsInfo.VersionInfo.DeviceFamily to check if device is in Continuum mode.

Camera API for a Windows 8 Tablet on Visual Studio Express 2013 (For Windows Desktop)

I want to write a program for my tablet using Visual Studio Express 2013 (for Windows Desktop). The tablet is running Windows 8.1 Pro.
For compatibility and ease of programming, I would like to continue working in VS Express 2013 for Windows Desktop.
I want my program to use the device's camera capture functionality. I would hope that this would be as simple as using libraries/APIs that are already widely known. However, all of the documentation and help forum posts I have read so far suggest that WIA (Windows Image Acquisition) was the library to use for desktops and Windows Media Capture must be used for Windows 8.1.
Is there a better way?
All you need to do is specify a CaptureElement and a Button to capture the Picture as Shown Below
<CaptureElement x:Name="cap1" Height="300" Width="450"/>
<Button Content="Take a Photo" x:Name="btnCapture" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" Click="btnCapture_Click"/>
Here is the Code Behind the Button :
private async void btnCapture_Click(object sender, RoutedEventArgs e)
{
var _MediaCapture = new MediaCapture();
await _MediaCapture.InitializeAsync();
cap1.Source = _MediaCapture;
await _MediaCapture.StartPreviewAsync();
}
Remember that you need to use the Async and await keywords as this process is Asynchronous .

How to simulate Trial mode on Windows Phone 8 app?

I've been developing and testing WP apps for more than year, including paid apps with trial versions, Silverlight and XNA too. When using Guide.SimulateTrialMode and Guide.IsTrial in WP7 SDK, it was perfectly working in emulator and on real device as well. Now when I use this same approach in WP8 SDK for WP8 apps, when I set SimulateTrialMode to true, then Guide.IsTrial still returns false. I've even tried LicenseInformation.IsTrial() and it is returning false as well.
The question is, am I doing something wrong, or it is no longer possible to simulate the trial mode using Guide.SimulateTrialMode in WP8 apps? Note when I use this for WP7.1 apps with WP8 SDK, it works just fine, so I guess it's only bug in WP8 apps.
I've checked these guides, but there is no hint that SimulateTrialMode is broken on WP8:
Creating trial apps for Windows Phone
Guide.SimulateTrialMode Property
App platform compatibility for Windows Phone
tl;dr SimulateTrialMode is not working in WP8 apps, any other way, how to simulate Trial mode?
The way I do it is, instead of calling directly Guide.IsTrialMode, I wrap it in a property:
public static bool IsTrial
{
get
{
return Guide.IsTrialMode;
}
}
The point is that you can now easily change the property to return true or false during your test. You can even use preprocessor directives and a specific build configuration to switch to trial mode:
public static bool IsTrial
{
get
{
#if TRIAL
return true;
#else
return Guide.IsTrialMode;
#endif
}
}