ongoing implementation of Admob and various other service

Previous topic - Next topic

MrPlow

I posted on the forum and made a little breakthrough...

from the public static KeyDown function .... I added an Ad show() and its firing when back button is pressed!!  :good:

Code (glbasic) Select
        if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == MotionEvent.ACTION_UP && SDLGlbasic.secondbutton == false) {
            Log.i("glbasic", "back button pressed");
            onGlbasicKeyDown(1, 1);
            if (mInterstitialAd.isLoaded()) {
                mInterstitialAd.show();
            }
            return -1;
        }


So is this static function like the javacall static function or is it different somehow?...can the javacall affect a variable that we can monitor and fire the Ad on the basis of maybe?

Anyhow, just wanted to let u know - i added a bit at the top back on the bug the admob github has

Code (glbasic) Select
public class SDLGlbasic extends SDLActivity {
    private static final String AD_UNIT_ID = "ca-app-pub-3940256099942544/1033173712";


Not sure if this makes a difference or not.

Anyhow, a little progress...


Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

#31
its does not matter where you set the adsID as im just choosen to been doing that in strings.xml to do all configuration there for the app.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Yes - that's what I mean - it could be possible to fire on a variable value condition maybe but now we know it can launch in the gameloop process.
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

#33
hi yes, you can use a java call to call which game status that is in.

im could implement a such of simple java call to store a variable, etc to turn on and off the ads.

etc using two kind java calls:

"ads_off" and "ads_on"

Then ads can been called on other ways from extractly javacall, but instead KeyDown and/or OnResume, if the function is enabled.

Also im should take a look into the other forms for ads, like banners. They might works better than fullscreen ads.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

spacefractal

#34
Actuelly, suddenly, there is a possible solve to it calling it indrectly. Im will test it soon. actuelly im will use the TiltSensor function, etc using whem tilt is invoked from the SDLActivity. Im let you know.

Its a idea to try out. A bit strange way to do, but hoppefully works.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

#36
hopy crap.... Its actuelly WORKS!!!! A very strange way to sovle it by using the tiltsensor..... The second ads got displayed as im wanted it.

All its does is the JavaCall just set a True variable, but when tilt is called, then its invoke it from here. Its onle few ms delay or such.... and yes: you cant hold your phone still when you playing a game anyway.

Yes its still called from a static function, but the static called is called from SDLActivity throught, so its can still find the activity.

So its pretty much  fixed and will soon start a new thread, or put it back again, im thinks its better to integrete to your thread really as first post is allways th best.

Im upload it soon for you to tryout. Im using two java calls "ads_status" and "ads_show". Also bear in mind there can been many reasons a ads might not shown, hence ads_status tell it throught.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

#37
Yeaaahh! Good WORK!

:D

And I can control the rate of ad displays using my Ad-Frequency-Capping settings in Admob :)

Does the app require the tilt permission? Or it is a standard permission now.


Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

#38
its load a new ads soon the other one has been closed or opened.

So all you need is those two calls. other is just if you want the cycle status of the ads if you want it. Its not possible from ads_show alone as its asyncron and just set a variable to been picked up by a another function.

Im will let you update your post if you can get this to work. Files is updated.

https://www.dropbox.com/s/buetjvl4o4by1v1/Admob.zip?dl=0
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Cool!
Can't wait to try it - it's late and I might have to try it out fully tomorrow morning...You got it working in the end!

Also, I was just thinking if checking for Tilt and Keycodes work - what about a standard screen Touch() action :)

That might be even better and more ideal for the app so that suprise Adshows are eliminated :)

Either way, this is fab!!
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

tilt is pretty much called constactly, and even when you playing with gameplay, tilt is still active. of course its should been possible to called it from other functions as samme manner when the variable has been set. No problemo here.

This is a lesser issue. Tilt was the most possible way for most uses.

Just place this where you want it and its inside a activty, that is include static functions that is called from SDLActivity (there is a comply of them):

Code (glbasic) Select

        if ( SDLGlbasic.AdsShown==true) {
            SDLGlbasic.AdsShown = false;
            SDLGlbasic.InterstitialAds.show();
        }


Im do should have added a function to that.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

WORKED!!!  :booze: :D :D

Even when device is kept still!!! So it's perfect!
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

yes tilt is quite sensative, but as im edited, we can with no issue put the call function other places as long its inside Activity.

You can update your other thread as its now confirmed its works.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

spacefractal

#43
im should adds it to the reportkeycode, MouseEvent and JoyHat as those is heavy used by various devices and all is called from SDL. those those 3 functions should also works as well the tilt one.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Theoretically,  could also possibly work with Rewarded Video Ads in the same way - return a variable to the javacall() to show that a video was watched and process accordingly...

Anyhow - this has made my year so far!! Thanks for all the work SF!
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs