Mavhod / GodotAdmob

Module Admob for Godot engine
63 stars 88 forks source link

How to use? #2

Open Bayaola opened 8 years ago

Bayaola commented 8 years ago

I do not very well understand how to use this module to display advertising in my game. You can simply explain the steps for a beginner?

Mavhod commented 8 years ago

Since Godot change build Android from ant to gradle and removed Google play services, this module is must change something, and I must research it, sorry.

Bayaola commented 8 years ago

ok, could I have another direction for advertising in my game?

Mavhod commented 8 years ago

If you not strict, maybe you download old Godot revision from Github for use this module.

Mavhod commented 8 years ago

https://github.com/godotengine/godot/issues/3285

Above is issue from punto version, but I still not success to try it.

Bayaola commented 8 years ago

I think I'll publish my game without advertising, hoping that GodotAdmob will be updated thanks and courage to you

Mavhod commented 8 years ago

Ok after try it, I can build Godot with admob again, you can pull last repo and read README again.

Bayaola commented 8 years ago

Hi Mavhod, in the example in the main.gd file. I do not understand the origin of the "AdMob" singleton. in my game it will always happen in the same way?

Mavhod commented 8 years ago

AdMob singleton will available on Andriod and with set

[android]
modules="org/godotengine/godot/GodotAdMob"

in engine.cfg, otherwise it will be null, you can see banner on Android device only hasn't emulation on PC device.

Bayaola commented 8 years ago

OK, I understand the operation of your module, I would like to say thank you for the time that you give me, I understand the principle and I have compiled your module with the sources of godot1.1 because it is with this version that I am working, I don't know how to find or generate this file "godot/platform/android/java/build/outputs/apk/java-release-unsigned.apk" , I looked it up in the given directory but the directory does not exist. how can i get it please?

Bayaola commented 8 years ago

I followed your instructions here http://www.godotengine.org/topics/4380?r=13755 when I validate the command "scons platform = android target = release", android isn't listed in my scons. There is only x 11, Windows and server selection_003

Mavhod commented 8 years ago

If you build with Godot 1.1 you must use old version Admob module: https://github.com/Mavhod/GodotAdmob/tree/449191c5fe65e96037df53b45f7470cecf4ad985

make .apk with ant release then apk will place here: platform/android/java/bin/Godot-release-unsigned.apk

For scons command and not found android platform maybe you haven't Android SDK, NDK This guide is useful: https://github.com/godotengine/godot/wiki/compiling_android

Bayaola commented 8 years ago

it's working now, but only in portrait orientation mode.

Mavhod commented 8 years ago

What happen when landscape orientation?

Bayaola commented 8 years ago

the banner disappears

Mavhod commented 8 years ago

In a beginning it will use a few second for load ads.

Bayaola commented 8 years ago

3 minutes and still nothing

Mavhod commented 8 years ago

Usually if portrait work so landscape should work too, You can investigate error from Android check log tools (e.g. ddms from android-sdk/tools)

vjrossi commented 8 years ago

Why was the above poster using scons and not gradlew.bat? Anyway I'm having trouble compiling this in 2.0.3. I have the Android platform set up (can compile the export templates). I have followed the instructions but when I run gradlew.bat build it seems the import com.google.android.gms.ads cannot be found. Thanks in advance.

:compileDebugJava
H:\dev\godot\src\godot-2.0.3-stable\platform\android\java\src\org\godotengine\godot\GodotAdMob.java:
7: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.*;
Mavhod commented 8 years ago

I use Arch Linux and can build fine (scons + gradlew), with last Godot commit version and Android SDK, I'm not sure where is admob package keep, maybe you miss it?

guawoo commented 8 years ago

It can't work in windows. I built it with godot 2.0.3 stable. everything was fine when compiled,no error reported,but it crashed when ran in mobile phone.I have no idea how to solve this problem.

Can you upload the binary template apk, that I need not to compile by myself. easy to use ;)

Mavhod commented 8 years ago

OK I fixed it, please update my commited.

Now you not need to move file GodotAdMob.java from "admob/android/" to "platform/android/java/src/org/godotengine/godot, please revert it.