ongoing implementation of Admob and various other service

Previous topic - Next topic

MrPlow

SF, do you mean it is fixed in that version of the SDLGlbasic.java file, and is it also changed in the Steam version?

Does the asset changes fix the Android < API 23 issues or is that still the same?

Sorry, just want to clarify.



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

spacefractal

#16
No idea with libpng. It's was not the focus. I'm do force folders to been created if not present and eventuelt under Media path if not started from that and could possible fails. This is fixed. if its do fix libpng, im have no idea at all throught. Anyway its updated to the dropbox link im have posted.

Im havent updated the steam version yet as there is still some issues, but im do got Greedy Mouse started and launched, but still have some issues yet (like sound, which im guess its more in game than the sdl code throught).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Hi SF

Not yet working (ads not showing) on my Test device (API 23) also the API 27 emulator using your SDLGlbasic with new asset code is failing to load the assets...I am reverting and re-testing to check it's not the emulator causing it.

Can you provide your working AndroidManifest.xml file please...I want to make sure I replicating your version?

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

spacefractal

#18
The assest files for brick bricker howover has just been fixed. Its depend where loading media path is came from. Its easy to check where its tried from when checking logcat.

But yes, still some strange issues with the crappy Admob. Currectly MobileAds.initialize() can suddently fails with no errors.

Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Hi SF

I can fully understand that you don't like Admob and that it is a pain to work with - but they are the market leader the majority use it - so it's a neccessary evil i think...

I used the SDLGlbasic file from the breaker app link you PM'd me - the assets failed to work on API27 but do with my older SDLGLbasic.java file.

I will do more testing to try get the ads to appear during SDL process - do not know why it is not working for me - perhaps its my android 6 test device that is not allowing them?!

I really appreciate your efforts so far :)

BTW - Breaker project manifest did not have the manifest change you mentioned - but you said that worked for you too?


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

spacefractal

#20
that assest file issue with breaker app has been fixed, just not uploaded yet (its tried to load from a wrong path). but im do so much hate incomplete documention or when its fails, its newer tell why its fails.

Admob is just crappy strange so much as its can been. Im soon give up. Its can crash without reason and without telling a earth was that going wrong. Its just crash without error at all and skips the rest.

Even its has loaded a ads success, its crash on isLoaded() for some odd reason. So strange is it, and no way to debug it at all.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Anyway - I got your newer version from dropbox SDLGlbasic.zip project your posted :)

I will try that - it probably has the fixes you're talking about...

I will check the SDLactivity file to see where you put the Ads listener code too.

I noticed you have OnAdsLoaded() as your test!

OnAdsLoaded listener actually worked for me before in the past (I used it before) - and fired on app initial run - I couldn't understand back then why that worked but other ad calls would not.

It was the javacall running that I never got to work yet.





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

spacefractal

#22
the assets file was not uploaded yet (its online now, but ads_shows is commented out as its diddent work), this was just added another line to CreateDir() function:

Code (glbasic) Select

    public static File CreateDir(String path, int pathtype) {
        File FullPath = new File(dataDir.getAbsolutePath().concat(File.separator).concat(path));

        if (pathtype == 1) FullPath = new File(path);
        String pat = FullPath.getParent();
        pat = pat.replace("/files/Media/", "/files/");
        pat = pat.replace("/files/", "/files/Media/");
        pat = pat.replace("/files/Media/Media", "/files/Media");
        String fil = FullPath.getName();
        Log.i("glbasic", "CreateDir() path: " + pat + " File: " + fil);
        FullPath = new File(pat);
        boolean ok = FullPath.mkdirs();
        FullPath = new File(pat + "/" + fil);
        return FullPath;
    }


Now there is very a much a main issue:

Admob CANNOT been used from a static objects, which is used when we do Java Calls. That means we cannot calls Ads directly from Java at all and need to find a way to invoke it inside the Activity! Im diddent even have access to the object at all, which did just fails without error soon im trying do anything with it. That is embrassing.

So currectly, im have not sure idea how to do yet, so im stopping for now. Sorry about it.

Ads does working as long its in the main Activity.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Cheers SF,

No probs, I spent about a week on it in Decemeber - I couldn't get it to work ,so I know how you feel!
But I think GLB can interrupt the process and fire the Ads.

This example worked for me...and could be a possible way out...

1. Adlistener loads advert (fetches ads to show)

2. Game loop running

3. Netweb call to playstore to rate app (interrupts process similar to jump out of app)

4. Hit Back Button and your are back in App with Advert showing


Now if there was a way to invoke a netweb command without going anywhere or with an immediate return that would launch the Advert.

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

spacefractal

Its all about how Java works. Ads needs to been shown in the same Activity its have been fired from. The issue is JavaCalls calling a static object, and hence its dont have access to it.....
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

#26
Im have chossen to split the thread to two as my implemented has been failed. Currectly im have giving up using Admob as its cant been used by JavaCalls at all. Im have tried different things, but none of them did not work.

Admob REQUIRE to been inside a Activity and not outside it as a static objects does and we can not even pass the Activity as its will just crash it instead.

So there is no way to implements Admob correctly.

So my best guess is trying to open a Webpage that shows the ads inside the app instead.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

No worries - that does sound like a possible fix. But not in any rush.

I will try ask Google developer forum experts if there is a method around it that they can suggest.

I will update with anything i find out.
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

MrPlow

Hmmm looks promising...from a github sample admob setup

app   Fix bug in interstitial sample with incorrect Ad Unit ID.   4 months ago
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

#29
here is where im came to when im got totally stuck (two files):
https://www.dropbox.com/s/jak6penplsrr9wy/Admob.zip?dl=0

You might need to ask experts on the Google forum to sovle this issue as im have no idea how to get the static calls works with AdMob at all.

Also launch ads as well ads DOES shown as when when launch from OnResume(). Just Tried that. Those test ads works pretty fine. So that why im let your original posts stays as its does works. That that does NOT work is calls from a Static object. Here im have no idea and cant fix that my self as im have no idea how to do this time. its does not output any errors or something like that, so impossible to debug and fix. Its just does not do nothing at all and crash the function and return it.

Also Your brick breaker game should also loads its assets in the above file again. If not, then its a issue in public static File CreateDir(String path, int pathtype).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/