Hey folks,
I'm developing an android app which relies on a custom plugin, so I need to build a player with that plugin incorporated.
Before making it, I wanted to try my hand at creating a player with a plugin that is already known working.
I based myself on this thread to figure out how to make & run a player w/ a plugin on my device:
https://forum.giderosmobile.com/discussion/830/creating-a-simple-android-plugin#Item_10Unfortunately, I'm having trouble getting a player with a user plugin to work on my phone.
What I'm using:
Android API 28
NDK r25
Gideros Studio 2023.6
Android Studio 2022.2.1
Eclipse 2019-06
Target device is an Honor 7x BND-L21 running android 28
What I tried:
-Making a blank project, exporting it as Android (Target API 28)
-Importing the project under Android Studio
-Running on phone
It works
-Making an empty project with the plugin "clipper"
-Same process as above
It works
-Making a project with the plugin "bitop" mentioned in the thread above
-Importing under Android Studio
-Adding the libbitop.so file in the jniLibs folders
-Adding the line "System.loadLibrary("bitop");" in the [AppName]\Activity.java file
-Running on phone
It crashes immediately
So I switched to Eclipse to try and have the same conditions as in the thread:
-Imported the blank project under Eclipse
-Switched the build target to android 28 (it was set to 15 by default)
-Ran the app on phone
It crashed immediately
I noted that removing the "assets" folder (which is empty) has no effect in any scenario I tested.
I can try using an older API, but seeing that I can't even create a clean player with Eclipse, I feel like I'm missing something important here. Any help would be appreciated.
Comments
I went ahead and compiled BitOp.so to get a hopefully more modern version that I can test in parallel (I want to make sure the plugin is actually functional).
I also tried building for Android 15 in Eclipse, but the player still crashes. Since I want to use modern plugins, I'm not sure going with Eclipse is a good idea anyway, given that Google dropped Android support for it in 2016.
I tried what you suggested, but to no avail. My guess is that I was already using the most recent Gideros .so files when I was exporting the different test projects to android, and transplanting them in the sample BitOp project didn't help (kinda expected that, since it's 11 years old!).
I'll test other plugins and see if one works, and try to figure out how things work from there.
The best way to get started in building and integrating plugins is to have a look at how they are done in gideros repository itself.
There is an example plugin for that purpose here: https://github.com/gideros/gideros/tree/master/plugins/exampleplugin
All the plugins in there expect to be located under the 'plugins' folder, and have the 'Sdk' folder next to the plugins folder. You can take the Sdk folder from your latest Gideros installation.
You can run NDK in your plugin source/Android folder, and gather the generated files into your plugin distribution folder (to be put under your 'User plugins' folder). You'll also need to write/adapt a .gplugin file describing how Gideros should integrate your plugin in the end project.
Once Gideros Studio recognize your plugin and you have added it to your project, just export your project as a 'player', either directly as an APK if everything is ok, or as an android studio project (untick build apk) to refine your integration.
I hope this helps.
If I'm not wrong, that's indeed the one I was testing here: https://forum.giderosmobile.com/discussion/830/creating-a-simple-android-plugin#Item_10
At first I thought it wouldn't be a problem since I planned to replicate step by step the old methods to run plugins, but I'm getting link errors that I can't fix, so I'm giving up on this method for now.
@hgy29 Nice, I hadn't considered looking up the github for examples. I managed to get a player running with the example plugin, but now when I try to run the sample code, I'm getting a "Class not found" error. I'll double check if I missed something in the process.
Interestingly enough, installing the player directly from Gideros gives me a link error (libgvfs.so not being found).
Still, a step in the right direction!