DeviceFirmwareVersion, OSVersion, DeviceStatus missing in Windows Phone 8.1 runtime - windows-runtime

in my Silverlight Windows Phone 7/8 projects I always used these methods/classes to get informations about the user phone:
Microsoft.Phone.Info.DeviceStatus.DeviceFirmwareVersion;
System.Environment.OSVersion.Version;
Microsoft.Phone.Info.DeviceStatus.DeviceName;
Microsoft.Phone.Info.DeviceStatus.DeviceManufacturer;
But now in Windows Phone 8.1 runtime they are missing. Are there some alternatives? My app doesn't use networking.
Thanks and sorry for bad english.

You can use the EasClientDeviceInformation class
e.g.
var deviceInfo = new EasClientDeviceInformation();
var manufacturer = deviceInfo.SystemManufacturer;
var name = deviceInfo.SystemProductName;
var firmwareVersion = deviceInfo.SystemFirmwareVersion;
var osVersion = "8.1"; // Only 8.1 so far. No os version method exists afaik in 8.1

Universal/WinRT apps only work in wp 8.1, so the OS version can only be 8.1. When they make wp8.2 or wp9, they'll probably add a way to check what OS version is installed...
If you're looking for the firmware version, you can get it with:
Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation();
var firmwareVersion = deviceInfo.SystemFirmwareVersion;

Related

Wi-Fi Direct in Windows Phone 8.1

According to documentation:
https://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.wifidirect.wifidirectdevice.aspx
it should be available on 8.1 store and it is, the problem is that each time it code below returns 0. Code taken from msdn example for Windows 8.
String deviceSelector = Windows.Devices.WiFiDirect.WiFiDirectDevice.GetDeviceSelector();
var devInfoCollection = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(deviceSelector);
Anyone knows if WiFi Direct is actually supported on Windows Phone?
Thanks

How to get the Application Process ID in Windows Phone 8.1 Store Apps

I am developing a Windows Phone 8.1 Application and there is a need to get the Application Process ID from code. Any API with which I can get that?
You can use GetCurrentProcess followed by DuplicateHandle (and later CloseHandle) but I'm curious what you need it for... there's not much you can do with it in a Store app so maybe this won't complete your scenario.
Finally got the solution.
The Dll's for Desktop apps and Phone apps are different though the function names will be same.
When tried to import Kernal.dll lib in WIn Phone 8.1 and used p/invoke code, an exception, DllNotFoundException will be thrown. Instead in Win Phone 8.1 instead use "api-ms-win-core-processthreads-l1-1-1.dll"
To get the process ID in Win Phone 8.1 :
1)Create binding to WIN32 lib:
[DllImport("api-ms-win-core-processthreads-l1-1-1.dll", CharSet = CharSet.Unicode, ExactSpelling = false, PreserveSig = true)]
internal static extern uint GetCurrentProcessId();
2)Call the function:
uint id= GetCurrentProcessId();
For the complete set of Win Phone 8 supported API's see the MSDN link:
https://msdn.microsoft.com/library/windows/apps/jj662956(v=vs.105).aspx#BKMK_ListofsupportedWin32APIs

What is the equivalent to ā€œMarketplaceDetailTask.ContentIdentifier" for windows phone 8.1

In Windows Phone 8.0 i used this to open an app on the store
MarketplaceDetailTask marketplaceDetailTask = new MarketplaceDetailTask();
marketplaceDetailTask.ContentIdentifier = "**************";
This Class does not exists in WP 8.1 how can i do?
Thanks
You should use the new launchers.
Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store:navigate?appid=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"));

New Live tiles don't work in Windows Phone Silverlight 8.1 apps?

So when I was watching this video from BUILD I thought it's gonna be easy...
But I can't seem to get the tile of my WP Silverlight 8.1 app to change by doing the following.
const string xml = "<tile>"
+ "<visual>"
+ "<binding template='TileSquareText01'>"
+ "<text id='1'>testing 123</text>"
+ "</binding> "
+ "</visual>"
+ "</tile>";
var xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xml);
var tileNotification = new TileNotification(xmlDoc);
TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification);
Please note I've also created a Windows RunTime Windows Phone 8.1 with exactly the same code and it works just fine.
On msdn, it clearly states that TileUpdateManager supports Windows Phone Silverlight 8.1. So I don't really know what's missing here.
In your manifest, make sure the notification type is set to WNS. If you set it to MPNS, then you have to use notifications the old way.
More information here: http://msdn.microsoft.com/en-us/library/dn642085(v=vs.105).aspx

Create reminder in windows runtime

I am in the process of porting an app from windows phone 8 silverlight to windows phone 8.1 runtime.
Before I could create reminders like this:
Reminder reminder = new Reminder(name);
reminder.Title = titleTextBox.Text;
reminder.Content = contentTextBox.Text;
reminder.BeginTime = beginTime;
reminder.ExpirationTime = expirationTime;
reminder.RecurrenceType = recurrence;
reminder.NavigationUri = navigationUri;
// Register the reminder with the system.
ScheduledActionService.Add(reminder);
How would I do this in windows phone 8.1 runtime?
Thanks,
unfortunately there's no equivalent for Windows phone 8.1 runtime
Migrating your Windows Phone 8 app to a Windows Runtime XAML app
Now you must use toast notifications using the new Action Center feature
MSDN Reference
Action Center QuickStart