How to create a library from my C# project that runs on Android

Imagine this scenario. I have a Unity game that runs in Windows and Android. All code is C#.
It runs perfectly fine in both platforms, however now I need to move some classes to a separate library. They don’t use Unity classes, just .NET 3.5 classes.

For Windows I created a separate project with the classes and built a DLL that I added it into “plugins” folder. It works fine.

Now, how can I do the same for Android?

  1. How can I create a library from my C# classes compatible with Android?
  2. What extension would it have “.so” any other?
  3. Where should I put the library in my project (plugins folder)?

I have read I could create a PCL library but some people says it is not supported by Unity, and I’m not quite clear how can I create it and use it anyway. It is worthy to mention I don’t want to translate my code to Java or C++.

Thanks.

Never mind. I was assuming my DLLs were not working because some issue between running in Android and using a DLL. But no, there was an issue because my library was trying to access a file incorrectly, once that was fixed, it worked just fine.

So, just to leave this here in case anyone had the same questions, the answers are:

  1. Yes

  2. dll

  3. just drop it in plugins folder, no difference with Windows version

I’m not sure about PCL, but it may not be needed as in my case. Just create a library with .NET 3.5 version.