Resource does not contain a definition for Raw while migrating resources in a MAUI app and how to load them - xamarin.forms

While migrating a Xamarin forms app, I find my self having this Android specific code that try to load my sound resource with a resource id
MediaPlayer.Create(Android.App.Application.Context, Resource.Raw.beepok);
I see that maui is bunding everything on Resources\Raw\** as MauiAsset
How i can still get the resource id?

It seem that AndroidResource still works, it seem that i was hit a build cache of sort, after clean and restarting vs the resource is available

Related

how get key/value from nsuserdefaults .plist configuration file Xamarin forms

I am working as a Xamarin forms iOS enterprise app.
We pushed config.plist (Some key-value pair) file to a real device using Mobileiron/airwatch MDM/EMM(Services). Then we deploy the Apps on iPads using MobileIron. When the app starts, the app gets Url/ credentials from config.plist that pushed by MDM.
after googling I found config.plist stored in device which in NSUserDefaults​
But I am don't know is the .plist stored in NSUserDefaults with apps bundle id or something else.
Please anybody has the same issue before writing to me how I have to implements or getting value from .plist
I think you will find the details from your question on page 69-70 of Apple's MDM-Protocol-Reference. The MDM server deploys these settings using a dictionary that contains an array of bundle ids, with the settings for each app within their key. Because of how sandboxing works, your app just has to retrieve the com.apple.configuration.managed key to get its settings.
A great resource is https://www.appconfig.org/ios/

Check for PNR existence from JS in a web RedApp

We are creating a web RedApp from SabreRedWorkspace and we need to check for the existence of a valid PNR before adding some passive segments.
We need to do it from an Angular app, and we can't find ant doc or example about it. Everything talks about RestAPI or the new NativeAPI and we can't find anything about web RedApps
Any help? Someone could point us to any doc or example?
You can use Javascript API for that, using SrwApi3.retrievePnr("1.0.0") which is injected on the DOM for Web RedApps.
Please make sure to download the latest SDK from https://beta.developer.sabre.com/guides/travel-agency/sdks/sabre-red-360-resources, version 19.5, there where changes on this release exactly about "Get PNR" APIs.
For more documentation, you can check on the SDK documentation folder : [extracted dir]/red-app-sdk-3.0-19.5/documentation/htmls/get_pnr_(web_api).html, ob by navigating from index->New Sabre Red Workspace Developer Toolkit->Sabre Services 3.0, Get PNR (Web API)
Also theres sample code provided on SDK, look for the compressed project under samples folder : com.sabre.redapp.example.webkit-1.0.8-SNAPSHOT-v20190516-1622.zip

ASP.net MVC4 WebAPI JSON Medium Trust

So, I've been playing with ASP.net MVC4 and the new WebAPI the past few days. One of the first things I always do when starting a new app is throw <trust level="Medium" /> into my Web.config so I can be sure my app will run on most hosts.
Usually, if I use the stock Microsoft stuff everything works without a problem. But tonight I was having problems following Brad Wilson's Webstack of Love presentation. All of my AJAX calls were returning a Server 500 error. However, when I would hit the WebAPI directly in the browser, it would return everything in XML format.
So I assume the serialization to JSON withing the WebAPI controller is what is causing the issue. My question is how to work around this?
It bothers me that Microsoft teaches shared hosts to play it safe and lock things down to Medium Trust, then creates new web technology that won't work in Medium Trust. Maybe everything will be fine when it is a final release and the binaries are installed in the GAC? It can take months for shared hosts to upgrade to the latest and greatest.
It seems like the biggest problem is usually Reflection--90%+ of the stuff I've tried that won't run on Medium Trust is due to this (For instance, I'd love to use AutoMapper instead of hand-coding ViewModel => Entity mappings). Is there a way to confine Reflection to the assemblies within an app so it can become part of the Medium Trust feature set and make this problem a thing of the past?
I set up Failed Request Tracing on IIS when I found that the Application_Error event wasn't even firing in my Global.asax. This is the exception being thrown. Not sure how to get any more details.
Warning -MODULE_SET_RESPONSE_ERROR_STATUS
ModuleName ManagedPipelineHandler
Notification 128
HttpStatus 500
HttpReason Internal Server Error
HttpSubStatus 0
ErrorCode 0
ConfigExceptionInfo
Notification EXECUTE_REQUEST_HANDLER
ErrorCode The operation completed successfully. (0x0)
Link to sample project displaying the issue. Also enclosed in the base "Test" directory are screenshots of my fiddler tests: XML-fiddle.png & JSON-fiddle.png.
Web API works just fine in medium trust. Also, since RC version, it 's not deployed to GAC anymore. You can just xcopy Web API dlls onto the server and reference them (or simply just publish your project from VS or git publish it if your host support it, like Azure).
You mention web stack of love. Well, it is SignalR that doesn't work in medium trust mode. See here - according to David Folwer, it won't anytime soon https://github.com/SignalR/SignalR/issues/364
Finally, if you are getting error 500s always add this to Global.asax
GlobalConfiguration.Configuration.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;
to receive verbose errors.
My problem had to do with the serializing of Entities with circular relationships (in this case Countries => States, State => Country). The JSON serializer was unable to handle this which led to a 500 error when requesting JSON.
I often use Entities directly for mocking things up and getting a prototype. I always planned on using distinct View Models anyway, but I wanted to understand what was going on and why it was failing.
Kiran Challa's answer in my ASP.net forums question helped me get the error that was occuring: "The RelationshipManager object could not be serialized. This type of object cannot be serialized when the RelationshipManager belongs to an entity object that does not implement IEntityWithRelationships."
That then led me to the Serializing Circular References with JSON.Net and Entity Framework on johnnycode.com.

Using flash builder 4.5 for php wizard for remote object

I'm fairly new to Flex\AS3
I'm using flash builder 4.5 for php and I'm trying to connect to my DB via remote objects.
I'm following adobes instructions as listed here:
http://help.adobe.com/en_US/flex/accessingdata/WSbde04e3d3e6474c4-668f02f4120d422cf08-7ffe.html#WSbde04e3d3e6474c4-668f02f4120d422cf08-7ffa
I've created the php service, and successfully finished the wizard.
I've tested my service with the Test tool and it is indeed returning my results.
My problem is that it seems that flash builder didn't create the service's files(super+base) at all. For example, when I drag the service into a dropdown component I get an error saying that the service component can't be found.
Does anyone know this issue happens? how can the test tool work if the service classes don't exist?
Thanks in advance,
Ravid
The problem was that I didn't checkout the files before using the wizard so flash builder didn't have write permissions on the files and therefore didn't create the necessary files.
once he had the write permissions - everything worked just fine

404 Error using Flash Builder 4 BlazeDS wizard

My issue this time around is trying to use the new DCD BlazeDS wizard in Flash Builder 4. If I set my project up as a combined Java/Flex app I am unable to connect to the RDS servlet using the wizard. I get a 404 error every time.
I'm certain the service is set up correctly since my app can access the exposed java classes and BlazeMonster can see the exposed services.
Is anyone else having this issue and if so has anyone found a work-around? I'd very much like to use the code generation features of the wizard for my project.
Thanks as always,
Codeflayer
You also need to make sure you have the RDSDispatchServlet setup in the web.xml config file.

Resources