We needed to integrate the Chartboost SDK in a mobile game, so I created a plugin that does this and lets you use it in blueprints:
The SDK allows you to run most Chartboost functions, including the ability to show interstitial ads, rewarded video ads and their more apps page. It also includes an actor component that allows you to respond to callbacks from Chartboost.
It currently supports iOS, but I intend to add Android support soon. If anyone in the community wants to take a stab at that I’d really appreciate it.
I don’t have a firm timeline for Android support but it will likely be before the end of the year. I open-sourced this plugin half-hoping that someone else would take on that task and submit it back as a pull-request. As such, you’re welcome to give it a try.
I would love to give it a shot but i’m not really sure where to start. I know how to add all the necessary code to the GameActivity.java but i have no idea how to go about making the connection between there and the engine let alone show up in blueprints. My C++ is not the best java is where i’m comfortable. I attempted to tear your code down and rebuild it facing the java statements in the GameActivity but i was unsuccessful. If you know any resources where i can get a better grasp on how to build an android plugin i would love to dig into this some more.
I also tried AdColony Plugin in your GitHub repository but I could not install it properly.
I copied AdColony repo to a subfolder in my project (…/Plugins/). iOS build is going well, but it seems that the Adcolony server does not receive my requests.
I call the “Ad Colony Configure” function with “App” and “Zone” ids for my app on begin play event. I try to use “Ad Colony Is Virtual Currency Reward Available” and “Ad COlony Play V4VCVideo” functions. The first always returns “false”, and the second has no effect.
Perhaps my project or plugin requires some additional settings?
I was looking at your plugin and tried to add some AdMob functionality for interstitials. I have done it by tweaking the engine code but i want to try it as a plugin and later add rewarded videos from AdColony and maybe AppLovin for android.
For some reason i always get an error regarding AndroidJNI.h file or jni.h
I downloaded the chartboost plugin with android support but i get the error: fatal error: ‘Android/AndroidJNI.h’ file not found
I use a simple blueprint project, i added one empty c++ class, i created a plugins folder on my project,copied your plugin, i generated visual studio solution and build the development editor - win64 solution. If i try to package for android i get the above error.
The Android support doesn’t work. It’s very early and it doesn’t even compile property. The JNI is also being used incorrectly. We forked it and got it working.
We also made it work as a project plugin (the original was hardcoded to copy the libraries from engine folders) However, we didn’t implement all functions yet (we only use rewarded video for now). You should be able to implement the others using the ones we implemented as a base. I’ll send GetSet a pull request too.
In our fork you need to set up your app ID and app signature in the project settings > plugins > chartboost. We couldn’t get the ChartBoostStart node to work on Android because it crashed the Chartboost library, so we had to initialize it during the game boot.
Hi Makis yes I’ve encountered that error as well on my end there’s something missing from header search paths in the project settings or perhaps in the plugin code or project settings itself. I haven’t been able to track down the root issue currently but again this should be something to do with header search paths and referring to the proper location in the source structure for that header file. Internally I’ve been getting this to work by hard coding the full path to the “Android/AndroidJNI.h” header file which of course is not the correct solution but allowed me to progress with the task of getting Chartboost to work. So this is something still to be fixed.
Hi manoelneto I saw you’re pull request for the Changes to get Android work looks good thanks! There were a bunch of steps I hard coded when working on the Android version just to get to the core of displaying an interstitial in game. I haven’t had time since then that commit to clean things up but it seems you’ve done so which is great thank you. It’s not ideal but I wanted to share the investigation that I had completed since it took me several days even to get to the point of what is committed in the hopes it would help guide others. My next steps will be to review your pull request when I can set aside some time for this.
You’re welcome. Thanks you too for the groundwork, it was invaluable in learning how to create plugins with Android libraries. I didn’t know APL was a thing and still assumed modifying the engine’s GameActivity.java was necessary to add new libraries. It was thanks to your post I finally learned enough to put together a basic implementation of the Facebook online subsystem for Android with zero engine modifications all self-contained in a plugin (figuring out how to get an android library with resources to compile property was quite the challenge, however).
How do you install this to build for IOS? I tried with both github ue4 and launcher ue4, but none compiles it due to c++. Tried with the plugin in the engine but still doesnt compile a non c++ project with this plugin.