iOS Widevine with Xamarin - hyperlink

I am needing to use the widevine api in an ios app written in xamarin. From what I understand I need to make a wrapper for the library and such, but I have no idea where to start. Can anyone either explain in more detail what to do, or point me somewhere that explains it well?
Thanks, I am quite new to Xamarin, and rusty on C#

You definitely want to follow Jason's comment. In short, you need the .a (fat library) and the header files and then create a Xamarin.iOS binding project that exposes the native interface to C#. Access to the source code is not necessary.

Related

Creating a Xamarin Binding project for PebbleKit iOS

For the past while I've been trying to create a binding project in Xamarin for PebbleKit iOS (the SDK for the Pebble smart watches). My hope is that in doing this I can create a Xamarin C# app that communicates with a Pebble smart watch, just like how you would in Objective - C.
Here is a link to the github page containing the code: https://github.com/dankunc/PebbleKit-Xamarin/tree/master
Also, here is a link to a simple harness project that just contains a button you can use to test out the binding project: https://github.com/dankunc/PebbleKit-Xamarin-Harness
Note: If any of you are kind enough to download the code and try it out, you'll probably need to update the reference path in the harness to the .dll in the binding project (PebbleKitAll/bin/release/PebbleKitAll.dll)
The project compiles, however when I go to use it in an actual Xamarin app, this code returns null to watch:
var watch = PBCentral.DefaultCentral();
In objective - c, the equivalent method would never return null, and I've been struggling with this for quite some time.
The PebbleKit binding project relies on two .frameworks from Pebble (PebbleKit and PebbleVendor) and a handful of other frameworks that get included in the harness project. I generated the ApiDefinition and StructsAndEnums files from using Objective Sharpie which I then cleaned up afterwards.
If anyone is able to help me with this, or if I need to provide more information or anything else, please let me know, and anything is appreciated. I've been struggling with this for quite a while and am at wits end. Thank you.

Creating an iOS library or framework using libgdx (roboVM)

Is it possible to create an iOS library or framework using libgdx (RoboVM) that can be imported into Xcode?
Background:
One of my colleagues has created a 3D visualisation app as a libgdx project for android and windows desktop. It can be compiled to run on iOS using RoboVM. However, I would like to wrap extra native user interface elements around it using Xcode. I know its possible to build the user interface programmatically via RoboVM but I would be keen to investigate if its possible to bring the existing work into Xcode. I don't need to edit the 3D visualisation component but add extra GUI elements around the 3D Vis window. I thought compiling the libgdx (RoboVM) code to a framework or library might be a solution that could be imported?!
Yes you can do it.
All you need to create a method, say initRoboVM(), This will be called by your code when you want to initialize libgdx. You'll need to pass the app path in, which you can hardcode when you're testing.
initRoboVM() will need some modifications, namely it should not call your Java app's main method, well, at least, that's what well behaving libraries should not do IMO. It should also not call rvmShutdown.
You can get further information from here
Thanks :)
I asked the RoboVM team directly. Their answer: It's not a native function, but it certainly can be done.
The complete message...
Hi,
Sorry for the late reply. This use case is not something we're going
to do now. It is possible though if you're prepared to do some
patching of RoboVM. Search the RoboVM Google Group and you should find
others who have managed to get this working.
We get this request every know and then so we will add support for
this eventually.
Regards, Niklas

Xamarin 4.8.0 System.Net.WebRequest.CachePolicy Mocking a setter

Up till this morning I was using the latest non beta Xamarin.Android (4.6.8). This had support for setting System.Net.WebRequest.CachePolicy which is used in a 3rd party library I reference in a project. I don't have the source code for this library and so cannot remove the line or replace it with HttpClient and the library is fundamental to the project.
Hopefully Xamarin will reinstate support for this property but if they don't, I'd like to know how to mock/dummy/extend/replace the property to make the code compile. No functionality is required behind this property.
Can this be done? Is this approach even correct?
Thanks in advance
I'd recommend you take this problem direct to support#xamarin.com
It sounds like a breaking change in a brand new commercial software update - so I suspect it's something that the commercial support can help with more easily than the community.

Is there a way to make a native cocoa class library in MonoTouch?

I know that MonoTouch compiles code down to native machine code. Is there anyway to make a native (.a) class library using MonoTouch? Just to be clear, I'm not looking to share code between the two since I know that is not possible.
I believe it might be possible, but it would be hard work, and it's a long way from shrink-wrapped out-of-the-box functionality.
For reference, take a look through the answers on Is there a way to mix MonoTouch and Objective-C? - that question is about how to bootstrap and then call into mt from an obj-c application. I think the same approach would just about work for a .a library.

Is the AWS.net library compatible with MonoTouch?

I'm working on a new app using MonoTouch and I'd like to store data in AWS.
I saw there is an AWS.net library available from Amazon, but I don't know if I can use it with my MonoTouch app. Can I?
standard .NET binaries won't work, per FAQ: http://monotouch.net/FAQ (Can I use standard desktop Mono assemblies or .NET assemblies with MonoTouch?).
Edited: All you need to do is rebuild the source code with Mono's C# compiler
I think the better option is to use the AWS SDK for iOS and write bindings to the Obj-c library. There are examples out there of how to write bindings if you just do a search for it. It probably isn't the quick solution you were hoping for but you probably don't want to use the SDK for .NET anyway as it probably wasn't intended to be used on the iPhone.
If you do end up writing bindings for it, please post it on github for everyone else to use. Solve once for many, right? :)
For standard upload of files from monotouch to S3 I used this Library ,
recompiled in MonoDevelop using MonoTouch Library Template and done ( use System.Web.Services instead of System.Web ).
Recompile AWS for monotouch has to be really difficult because of the heavy use of System.Web and IOrderedDictionary ( ThirdParty Libraries ).
I just built the AWS SDK for Monotouch/Mono for Android. I had to modify some files and add some classes from the current Mono release.
GitHub repo is located here:
https://github.com/fr500/aws_sdk_monotouch_monodroid
It's my first attempt at this, and it's working but I don't know if my approach is correct. Any help will be appreciated

Resources