Using Chartboost in Cocos Sharp game (Android)

Hey there!

I need to use Chartboost lib in my project and i really need to fast decision. As i can see there is no official sdk for xamarin, so maybe anybody already have working binding project for Android? Can you share it if you have? Thank you!

Posts

  • PeterKrusagerPeterKrusager DKMember ✭✭

    Hey Mat
    It is really easy to create the Bindings Library for Chartboost.

    • First you donwload the newest Chartboost SDK. It can be done here.
    • Then you create a new Bindings Library (Android) project. Maybe you call it "ChartboostClassLibrary". You can use both Visual Studio and Xamarin Studio for this.
    • Now you just have to add the chartboost.jar file (you just downloaded) to the Jars folder in your Bindings project and set the Build Action of the jar file to EmbeddedJar.
    • Build the project and it should ouput a ChartboostClassLibrary.dll file. (If that is what you called your project.)
    • Your CocosSharp Android project can now import the newly created .dll as a reference.
    • You also need to add the chartboost.jar file to your CocosSharp project and set the Build Action to AndroidJavaLibrary.

    You should now be ready to implement Chartboost in your project. You can roughly follow this. It is Java but it almost looks the same. :) Remember to edit your manifest accordingly.
    Getting Chartboost interstitials and videos to run on top of your CocosSharp view happens automagically if you initialize them both within the same activity.

  • Mat.1681Mat.1681 USMember
    edited January 2016

    Hey Petter!

    Thank you for your reply! Looks like you are already using Chartboost and you don't have any issues at all.

    I followed your guide and integrated Chartboost.dll in my game, then I followed official guide and did everything it said.

    But when I'm trying to show videos or interstitials I'm getting Java.NullPointerException somewhere deep in a chartboost.dll. Please, can you tell me what am I doing wrong and how can I fix this issue?

    Here is how my integration looks like:

    manifest, initialization, usage and error.

    In bindings project i have 37 warnings, but have not errors. Also, version of Chartboost is 6.2

    I really need your help!

  • PeterKrusagerPeterKrusager DKMember ✭✭

    I am not quite sure, but I think the activity tag in your manifest needs to be inside your application tag.

  • Mat.1681Mat.1681 USMember

    Hey Petter!

    Shame on me:)
    You're absolutely right ! Thank you!

Sign In or Register to comment.