Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Trying to create an android plugin & incorporating it in a player — Gideros Forum

Trying to create an android plugin & incorporating it in a player

FrancoisDMFrancoisDM Member, test
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_10
Unfortunately, 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.

Likes: MoKaLux

+1 -1 (+1 / -0 )Share on Facebook

Comments

  • hgy29hgy29 Maintainer
    The thread you mentioned is very old, and so are the Gideros libs used in the zip file you probably used. You should grab the newest .so and headers files from the Sdk folder of your Gideros installation
  • FrancoisDMFrancoisDM Member, test
    Part 2 of my adventures:

    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.
  • ...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)...

    FrancoisDM are you talking about the Bit plugin https://wiki.gideros.rocks/index.php/Bit? If so it's been deprecated :/ otherwise I don't know what BitOp is :p
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hgy29hgy29 Maintainer
    @FrancoisDM, Eclipse is no longer supported to build for Android, the only way is Android Studio or gradle scripts from command line or shell.
    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.
  • FrancoisDMFrancoisDM Member, test
    @MoKaLux
    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!
  • hgy29hgy29 Maintainer
    Not sure about the 'Class not found issue', but Gideros not finding its libgvfs.so is strange, since it is part of Gideros libs itself. Could it be that your plugin rewrote Gideros lib ? In gideros plugin build script, there is a command to specifically remove gideros libs copied by ndk druing build from the final plugin files: https://github.com/gideros/gideros/blob/master/scripts/GidAndroid.mk#L58
Sign In or Register to comment.