0

i want my application should work on specific devices\OS like "Lumia 650"\"windows phone 8", this is my project requirement.

Is it possible ? if yes where should I mention the details ?

Narayana Dvl
  • 211
  • 1
  • 5
  • 12

2 Answers2

0

This is only possible in code as you can not prevent users from installing the app if the app is meant for that particular OS what that user has. However, once the app is launched you can get the name of the device and do actions accordingly.

You can try this:

var PhoneName = Microsoft.Phone.Info.DeviceStatus.DeviceName;

if(PhoneName == "Not Allowed Phone")
{
     MessageBox.Show("You can not use this app");
}
else
{

}
A.K.
  • 3,321
  • 1
  • 15
  • 27
0

It is not a problem to restrict Windows Phone 8. You just need to build it targeting Windows Phone OS 8.0. For the device model you do something like this in the App.xaml.cs

    private void Application_Launching(object sender, LaunchingEventArgs e)
    {
        var deviceName = DeviceExtendedProperties.GetValue("DeviceName").ToString();
        if (!deviceName.Contains("Lumia_650")) // Please check your phone's actual value
            Application.Current.Terminate();
    }

If you want to show a friendly message before it exits you can move the code to the MainPage.xaml.cs then add the MessageBox.Show(message) part.

Stephen Zeng
  • 2,748
  • 21
  • 18