So, I need to include “android.os” in my project to use native vibrator class (to make the device vibrate for a given amount of time, Unity’s own vibration method is too primitive). My searches always ends up on this page about building plugins. My programming skills are mediocre and I really couldn’t comprehend this. It seems like a really complicated process for such a basic outcome. Can anyone explain how to do this in simple steps or is there an easier way. Or maybe someone already done this could share his files/codes etc. I am really lost here, help please.
PluginsForAndroid says, that you should:
-
put your .so file under Assets->Plugins->Android
-
link it with this code in any C# script:
[DllImport (“PluginName”)]
private static extern float FooPluginFunction ();
Where PluginName without .so is the filename and everything after “private static extern” is equal to the method you want to bind.