Nuget Libray in Unity for other platform - android

I have a project that used Nuget Libraries and I implemented in Unity using C#. The program worked if I run Unity in Windows, but I wonder is it possible to port this project to another platform using Nuget library inside the code? because Nuget Library is a library for .NET in Windows. I actually want to implement this Nuget Library to LuminOS which can run the application from unity.
If I use Nuget Library in Unity? Is it possible to deploy the games on another platform besides Windows for example for Android, iOS, or LuminOS? Is it gonna work because Nuget package is libraries we use for Windows?

hi i have the same problem except i want to build for android and i have searched for an answer this is what i got:
you should reach to .dll files and put them in package folder and this is the only way it will work on android here is an example:
https://answers.unity.com/questions/743400/database-sqlite-setup-for-unity.html
I managed to make it work some thing you should keep in mind is i think the only way to make it happen is by set your player build settings -> other settings -> scripting Backend to Mono and Api Compatibility Level to .Net standard 2.0

Related

Problem with Integration of an Existing Android Library When Building an Android Library

I need to build an Android library for use inside a Unity project. There's nothing different about the build process itself and I managed to build a simple plugin library I can use and I can see commands going in and information coming out.
But now I need to include an external library. I know the library works because I have a demo project, an app, that runs on the required device and does what it's supposed to do. But the instructions to integrate it into a project assume that it is an app and so, do not make much sense in my case.
I have scrolled through a dozen manuals about integrating android libraries but none of them seem to work. I would appreciate a set of instructions about how to integrate an external library in an android project, considering the project is, itself, a library, with respect to the latest Android Studio and build tools.

Creating a Xamarin Form Library in Visual Studio Mac

I want to develop a library for Xamarin Forms just like how we do in native iOS and android, like .framework or .a for iOS and .aar and .jar for Java Android.
I researched a lot and saw that we can create a nuget Packages based on Platform dependent environment .. But In my case I want to create a SDK which will only make HTTp calls and hence I don't want to use any platform dependent code .
I also found that we can create .Net Standard Library, but didn't get any useful material or Link to work Forward.
My Requirement is to create a SDK which can be used in Xamarin Forms Project . Can SomeOne Please guide me.
Thanks in advance

How to create a class library based on MonoGame to be used from UWP, iOS, and Android

I've installed VisualStudio 2015, Xamarin, and MonoGame 3.5. I'm going to build my XNA app for Windows UWP, iOS, and Android.
I've some libraries based on XNA... and I need to build them for the three target systems (Windows UWP, iOS, and Android), but no way to create a library for Windows UWP. I've tried to create a MonoGame Windows 10 Universal Project, but such a project cannot be converted to generate a DLL.
I've also tried to create a Class Library (Universal Windows) project, but then I was unable to add MonoGame.Framework to the references.
I've the same problem when creating a MonoGame Android Project... no way to switch to a library project. The only MonoGame project that can be modified to be a library project is MonoGame iOS Project.
That said, how can I create a class library based on XNA (MonoGame) to be used from UWP, iOS, and Android?
As far as I know you've only got 2 options here.
Portable Class Libraries
Shared Projects
I haven't really used Shared Projects much. The way I understand them is that they allow you to share code between multiple projects as if it lives in a library but it actually gets compiled directly into the referencing project. They can be thought of like advanced file linking.
Portable Class Libraries are a bit of a different beast. I've used them in the MonoGame.Extended project with great success, but it wasn't always easy. The way they work is to provide a subset of functionality that works on all target platforms. They compile to a DLL that can be referenced by any of the projects and you can be confident the code will be the same.
There are a couple of downsides of using a PCL:
you can only use a subset of functionality. Surprisingly, this doesn't get in the way too often.
if the PCL references another library, it also has to be a PCL.
The second point is where things get a little tricky with MonoGame. Typically, MonoGame isn't shipped as a PCL, but a PCL version has been published on NuGet that can be used.
As it stands right now, the NuGet package is a version behind the official release but surprisingly that doesn't really matter because it's a bait and switch PCL which essentially means it just provides the interface to the real DLL that gets used at runtime. In other words, your game will still happily reference version 3.5 even if the PCL is version 3.2 so long as the interface hasn't changed.
There is some talk about improving this situation in version 3.6.
I noticed MonoGame projects are built using .Net 4.5 by default. Regular class libraries default to the latest installed version of .Net which in my case was 4.5.2. I was able to reference a regular class library by going to its project properties and setting the target framework to 4.5. Hope this helps.

How to embed jars to make them usable in Xamarin cross-platform App

I am trying to port my Android Application, developed with Google Android ADT, in Xamarin to make it cross-platform and runnable on iOS devices.
I am ready to translate the needed code from Java to C# but I don't know the best way to manage external libraries.
I am using 3 jars in my App:
android-support-v4.jar
mysql-connector-java-3.0.17-ga-bin.jar
YouTubeAndroidPlayerApi.jar
I tried to embed them following these instructions:
http://docs.xamarin.com/guides/android/advanced_topics/java_integration_overview/binding_a_java_library_%28.jar%29
but I'm getting some compilation errors. Here's one of them:
'Com.Mysql.Jdbc.Util' in '[..]\AndroidHelloWorld\JavaBindingLibrary\obj\Release\generated\src\Com.Mysql.Jdbc.Util.cs'
is in conflict with
'Com.Mysql.Jdbc.Util' in '[..]\AndroidHelloWorld\JavaBindingLibrary\obj\Release\generated\src\Com.Mysql.Jdbc.Util.BaseBugReport.cs'
I don't know if it's worth going on trying to fix the errors or it's better to use native libraries for iOS.
As you'll have separate projects for each platform, I would just use the appropriate jars, as there can be differences in the way Youtube works, for example, that would make the android jar unusable in an iOS project.
But about the errors you encountered, it's worth reading this link thoroughly.
You won't be able to use any of your Android specific code or libraries on iOS.
You have two basic options for cross platform development, to create a Xamarin Forms project or create a iOS, Android and Shared project.
If you decide to go with Xamarin Forms you will need to:
* Extract your platform independent code into a shared PCL project
* Redevelop your front end in Xamarin Forms
If you decide to go with separate projects you will need to:
* Extract your platform independent code into a shared PCL project
* Develop an iOS front end project

open-source alternative framework for Android

After about two months of Java development for Android, I still don't like the API, so I would like to switch to another framework.
I also want it to be open source, to compile to native packages and, if possible, not dependent on Eclipse.
My OS is Debian GNU/Linux.
I already tried several: PhoneGap (requires Eclipse), Appcelerator Titanium (non-open source license), and Python4Android (not native).
Please try Sencha touch 2. Open source, compatible with phonegap and supports cross platform development.
Have you checked out Mono? Create Android apps in c#/.net but still have access to native api!
monoforandroid

Categories

Resources