Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Need help on integrating ad interface — Gideros Forum

Need help on integrating ad interface

DoradoLabDoradoLab Member
edited June 2014 in Step by step tutorials
Hi Gideros,

I have messaged many people about how to integrate ad interface to android. But i did not get reply from any. It is really needed for me very urgent. I am not at all getting how to do that. Please can you send a example project with Gideros simple project and Eclipse Project full set up with ad interface. So that i can refer that and can do my project setup. Because i downloaded the Ads plugin but the steps they mentioned i am not able to understand. Please anyone do this help for me.

Thanks,

Dorado Lab

Likes: DoradoLab

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

Comments

  • There is ads interface in Gideros Labs but now it is only open to paid users, i have no idea what will happen to labs when MIT license will be approved though.
    Other choice is via plugin interface which is open to everyone. But of course coding is needed.
    Here is Admob plugin for example :
    http://appcodingeasy.com/Gideros-Mobile/AdMob-plugin-for-Android

    And here is the ads interface:
    http://docs.giderosmobile.com/interface/ads
  • I know there is all that but i don't know how to use that properly... So i need help on through out process.(Spoon feed) i am really new to these. And also i am a paid user.

    Please do help me with a example project.

    Thanks,

    Dorado Lab
  • lua code i didn't understand. Means i have my gideros project set. What files i need to add into Gideros Studio (lua files). And What code i should write to execute with out errors. Please tell me each step . It is really important .

    Thanks,

    Dorado Lab
  • I have tried but now its giving the following error in eclipse... Please help me on this..

    Error code :

    07-01 03:26:19.744: E/AndroidRuntime(16386): FATAL EXCEPTION: main
    07-01 03:26:19.744: E/AndroidRuntime(16386): java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_link_image(linker.cpp:1652): could not load library "liblua.so" needed by "libads.so"; caused by load_library(linker.cpp:759): library "liblua.so" not found


    Thanks,

    Dorado Lab
  • ar2rsawseenar2rsawseen Maintainer
    edited July 2014 Accepted Answer
    First let me describe to you the whole scenario of what needs to be done, and then you can say on which step did you stuck so we can elaborate further.

    1) Take your app and do a full export to Android project

    2) Assuming you have Android SDK and Eclipse installed (if not https://developer.android.com/sdk/installing/index.html), import your app into Eclipse

    3) Install AdsInterface plugin, as you wanted admob, it would involve:

    a) Copying files for admob from downloaded plugin folder

    i)/libs/armeabi/libads.so
    ii)/libs/armeabi-v7a/libads.so
    iii)/libs/x86/libads.so
    iiii)/libs/x86/libads.so
    iiiii) /src/com/giderosmobile/android/plugins/ads/Ads.java
    iiiiii) /src/com/giderosmobile/android/plugins/ads/AdsInterface.java
    iiiiiii) /src/com/giderosmobile/android/plugins/ads/AdsManager.java
    iiiiiiii) /src/com/giderosmobile/android/plugins/ads/AdsState.java
    iiiiiiiii) /src/com/giderosmobile/android/plugins/ads/AdsStateChangeListener.java
    iiiiiiiiii) /src/com/giderosmobile/android/plugins/ads/frameworks/AdsAdmob.java

    b) Opening your main activity (.java file in your src/com/giderosmobile/android directory of exported project) and adding

    i) System.loadLibrary("ads"); under System.loadLibrary("gideros");
    ii)"com.giderosmobile.android.plugins.ads.Ads" under "com.giderosmobile.android.plugins.googlebilling.GGoogleBilling",

    c) Modifying AndroidManifest.xml

    i) adding
    ii) adding this chunk to application tag:
    <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"; />
    <activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />

    d) Adding reference to Google Play service

    i) downloading Google Play Service or taking the one provided with the plugin
    ii) putting it in the same directory where exported project directory is
    iii) importing it in eclipse
    iiii) referencing Google Play Services from your exported project (http://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject)

    4) Making your project a Gideros play, by removing assets folder inside assets folder

    5) Running your project on device

    a) Enabling developer options on your device (is OS specific, but usually can be found somewhere in the settings)

    b) connecting your device to PC

    c) selecting run as Android in eclipse

    d) choosing your device when asked

    6) Integrating ads in your Gideros project in lua

    a) requiring plugin:
    require "ads"
    b) creating instance:
    admob = Ads.new("admob")
    c) setting key
    admob:setKey("your publisher key")
    d) displaying ad
    admob:showAd("auto")
    --or any other value from Methods (<a href="http://docs.giderosmobile.com/interface/ads" rel="nofollow">http://docs.giderosmobile.com/interface/ads</a>) Admob row showAd column
    e) when not needed, hiding ad
    admob:hideAd("auto")
    7) Running your project on your device through Gideros player that you created yourself in step 4)

    So I went as thorough as I could :)
    At which point do you have a problem?

    Likes: DoradoLab

    +1 -1 (+1 / -0 )Share on Facebook
  • Superb... I will try according to this... Thanks a lot.... Later with this i will get sure a final success result. Then i will reply you back.

    Thanks,

    Dorado Lab
  • Hi Buddy ,

    i am trying on this will do all one by one and let u know the status...

    Thanks

    Dorado Lab
  • Hey i think i am alomost there... Because i tried with Inmobi... It worked perfectly but after launching gideros player from eclipse in device. I run the gideros project from gideros studio adding following lines of code into lua...

    require "Ads"
    local inmobi = Ads.new("inmobi")
    inmobi:setKey("014d25c7fa4243179eb620cd501d7c07")
    inmobi:enableTesting()
    inmobi:showAd("auto")
    inmobi:setAlignment("center", "bottom")


    But in the device nothing is changing because its showing compilation error as follow.

    Uploading finished.
    inmobi.lua:1: attempt to index global 'Ads' (a nil value)
    stack traceback:
    inmobi.lua:1: in main chunk


    So simple error i think please tell me where i am wrong. So it will be soon cleared...

    Thanks

    Dorado Lab

  • 6) Integrating ads in your Gideros project in lua

    a) requiring plugin:
    require "ads"
    b) creating instance:
    admob = Ads.new("admob")
    I think you should look at this, you are using
    require "Ads"
    where as @ar2rsawseen suggested you use
    require "ads"
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • Hi,

    I have tried that too but same error. May be something wrong in start up. That Gid project set up. Can anyone have a look at my attached project.

    Thanks,

    Dorado Lab
    zip
    zip
    TestInmobi.zip
    7K

    Likes: DoradoLab

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


    [tkhnoman 12:23PM
    I never tested inmobi, it is not supported in my country.
    Probably the best thing to test is admob.
    The code looks okay for me.

    You don't need to export to run on player.. Just run it by setting the IP on Gideros Studio.

    * Sometime setAlignment need to be called at AD_RECEIVED or AD_DISPLAYED event. ]


    Thanks buddy that was the exact answer.. Which i liked. Hi five.... Thanks a lot. It worked.

    Also thanks for ar2rsawseen...


    Moving forward soon launching my first gideros game.

    Thanks

    Dorado Lab
Sign In or Register to comment.