What is the Idiom type for Xbox? - xamarin

I have a UWP app created using Xamarin.Forms and I uploaded it on Microsoft Store, I enabled Microsoft to decide which platforms can I support, Xbox was automatically selected by Microsoft. I cant unfortunately test it since I dont have Xbox or any emulator available. But I am seeing that there are some downloads and Microsoft Developer Console shows the type as "Console"...
Now my question is on Xamarin.Forms doesnt have that idiom as Console, it is defined here as phone, tablet, desktop, tv, Unsupported... how to check for Xbox?

This is not built into Xamarin.Forms, so you will have to use Windows-specific API to recognize if the app is running on Xbox. You can implement a custom Dependency service that will have an interface which you will implement in UWP project. The documentation will tell you how to do it.
Then to check which type of device the app is actually running on you can check the value of:
Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily
This property contains a value depending on which type of hardware the app is currently open:
"Windows.Xbox"
"Windows.Mobile"
"Windows.Desktop"
"Windows.Team"
"Windows.IoT"
"Windows.Holographic"

Related

Submit a Unity app to Windows store

I have a unity app built for Windows desktop. Client wants this to be distributed through Windows 10 Store. This is just a desktop app and has no support to tabs or phones.
But looks like with Windows 10 there is no desktop only option.
Is there any documentation on what are the steps I need to follow to submit the unity built app to Windows store?
I did some reading and looks like this is what I will have to do.
https://channel9.msdn.com/Blogs/One-Dev-Minute/How-to-publish-your-Unity-game-as-a-UWP-app
https://learn.microsoft.com/en-us/windows/desktop/win_cert/windows-certification-portal
But want to get a confirmation from some one who has already done that. As I don't have a Windows developer account right now to try that out.
Is there any documentation on what are the steps I need to follow to submit the unity built app to Windows store?
The steps of publishing a unity app is similar to UWP app. You can refer to App Submissions for more details.
After your packages have been successfully uploaded, you will find the Device family availability section that indicates which packages will be offered to specific Windows 10 device families.
For your requirement, you could check Windows 10 Desktop device option, as the follow picture shows:
For more info, you could refer to Device family availability official document.

Deployment of app to device failed

I have Xamarin Live Player up and running.
When I use it with a newly created Xamarin Forms (Master Details) app, it works fine. I see the app on the device.
However, when I try to run my full-blown app, Visual Studio tells me "Deployment to device failed. Make sure that Xamarin Live Player is open and that the device is in the same network."
Since the new app runs fine, I guess something else is the problem.
I've already set the Android project properties to be same as the newly created app.
Just to make sure, I've made it so that my full-blown app requests all rights.
How could I debug more in detail what's going wrong?
Xamarin Live Player can't run all apps. As soon as you use reflection, embedded resources, a MVVM framework or a custom renderer in Xamarin.Forms it might simply just not run the App.
You can read about the limitations of Xamarin Live Player in the official documentation for it.
You will probably have a much better experience just running directly on the device without Live Player.

Xamarin Forms - What is the current device/system type?

I was working by debug my app with a Microsoft Phone 10 when I realized "UWP is a cross windows logic", so now I'm working with my computer.
However, a question comes up in my mind :
How can you know/get information about what type of system your app is running on?
I mean by this question, by example, does my app is currently running on a phone or on a computer?
Thank for your help !
In PCL or SAP
The static Device class includes several properties and methods that allow your code to deal with device differences at run time in a very simple and straightforward manner:
The Device.OS property returns a member of the TargetPlatform
enumeration: iOS, Android, WinPhone, or Other. The WinPhone member
refers to all the Windows and Windows Phone platforms.
The Device.Idiom property returns a member of the TargetIdiom
enumeration: Phone, Tablet, Desktop, or Unsupported.
You can use these two properties in if and else statements, or a switch and case block, to execute code specific to a particular platform.
Device

Does Xamarin support to develop apps for Windows surface and how well?

I want to develop an app for Windows surface tablet and iOS mobile and iPad.
As I am a new user to Xamarin, when I created my first project,it shows 3 projects:-
hello.driod, hello.ios and hello.winPhone.
I have 3 questions based on this:-
How will I be able to write the same code and share for windows 8.1 and iOS?
and whenever I drag and drop the elements to the UI page, will the same elements be copied to both windows and iOS simultaneously or I got to add them seperately?
Currently I dont have a MAC to connect to my PC. Can I write the code and and there while testing it, connect it to a MAC or should it be connected during the whole process?
Please Help!
Using the same code depends on how your structure your app.
You can go the native route where you can share the bulk of your logic by containing it in a shared / PCL project (more on that here), but have platform specific code for your UI.
For example, if you have a cross platform app targeting iOS and Android you would still create the UI in a storyboard for iOS and AXML files for Android. Any code you want to "connect" to your UI would be specific to that platform as you would use the platform APIs. Any code that is not platform specific (i.e., not calling iOS or Android APIs) can go in your shared / PCL project.
Or you can choose Xamarin.Forms which adds a layer of abstraction by allowing you to write the UI in XAML once and have it work on all platforms. The advantage is increased code sharing as now your UI is also shared. The downside is to utilise platform specific features you'll need to implement DependencyService or custom renderers. Read more about Xamarin.Forms here.
As above, it depends. If you are going the native route, then no. If you are going with Xamarin.Forms, then you are using the same XAML code for the UI across platforms, but there is no drag and drop designer.
To build an iOS app you need to be connected to a Mac. You will also need to be connected to a Mac to use the iOS Designer.

Launch/execute generic actions in Windows Phone, like Intents on Android

The Android framework allows for generic actions to be completed by any installed application that registers to handle the action. You can qualify the actions with additional data, mime types, etc.
Does Windows Phone have a similar mechanism? Is there a generic way to "launch a browser with this url", "select a file of type .xyz", "share/send this file of type .xyz", etc?
This capability does not exist to define "Intents" as it does for Android in the current v1 release of the Windows Phone SDK.
There are however a number of built in "Tasks" that behave in much the same way, including launching a Web Browser. Details here.
How to: Use Launchers for Windows Phone
How to: Use Choosers for Windows Phone

Resources