Working example for Xamarin-Forms mobile C# client

How do I use in the right manner a RoSDK-service from Xamarin-Forms-C# client?

The …_ServerAccess.cs file gives me ServerAccess.Instance
Should i use this singleton?
How do i make a async call on ServerAccess.Instance.Service…Async ?

Is there any working example?

Hello

It is completely up to you how you do organize your code. The ...ServerAccess file is no more than a sample how server access code could look like. If you’ll take a look at its code you’ll find out that it is extremely simple. The only action there is instantiation of service proxies.

As simple as calling *Async method. F.e. this code calls method DoSomething of the service SomeService:

var result = await ServerAccess.Instance.SomeServiceAsync.DoSomethingAsync("aaa");

Regards

Thanks, the *Async method-part wasn’t automatic generated in interface file by RODL importer. i have created a new one with service builder.

Probably RODL importer didn’t recognize the project type you use as one that supports *Async methods. Could you say which exactly project type do you use (ie which template did you use to create the project)?

Visual C# -> Cross-Plattform -> Cross-Plattform-App

Thanks, logged as bugs://79487

Thanks for the report. Seems Cross-Platform projects were detected as using old .NET FX version w/o async/await support. I’ve logged an issue to fix this.

bugs://79487 got closed with status fixed.

1 Like