Windows Phone 8 find out IMEI / device name + manufacturer - windows-phone-8

I need to find out on which Windows phone device my app is running. Is there a reliable way to find out the IMEI in WP8? If not, is the DeviceName and DeviceManufacturer field reliably filled in by most devices? The documentation says those fields may be empty.

You could use
//Device Name
Microsoft.Phone.Info.DeviceStatus.DeviceName
//Device Unique Identifier (not IMEI)
Convert.ToBase64String((byte[])Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceUniqueId")))
//Device Manufacturer
Microsoft.Phone.Info.DeviceStatus.DeviceManufacturer
Hope this helps someone

This may work on Windows Phone 7. Maybe, it will also work on Windows Phone 8.
byte[] byteData = (byte[])DeviceExtendedProperties.GetValue(“DeviceUniqueId”);
string imei = System.Convert.ToBase64String(byteData);

DeviceExtendedProperties.GetValue(“DeviceUniqueId”) works as stated on Windows Phone 7 but on Windows Phone 8, this API will return unique id common across all the apps for the same publisher on a wp8 device. But two different publisher's apps will have different device ID's.

Related

Get Device Model in windows Phone 8.1 Runtime

is there a way to retrieve friendly device model in windows phone 8.1?
EasClientDeviceInformation a = new EasClientDeviceInformation();
String b = a.SystemProductName; // RM-994 not lumia 1320
this Api doesn't return device friendly name.
No way to get a friendly name like Lumia 1320 directly from the API, you need to use https://github.com/ailon/PhoneNameResolver to convert the name from API (RM-994) to the friendly name.

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

how to get my device token in nokia lumia 630

Basically I am PHP developer! and now I want to implement the push notifications for windows phone! So for this I have refereed many blogs and also started implement on this! but for demo purpose how I can get my device token and device specific type of my phone that having Windows 8.1 OS.
Is any GUI tool for getting this.
If you need the Device Token as follows-
Byte[] DeviceArrayID = (Byte[])Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceUniqueId");
string UniqueDeviceID = Convert.ToBase64String(DeviceArrayID);
Debug.WriteLine("Device ID - " + UniqueDeviceID
Also, if you need help regarding push notifications in Windows Phone apps, follow this link-
http://msdn.microsoft.com/en-us/library/windows/apps/hh202967%28v=vs.105%29.aspx
It also has a project for a simple webpage which can send notification to your device for testing purposes.
The following should work
object DeviceUniqueID;
byte[] DeviceIDbyte = null;
if (DeviceExtendedProperties.TryGetValue("DeviceUniqueId", out DeviceUniqueID))
DeviceIDbyte = (byte[])DeviceUniqueID;
string di = Convert.ToBase64String(DeviceIDbyte);
The above code will give you the device ID. You can use the string di to pass the Device ID to your web service to provide the user with push notifications.

How to get a query string in a windows phone 8.1 app?

Sorry to ask such a basic question, but I've spent the last 30mins on google and found nothing (very likely my poor search engine skills!)
I'm upgrading (well, moving code) from a windows phone 8 app to a universal app (the windows store code is largely absent at the moment, I'm currently concentrating on porting over the windows phone stuff).
Previously I was using
NavigationContext.QueryString.TryGetValue
But with 8.1 this doesn't work and I can't for the life of me find out how to get the querystring.
Any help would be very gratefully appreciated.
You can send a parameter the way Vyas_27 written, but make it looks like
//id - first parameter
//value - second parameter
Frame.Navigate(typeof(SecondPage), "id&value");
To get parameters
string[] parameters = ((string)e.Parameter).Split(new char[] {'&'});
string id = parameters[0];
string value = parameters[1];