0

I have SDK (.jar file) written in Java. I created an Android Java Bindings Library following that description. I used the generated JNI files from the jar to write the API for my Xamarin plugin. I dont have experience with Xamarin, so I would like to ask you these questions:

  1. My SDK.jar file depends on the Google Play Services.jar file. How and where I have to add it? I want to make the plugin to add the Google Play Services automatically to the project where it's installed my plugin. Like Google Play Services plugin adds Support library when it's added.
  2. Could someone explain to me what's the difference between Components and Packages? I have these folders and I dont know in which one I have to add the Google Play Services Plugin and what's the difference.
  3. How to get the current activity from my API files? I dont use Xamarin.Forms. Should I?

Thanks in advance

2 Answers2

0

Here are the answers of my 2 questions:

  1. in component.yaml file before publishing the plugin: http://developer.xamarin.com/guides/cross-platform/advanced/submitting_components/components_and_nuget/

  2. Don't have the answer yet...

  3. Can't get it from API files if you dont send it as a parameter, but then your API is not compatible with the iOS API. Because of this I separated the plugin: one for Android and another for iOS.

0

To clarify:

Answer for 2:

Components are Xamarin Components whereby packages are mostly nuget packages. User is not forced to publish component on Xamarin Component store, but many do. Some don't because Xamarin Component must have accompanying samples, documentation and screenshots, so for the large number of users effort to implement component is substantial. That is the reason a lot of authors just publish their SDKs on nuget.

Xamarin Components are tested before publishing by Xamarin Components Team and the reason is mainly correctness and quality (something like Apple's app submission process). This should help users to have minimal/starter samples that show how the SDK/component work and some documentation.

Some authors publish their components in steps: first nuget and when samples and docs are ready then Xamarin Component which references nuget dependencies mentioned in 1st step. This is called empty-shell (or just shell component). User can install it either as nuget or as component into some application or library.

Packages (nuget) are installed via Nuget Package Manager in Visual Studio or Xamarin studio. While components are added to you project. Samples and docs can be found in Components/ folder in solution root.

Plugins are special form of component used mostly for cross platform Xamarin.Forms (but not only) applications and they utilize special technique called bait-and-switch for loading platform specific dlls (from nugets).

Google Play Services (GPS) are not plugins, because they are Android only, so no need for plugin (ios and Windows parts). I think there is only Game Service on iOS, but not sure. GPS come in 2 flavors as nuget packages and as components (empty shell).

moljac
  • 946
  • 9
  • 12