Giter Club home page Giter Club logo

windows-appsample-remote-system-sessions's Introduction

page_type languages products statusNotificationTargets
sample
csharp
windows
windows-uwp

Remote Systems Session API (Quiz Game UWP Sample)

A pub-style trivia game sample for the Universal Windows Platform (UWP) demonstrating the Remote System Session API (part of the Project Rome platform).

Note - This sample is targeted and tested for Windows 10, version 2004 (10.0; Build 19041), and Visual Studio 2019. If you prefer, you can use project properties to retarget the project(s) to Windows 10, version 1903 (10.0; Build 18362).

Project Rome is a platform for creating shared experiences that can enable developers to extend their app across devices connected proximally, or through the cloud. The Remote Session API allows a device to host a session that is discoverable by other devices that are nearby. They can then join this session, and send messages among the host and other participants.

Quiz Game Banner Image

When running the sample, you are presented with an option to create a new game as a quiz session host on your local network, or join an existing game and answer questions from the quiz host. The host sends the questions to the proximal devices, while the participants answer the questions on their own devices. A quiz host can advance the game to additional questions and display the scores at the end.

Note - For more information on the Project Rome platform, including the Remote System Session API, see Connected apps and devices.

Universal Windows Platform development

Prerequisites

  • Windows 10. Minimum: Windows 10, version 1809 (10.0; Build 17763), also known as the Windows 10 October 2018 Update.
  • Windows 10 SDK. Minimum: Windows SDK version 10.0.17763.0 (Windows 10, version 1809).
  • Visual Studio 2019 (or Visual Studio 2017). You can use the free Visual Studio Community Edition to build and run Windows Universal Platform (UWP) apps.

To get the latest updates to Windows and the development tools, and to help shape their development, join the Windows Insider Program.

Running the sample

To run this sample, you'll need to:

  • Have at least two Windows 10 devices running the Windows 10 Fall Creators Update (version 16299).

  • Configure the following settings:

    1. Bluetooth must be enabled, this can be enabled by going to Settings | Bluetooth & other devices and turning on Bluetooth.
    2. Share across devices must also be enabled, you'll need to access Change shared experience settings. The feature Share across devices must be set to On and Everyone nearby.
    3. Ensure the RemoteSystem, Bluetooth, and Internet (Client and Server) capabilities are added in your project. It should be checked by default, but it's important to check this prior to working on any Remote System Session API project.
  • Deploy the app to a minimum of two Windows 10 devices. On one device you'll need to become a sessions host/quiz game host and on another device join the session and answer the game questions.

Note - Bluetooth must be enabled and the devices that are messaging with each other must be on the same network. Bluetooth is used for discovery of sessions, and the connection then occurs using a network connection e.g. WiFi or Local Area Network (LAN). Discovery will not work over the LAN if you joined to a public network as it will be blocked by the firewall. This applies to both session and device discovery.

Code at a glance

The Remote System Session API provides the following functionality:

  • Create - ability to create a session for participants to join
  • Discovery - discover sessions
  • Participants - the ability to join a session, leave a session, and invite session devices
  • Messaging - broadcast or targeted participant messages

Note -The Remote System Session API also supports a workflow to invite participants, which is currently not covered in this sample.

In the sample, the SessionsHelper.cs contains the core code for working with the Remote System Session API. From here you'll be able to construct calls to create a session for device participants to attach to. Some key API concepts are:

  • RemoteSystemSession - A sharing session object with participants. Messages are broadcast to all participants or targeted to a specific participant based upon preference.
  • RemoteSystemSessionWatcher - A watcher object that is notified about remote sessions that have been added or removed.
  • RemoteSystemSessionMessageChannel - The channel is a logical construct on top of RemoteSystemSession. The channel provides the flexibility to create named channels for dedicated data transfer. Channels can be reliable or unreliable. In both cases the ordering of the messages is not guaranteed.
  • RemoteSystemSessionParticipant - Represents a participant in a session. A session can have one or more participants.

 

windows-appsample-remote-system-sessions's People

Contributors

bmitchell287 avatar joshuapartlow avatar karlerickson avatar matchamatch avatar microsoft-github-policy-service[bot] avatar msatranjr avatar stevewhims avatar supernova-eng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

windows-appsample-remote-system-sessions's Issues

does not reliably connect

I have set the game up on different host/client combinations for 2 - 3 machines about 20 times today with only 1 successfully maintained join and play. All 3 machines are located within a few feet of each other and a few feet of my wifi router. Still working on it, but have not figured out why I cannot establish and/or maintain a connection.

I love this sample app, btw.

Unhandled System.Runtime.Serialization.SerializationException: "DateTime values that are greater than DateTime.MaxValue or smaller than DateTime.MinValue when converted to UTC cannot be serialized to JSON."

On the Quiz Host the following exception occurred after quiz has been started with one remote client.
System.Runtime.Serialization.SerializationException ist aufgetreten.
HResult=0x80131500
Nachricht = DateTime values that are greater than DateTime.MaxValue or smaller than DateTime.MinValue when converted to UTC cannot be serialized to JSON.
Quelle =
Stapelüberwachung:
at System.Runtime.Serialization.Json.JsonWriterDelegator.WriteDateTimeInDefaultFormat(DateTime value)
at System.Runtime.Serialization.Json.JsonWriterDelegator.WriteDateTime(DateTime value)
at System.Runtime.Serialization.Json.JsonClassDataContract.WriteJsonValueCore(XmlWriterDelegator jsonWriter, Object obj, XmlObjectSerializerWriteContextComplexJson context, RuntimeTypeHandle declaredTypeHandle)
at System.Runtime.Serialization.Json.XmlObjectSerializerWriteContextComplexJson.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
at System.Runtime.Serialization.Json.DataContractJsonSerializerImpl.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph)
at System.Runtime.Serialization.Json.DataContractJsonSerializerImpl.InternalWriteObject(XmlWriterDelegator writer, Object graph)
at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.Json.DataContractJsonSerializerImpl.WriteObject(XmlDictionaryWriter writer, Object graph)
at System.Runtime.Serialization.Json.DataContractJsonSerializerImpl.WriteObject(Stream stream, Object graph)
at QuizGame.SessionManager.d__39.MoveNext() in f:\dtr\Documents\Visual Studio 2017\Projects\Windows-appsample-remote-system-sessions-master\QuizGame\SessionManager.cs:line 286
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at QuizGame.ViewModels.LobbyHostViewModel.d__5.MoveNext() in f:\dtr\Documents\Visual Studio 2017\Projects\Windows-appsample-remote-system-sessions-master\QuizGame\ViewModels\LobbyHostViewModel.cs:line 66

Innere Ausnahme 1:
ArgumentOutOfRangeException: Specified argument was out of the range of valid values.

Error when trying to compile the solution

Hi,

When I clone the repo and then try and compile it, I am getting these errors:

1> C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Common.targets(335,13): error MSB4064: The "EnableTypeInfoReflection" parameter is not supported by the "CompileXaml" task. Verify the parameter exists on the task, and it is a settable public instance property.
1> C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Common.targets(308,5): error MSB4063: The "CompileXaml" task could not be initialized with its input parameters.

In have the latest windows 10sdk

Anything else I need to do for the UWP to compile and run? I am a bit new to this UWP development, have normally been backend and web.

Thanks a lot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.