[Android] Admob and Google Play Game Services Support

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Мэтю
Prole
Posts: 32
Joined: Mon Jan 06, 2014 1:24 pm
Location: Espírito Santo, Brazil
Contact:

Re: [Android] Admob and Google Play Game Services Support

Post by Мэтю »

yetneverdone wrote: Mon Jul 24, 2017 9:53 am
Мэтю wrote: Fri Jul 21, 2017 6:34 pm Hello there. I managed to pack my apk and install it on my cellphone. But I don't know why, my banner won't appears anywhere. Does it generate a log file somewhere so I can see what's going on?
Make sure you use the proper ad unit id.
Also, in my experience, it doesnt quickly appear
Sure thing. I managed to settle things down btw. I made a mistake about my id and the ad block id, lul. Also managed to see that "log" I was talking about, using adb logcat. Nothing a nice search could'nt do. Thanks anyway c:
World needs love.
dartrix
Prole
Posts: 2
Joined: Tue Jul 25, 2017 7:06 pm

Re: [Android] Admob and Google Play Game Services Support

Post by dartrix »

Hi, im trying to use this but ad just doesnt show up, heres the adb logcat

Code: Select all

D/GameActivity(23114): Calling CreateBanner
D/GameActivity(23114): Calling showBanner
D/GameActivity(23114): Banner Created. ID: ca-app-pub-6342794025381749/5328371971
D/GameActivity(23114): Banner Showing
It says "Banner Showing" but is not.
my code is like this

Code: Select all

if love.system.getOS() == "Android" then
	love.system.createBanner("ca-app-pub-6342794025381749/5328371971", "bottom", "BANNER")
	love.system.showBanner()
end
EDIT:Solved, i just needed to add to androidmanifest.xml

Code: Select all

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> 
and

Code: Select all

<!-- This meta-data tag is required for google play game services. -->
      <meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/app_id"/>
      <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
      <!--Include the AdActivity configChanges and theme. -->
      <activity android:name="com.google.android.gms.ads.AdActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
        android:theme="@android:style/Theme.Translucent"/>
in the \app\src\main :ultrahappy:

EDIT2: ads only shows with 2g/3g/lte, but not with wifi

EDIT3: i added this and it started working ¯\_(ツ)_/¯

Code: Select all

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
greboide
Prole
Posts: 5
Joined: Mon Jul 31, 2017 6:40 am

Re: [Android] Admob and Google Play Game Services Support

Post by greboide »

Hi, how can i package my game with it? Ive tried adding a game.love on assets/ dir on project root but it didnt work, any idea someone?
User avatar
master both
Party member
Posts: 262
Joined: Tue Nov 08, 2011 12:39 am
Location: Chile

Re: [Android] Admob and Google Play Game Services Support

Post by master both »

greboide wrote: Fri Aug 11, 2017 10:30 am Hi, how can i package my game with it? Ive tried adding a game.love on assets/ dir on project root but it didnt work, any idea someone?
That's odd, it should have worked, are you sure the folder is called "assets" and that the .love is called "game"? I don't think I can help you more than that. If it's still not working, it must be a problem from the repository and there's not much I can do to help you with that.

On a side note, I encorage people to start using the new AdMob repo by bio1712 since it's more up to date with the changes to the official LÖVE's android repository and has reward videos supported. Mine is way behind schedule and has some problems that has been fixed in the offical LÖVE's repo.
greboide
Prole
Posts: 5
Joined: Mon Jul 31, 2017 6:40 am

Re: [Android] Admob and Google Play Game Services Support

Post by greboide »

nice, i was able to run it by placing it on app/src/main/assets folder that i created, thank you!
uederson
Prole
Posts: 30
Joined: Mon May 23, 2016 7:59 pm
Location: Brazil
Contact:

Re: [Android] Admob and Google Play Game Services Support

Post by uederson »

wison27 wrote: Fri Jun 23, 2017 12:55 am
uederson wrote: Wed Jun 21, 2017 7:42 pm Hi!
How are you guys?
This is really great! Thank you so much for share this with us!
I tried my lua code and worked fine using your love version, but sadly, when I build my own app, it is giving me an error when I try to run the app on Android.
Pls check attached picture.
Can someone pls point me what is wrong? :)
See this: https://love2d.org/wiki/Game_Distribution#Android .
[EDIT]
How you is brazilian i'm go write portuguese.
Se estiver tentando construir pelo projeto do npinochet, o fork do love-android, tente:
1) Atualmente só o NDK r14 ou - funciona.
2) Configurar as variáveis ANDROID_NDK, ANDROID_SDK, and ANDROID_HOME com os caminhos do NDK, SDK e SDK respectivamente.
3) Só funciona com sdk tools antigos que ainda suportem ant (25.2-)
4) O diretório assets que conterá o game.love deve ficar no diretório raiz do projeto que é aonde o AndroidManifest.xml fica.
5) ndk-build -j4 para compilar a primeira vez os pacotes c/c++ (é o que falta no seu aparentemete)
6) Depois é só 'ant release' para o apk (é gerado em bin).
[ENGLISH]
If you are trying to build by npinochet project, try:
1) Currently only the NDK r14 or - works.
2) Configure the variables ANDROID_NDK, ANDROID_SDK, and ANDROID_HOME with the NDK, SDK and SDK paths respectively.
3) Only works with older sdk tools that still support ant (25.2-)
4) The assets directory that will contain the game.love should be the root directory of the project that where contains the AndroidManifest.xml.
5) Do 'ndk-build -j4' to compile the first time packages c / c ++ (this is what is missing apparently)
6) Then it is only do 'ant release' for generate apk (it will stay in bin).
Thank you so much, friend!
I will check it as soon as possible!

Cheers
Post Reply

Who is online

Users browsing this forum: No registered users and 47 guests