Hi! Since I saw this great post: I have always wanted to try the same but with banners. So I did . You can get the source here: https://bitbucket.org/master_both/love-android-sdl2
Thanks to bio1712, it now supports Interstitial ads.
For getting this to work you will need to add google-play-services_lib to your project, which I can show you how.
I added 6 functions to love.system:
Banners:
•love.system.createBanner("Banner ID", "orentation") where orentation can be "top" or "bottom".
•love.system.hideBanner() removes the banner from the screen.
•love.system.showBanner() makes the banner reappear.
Interstitials:
•love.system.createInterstitial("Interstitial ID") create the interstitial ad.
•love.system.isInterstitialLoaded() check whether there is an ad loaded and ready to be shown.
•love.system.showInterstitial() show the ad.
You can get a "Banner ID" or "Interstitial ID" on the Admob website, they look like this:
ca-app-pub-9796530573307706/1938301675.
Adding google-play-services_lib without an IDE
For adding google-play-services_lib to your project you will first need to download it from the android-sdk by going to the "Android Sdk Manager" on "extras" and checking on "Google Play Services" then you can find the library folder on android_sdk/extras/google/google_play_services/libproject/google-play-services_lib. Now you have to paste it next to the project folder and execute "android update project -p 'dir/to/google-play-services_lib' " and you're done!
Now you can have full control of admob on lua!
Here you can get the apk: Link
Here you can see all the changes to the original repository that I made here:
https://bitbucket.org/master_both/love- ... aster#diff
Thanks again to bio1712 for making this possible
If anyone finds a bug please let me know
Admob Banner and Interstitial Support
- master both
- Party member
- Posts: 262
- Joined: Tue Nov 08, 2011 12:39 am
- Location: Chile
Admob Banner and Interstitial Support
Last edited by master both on Tue Jan 05, 2016 7:43 pm, edited 2 times in total.
-
- Party member
- Posts: 730
- Joined: Sat Apr 26, 2014 7:46 pm
Re: Admob Banner Support
Hey how good are you with Android stuff? I'm trying to understand your code so I can isolate it and maybe make a plugin architecture for Android. But I am not too good with Android or Java so idk what that entails.
- master both
- Party member
- Posts: 262
- Joined: Tue Nov 08, 2011 12:39 am
- Location: Chile
Re: Admob Banner Support
um, actually I'm not that good with android, I just got most of the java code on google (thanks Stack Overflow) and completed some of the JNI stuff by looking at how functions like love.system.openURL or love.system.vibrate worked.bobbyjones wrote:Hey how good are you with Android stuff? I'm trying to understand your code so I can isolate it and maybe make a plugin architecture for Android. But I am not too good with Android or Java so idk what that entails.
Re: Admob Banner Support
i have been waiting this for long time, thanks!
Re: Admob Banner Support
sorry for noob question but how do i even open this on android studio?
i downloaded master_both-love-android-sdl2-bb0d84d0907e
thanks for the help i just dont understand any of this android stuff very well
i downloaded master_both-love-android-sdl2-bb0d84d0907e
thanks for the help i just dont understand any of this android stuff very well
-
- Party member
- Posts: 730
- Joined: Sat Apr 26, 2014 7:46 pm
Re: Admob Banner Support
Probably not the best to use Android studio. Would be easier to use cmdline to build and your preferred editor to edit the source files. To build you can follow the instructions from the android build repo's wiki along with the modifications he made.
https://bitbucket.org/MartinFelis/love- ... /wiki/Home
https://bitbucket.org/MartinFelis/love- ... /wiki/Home
Re: Admob Banner Support
This is awesome! Thank you!
- master both
- Party member
- Posts: 262
- Joined: Tue Nov 08, 2011 12:39 am
- Location: Chile
Re: Admob Banner Support
Thanks!bio1712 wrote:This is awesome! Thank you!
And thank you for letting me use your code!
Re: Admob Banner and Interstitial Support
im confused at the part where you said Now you have to paste it next to the project folder and execute "android update project -p 'dir/to/google-play-services_lib' " and you're done!
what is android update project?
sorry for noob questions
what is android update project?
sorry for noob questions
-
- Party member
- Posts: 730
- Joined: Sat Apr 26, 2014 7:46 pm
Re: Admob Banner and Interstitial Support
Android is a cmd from the Android sdk. Android update project will prep the Google play services lib for inclusion in your app. (Or so that's what it seems like)
Who is online
Users browsing this forum: No registered users and 2 guests