mapzen / android

Where you can find everything Android from Mapzen
http://mapzen.github.io/android/
Apache License 2.0
118 stars 66 forks source link

Importing Mapzen Android library into Xamarin #322

Open rmglennon opened 7 years ago

rmglennon commented 7 years ago

This question came in through email support. I'm adding the user's question here to close the support ticket, and in case someone in the community has an answer or knows about Xamarin and could contribute the bindings.


I have encountered troubles in importing your Android library (mapzen-android-sdk-1.2.1.aar) in the project (Xamarin for Android, Visual Studio 2017), I need your help.

In order to use Java library in Xamarin a special library binding is required as a bridge between Java and C# code. Here it is described in detail: https://developer.xamarin.com/guides/android/advanced_topics/binding-a-java-library/binding-an-aar/

Having tried to follow the guide I get numerous errors and warnings, and binding library is not built correctly. I suspect the issue to be in dependencies on third-party libraries like dagger, javax.inject, Android AppCompat library and so on. I tried to add them as links to the project, but positive result was not reached. Maybe I use incorrect versions of libraries or something like that.

I searched the question in internet, no result. It seems that by the moment nobody connected MapZen and Xamarin yet. :(

So,

  1. Could you please help me (and all other Xamarin developers as well) with creating this binding library? You know the internal structure of your Android API, so it could be much easier for you to create the binding correctly.

  2. Maybe you already have a native library (component) for Xamarin, which is simply not published yet? I would appreciate very much to be your beta-tester.

ecgreb commented 7 years ago

The Mapzen SDK does not currently support Xamarin bindings.

This is not on our immediate roadmap but we can keep this issue open in case anyone else in the community (maybe with more Xamarin experience that me) wants to start working on a Xamarin adaption of the project.

matteblair commented 7 years ago

I have a little past experience with Xamarin, unfortunately.

Since Xamarin is a cross-platform framework I can imagine that it would be difficult to directly bind all of the features of our Android SDK to C# via Xamarin (may pieces of our Android SDK are directly tied to Android frameworks). We would get a better result by just writing our own version of the SDK in C#.

We (the graphics team) have been eyeing a Unity3D plugin for some of our services, which would also be a C# layer.

@rmglennon Could we ask this user which specific services from the SDK this user would be interested in using? Some of them might be easier to port than others.

Zidar commented 7 years ago

@matteblair, It was me who asked for Xamarin support. First of all, I am interested in basic map functionality like displaying a map, interacting with map, working with markers/polygons and tiled overlays. Generally, I am targeting my app to Android and UWP (Windows 10) platforms. Other potential developers would also like to target iOS as well.

klzig commented 7 years ago

@matteblair I have the same problem, targeting android/ios/uwp with Xamarin in Visual Studio. Starting with map rendering but will eventually need search and turn-by-turn. Any help would be appreciated.