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:
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.
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.
How to get the current activity from my API files? I dont use Xamarin.Forms. Should I?
Thanks in advance
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).
Here are the answers of my 2 questions:
in component.yaml file before publishing the plugin: http://developer.xamarin.com/guides/cross-platform/advanced/submitting_components/components_and_nuget/
Don't have the answer yet...
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.
Related
I have a project using an old version of google play services that I need to keep otherwise it would need to be heavily rewritten. Now I have added a new library that uses a newer version of google play services and I get a duplicate class error.
How can I force android studio to use the newer version of google play services in the library for the library but also be able to use the older version in my app?
Unfortunately, this isn't possible. The classes for your app and the library are combined to form your APK, so you can only have one version of a given library. You could force it to use one of the two versions (for example, something like this), but based on your statement that it would need to be extensively rewritten, I assume that the two versions are not API compatible.
There are utilities like Jar Jar Links that can solve this in some cases, but (especially based on the embedded proguard rules, which reference classes found via reflection) I'd be surprised if it worked in the case of something as complex as Google Play Services, which is likely depending on its class names remaining unchanged.
I have a "normal" Android app, made in Eclipse/java, published in Play Store, already at version 3.x, all works fine.
Now I am thinking to move the project to Xamarin/c#, and make the 4.0 there.
My question, what should I take care/be aware, that this change should be a natural continuation of the 3.x from Google Play/Users perspective?
So that I could simple upload the APK made by Xamarin to Dev Console as a new version upgrade, and not as a new App.
Like:
Existing signing key should be reused in Xamarin?
Package name (java <> xamarin c#) must be the same?
???
Thanks
There is absolutely no difference for google what language you natively used to write an app. By the way Xamarin will be compiled to java before packaging into apk.
Also Xamarin uses the installed Android SDK and installed Java SDK you have used before to sign the apk and compile the app. It also is going to use same keys so sign the apk.
So no worries, keep same package name and you're good for the update.
I have jar library that developers can integrate in their Android app. The problem is that developers update my library very rarely, for example once in a year. For that time may not work due to new Android version, or I found critical bug after integration in my library.
Is it possible that library can update itself without update an APK?
Something like using downloadable jar or dex file.
I want to add adMob and Google Play Game Services to my app for iOS and android. I know I can do this using bindings. I have been searching online and that is what I have found. However, being new to programming, I cannot find a clear cut tutorial on how to use this, I do not know what a binding is nor how to install RoboVM or what it is. Would anyone be able to help me out on how to use RoboVM to accomplish this with simple and easy to follow steps.
RoboVM is deprecated in favor of RoboPods.
https://github.com/robovm/robovm-robopods/tree/master
Follow the instructions on the site, just add the line of code for the jar you want to include. Add the link under iOS section of your build.gradle located in your project directory.
Then just refresh Gradle. For eclipse, right click project, gradle>refresh all. You now have the jar in your Gradle Dependencies. Now you're just missing the code to show Admob ads and Google Play Game Services.
I am new to Android app development.
I read the note on step 3 of Add Google Play Services to Your Project in this link.
Why should we reference a copy of library but not directly from the Android SDK directory?
Is there any software engineering principle behind?
You can use it directly from the Android SDK directory. But i think, Google recommends to copy library just for compatibility. If you are using link, so after update to new version of SDK (and Google Play Services) your code may not working any more (if they change something in api, for example).