GLBasic forum

Main forum => GLBasic - en => Topic started by: MrPlow on 2019-Nov-21

Title: ongoing implementation of Admob and various other service
Post by: MrPlow on 2019-Nov-21
Space Fractal:

Im diddent split this thread correctly, but its was me that tried to property implements admob to glbasic, so we could use java calls to show the ads. Its turned out its was impossible to call java that ways, but required to been inside the Activity. So im have chosen to remove it again and let the original MrPlow implemented stays as its was 100% legit post about it and possible way.

-------------

Thanks SF

I will try your file!!

Also updated steps above to include dependancy for build.gradle file.
Title: Re: Failed implementation of Admob
Post by: MrPlow on 2019-Nov-21
Hi SF,

That dropbox link doesn't work.

Title: Re: Failed implementation of Admob
Post by: spacefractal on 2019-Nov-21
property happens when im did updated the file a little bit. fixed.
Title: Re: Failed implementation of Admob
Post by: Ian Price on 2019-Nov-21
Cheers Mr Plow (and of course SpaceFractal) :)
Title: Re: Failed implementation of Admob
Post by: MrPlow on 2019-Dec-02
Hi SF,

Just wondering if you have been able to get the ads.show() method to run and advert within the SDL game loop process yet?

I would really like to get this working so I can use ads between levels / stages etc.


Title: Re: Failed implementation of Admob
Post by: spacefractal on 2019-Dec-05
its untested and havent tested it under my apss or something like that, just some java code here. The main issue is how the main activty works and the admon works as its should pause the main activty before shows the ads.

You do should get some logs if you have called it correct.
Title: Re: Failed implementation of Admob
Post by: spacefractal on 2020-Feb-08
Please, dont post PM about admob and such thing. Im is gonna to been quite tired of it to use the time of it. So dont PM me about this. thanks. Im will no longer reply PMS like this.

Use the forum and this thread. Nobody example reported im has uploaded a wrong file and newer mention it. Howover has uploaded a new java file, check it out in the edited post. Its still untested throught.
Title: Re: Failed implementation of Admob
Post by: MrPlow on 2020-Feb-08
Hi SF,

No worries, I wont send anymore PMs - I tried the new code file - but I will need to check that javacall is firing...

You see there is a problem in that the SDL process is not allowing admob to interrupt SDL, unless the user leaves app (switches to another app) or does playstore visit within the app...only then is the admob adverts firing.

So it's more than the just the code to manage - i need a way to signal to app that an interrupt has occured - if even that works then I can get ads to show when I need them.

:)
Title: Re: Failed implementation of Admob
Post by: spacefractal on 2020-Feb-08
nothing problem to do its here as others might have issues and how to do, not just you.

glbasic should send a pause/resume signal to close down the activity and reactivate. can you post the log (im have log anything here for checkout its has been reach or stopped). here as its would shown what its happens. This is what Log.i() do to your logcat.

This was happens automatic in the old code without im did anything, which was quite annoying. Its might even could been a androidmanifest.xml issue.

For use with testing ads, you should uses the unit ID: ca-app-pub-3940256099942544/1033173712

Im also updated the SDLActivity post again, so ads_load could been handled automatic on init and soon a ads is closed. This was in hand with the official code, so im did that.

If there is still issue with the SDL and ads actuelly does working, then its property a issue in if (tokens[0].equals("ads_show")) in SDLGlbasic.java me thinks that does not callback correctly and/or something is missing in the manifest file.
Title: Re: Failed implementation of Admob
Post by: spacefractal on 2020-Feb-09
you can try to add this to the androidmanifest.xml:

Code (glbasic) Select

        <activity
            android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:theme="@android:style/Theme.Translucent" />


thinks this was similar to the old one, and can been why the sdl activty could not been paused.....
Title: Re: Failed implementation of Admob
Post by: spacefractal on 2020-Feb-09
Im got it working with test ads as least, so im will update it once more. Its just a little bit too aggresive, because im shown it when a ads is loaded. Howover its might not works in a emulator and might fails throught, but worked on a device.

Im do also need to change how the directories is finding as some commands has been depreacted in Android_Q.
Title: Re: Failed implementation of Admob
Post by: spacefractal on 2020-Feb-09
checkout the update. this is TESTED and worked on a device, but not on emulator (network fails while loading, but the adslistener did works as intended).

Also there is not much glbasic code to been required, other than the JavaCalls to shown them and eventuelly react to the pause/resume subs. So this is why im dont have or require to add any glbasic code as admob implemention would been different from game to game.
Title: Re: Failed implementation of Admob
Post by: MrPlow on 2020-Feb-09
Thanks SF

I will use your full SDLGlbasic.java file then...just to make sure I used it correctly... :)
Title: Re: Failed implementation of Admob
Post by: spacefractal on 2020-Feb-09
im do first can implemenents this to steam when found a way to automatic filter the admob off and on as im did in glbasic 15 when the icon builder could detect it.
Title: Re: Failed implementation of Admob
Post by: spacefractal on 2020-Feb-10
There was some copy assets issues when reading from a wrong place, which is also now just fixed.
Title: Re: Failed implementation of Admob
Post by: MrPlow on 2020-Feb-10
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.



Title: Re: Failed implementation of Admob
Post by: spacefractal on 2020-Feb-10
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).
Title: Re: Failed implementation of Admob
Post by: MrPlow on 2020-Feb-10
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!
Title: Re: Failed implementation of Admob
Post by: spacefractal on 2020-Feb-10
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.

Title: Re: Failed implementation of Admob
Post by: MrPlow on 2020-Feb-10
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?


Title: Re: Failed implementation of Admob
Post by: spacefractal on 2020-Feb-10
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.
Title: Re: Failed implementation of Admob
Post by: MrPlow on 2020-Feb-10
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.





Title: Re: Failed implementation of Admob
Post by: spacefractal on 2020-Feb-10
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.
Title: Re: Failed implementation of Admob
Post by: MrPlow on 2020-Feb-10
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.

Title: Re: Failed implementation of Admob
Post by: spacefractal on 2020-Feb-10
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.....
Title: Re: Failed implementation of Admob
Post by: MrPlow on 2020-Feb-10
Does either of these posts offer any help for a possible solution??

https://www.dynadream.com/ddweb/index.php/Special_Blog?id=20 (https://www.dynadream.com/ddweb/index.php/Special_Blog?id=20)

or this

https://stackoverflow.com/questions/54031968/add-ads-admob-in-class-and-call-from-another-activity-class (https://stackoverflow.com/questions/54031968/add-ads-admob-in-class-and-call-from-another-activity-class)
Title: Re: Failed implementation of Admob
Post by: spacefractal on 2020-Feb-10
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.
Title: Re: Failed implementation of Admob
Post by: MrPlow on 2020-Feb-10
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.
Title: Re: Failed implementation of Admob
Post by: MrPlow on 2020-Feb-10
Hmmm looks promising...from a github sample admob setup

app   Fix bug in interstitial sample with incorrect Ad Unit ID.   4 months ago
Title: Re: Failed implementation of Admob
Post by: spacefractal on 2020-Feb-10
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).
Title: Re: Failed implementation of Admob
Post by: MrPlow on 2020-Feb-10
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...


Title: Re: Failed implementation of Admob
Post by: spacefractal on 2020-Feb-10
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.
Title: Re: Failed implementation of Admob
Post by: MrPlow on 2020-Feb-10
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.
Title: Re: Failed implementation of Admob
Post by: spacefractal on 2020-Feb-10
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.
Title: Re: Failed implementation of Admob
Post by: spacefractal on 2020-Feb-10
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.
Title: Re: Failed implementation of Admob
Post by: MrPlow on 2020-Feb-10
 :good:
Title: Re: Failed implementation of Admob
Post by: spacefractal on 2020-Feb-10
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.
Title: Re: Failed implementation of Admob
Post by: MrPlow on 2020-Feb-10
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.


Title: Re: Failed implementation of Admob
Post by: spacefractal on 2020-Feb-10
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
Title: Re: Failed implementation of Admob
Post by: MrPlow on 2020-Feb-10
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!!
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: spacefractal on 2020-Feb-10
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.
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: MrPlow on 2020-Feb-10
WORKED!!!  :booze: :D :D

Even when device is kept still!!! So it's perfect!
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: spacefractal on 2020-Feb-10
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.
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: spacefractal on 2020-Feb-10
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.
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: MrPlow on 2020-Feb-10
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!
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: spacefractal on 2020-Feb-10
property, yes. the ads_status could do the job here for status checkout.

The java has been updated to also include 3 other functions when a ads is called. You do NOT need keyDown for that. Those thosed from the SDLActivty.

ALso confimed its even works when you complete a level in Greedy Mouse. But should not been that "aggreseive", property when you dont get 4 stars its might show one.
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: spacefractal on 2020-Feb-11
I'm in next  version let possible to manually loads ads by a java call, also doing it asyncron like the show. So reward video should been possible.

Don't forget to update the other post. I'm won't overtake it.

And im is ready to update the Steam version as well, include Admob and the path fixes (its a under 100kb update). There is few changes, so its possible to manually loads a add etc and possible to add reward videos and such.
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: MrPlow on 2020-Feb-11
 :booze: Excellent - a lot of new users and users looking to develop for Android will be very happy about this update.
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: spacefractal on 2020-Feb-11
im do want you to update the post you did when im update the steam version (a 450kb update) when im get approvement from Gernet. Yes, im can update directly from my user accout. But want to let Gernot know first.

Also... if you try to manually a ads too early, its might fails throught, but here im do change the adsstatus to reflect that.
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: spacefractal on 2020-Feb-11
Howover Greedy Mouse wont want to run on Android 5.1 emulator throught well, buts dos run in Android 5.1, so the device is to old message stays.
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: MrPlow on 2020-Feb-12
One of my projects is acting up and not showing assets using the new SDLGLBasic asset code.

Is there a certain way it needs to be used in GLB?

I compared other projects but my brain is a little tired today...
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: spacefractal on 2020-Feb-12
can you send me the project. Its best practical way when using SETCURRENTDIR() is set to "Media" and load all assets from here.

But you should could see in the Logcat why its fails. Etc if its trying to do a "Media/Media" or something like that. Then its might fails.

etc path after /files/ must been the same. If they are not, then its will fails to load. Its been output what its have tried to do in Logcat, so make sure to check it out.
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: MrPlow on 2020-Feb-12
Thanks - I will try the logcat etc.
If no joy then will send on the project... :)

I'm sure its a simple error by me somewhere...
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: spacefractal on 2020-Feb-12
pleasde note im do NOT need the glbasic, just the Android Studio project.

Im have slightly changed the java again and has uploaded to the dropbox. Find it in your thread.

Its might have been failed if graphics was loaded from the main Media folder, because its could not reformat the path there.
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: spacefractal on 2020-Feb-12
yep as admob now works, im hav choosen to sticky the thread and removed 4 old android one (but linked to them from a another sticky one).

Tryout the new java file. this should works better. But logcat do show if CopyAsset has been failed, etc its show where its tried to copy from and where to. path should been same after /files/. If they are not, the game will fails loading its assests.
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: MrPlow on 2020-Feb-12
Getting really long looking folders

2020-02-12 14:15:39.360 10267-10442/com.GazzapperGames.retro.invaders.classicarcade I/glbasic: CreateDir() path: /data/user/0/com.GazzapperGames.retro.invaders.classicarcade/files/Media/data/user/0/com.GazzapperGames.retro.invaders.classicarcade File: files
2020-02-12 14:15:39.368 10267-10442/com.GazzapperGames.retro.invaders.classicarcade I/glbasic: in File: Media//data/user/0/com.GazzapperGames.retro.invaders.classicarcade/files/
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: spacefractal on 2020-Feb-12
Look like the game tries to load the assets using full path rather than relative path? This this could been happens by the double path and has not filtered that out.

This is something im should take a look, so you could send me the AS project, if you want. Its should been possible to do that, but its does not work when using full path throught by now.
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: MrPlow on 2020-Feb-12
Hi SF

I think its the CreateDir command but not sure.
I need to find a quick fix as the project took over 50min to compile (dont know why it is suddenly taking so long) so I dont want to "clean" and have to start again.

If I get nowhere I will give up getting my update out and will send on the cleaned project.

I lost a whole day so far so I need make back the time.


Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: spacefractal on 2020-Feb-12
just dont use GETCURRENTDIR$() when loading your assets. CreateDir() currectly got confusion about it.

50min is long time. here its often take about 3-4 for Greedy Mouse throught and im dont need to start over even when compiled from glbasic.

PS. Im accidently edited your post. sorry.
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: MrPlow on 2020-Feb-12
It's not just that - tried multiple variations to load different assets and none worked all assets with or without GETCURRENTDIR$() failed.
I compiled it about 10 times with different loading options.

Very strange I think. I must have a bad version of the SDLGlbasic.java maybe?

The older version never gave me any problems loading assets...did other users have problems, is that why it was changed?

Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: spacefractal on 2020-Feb-12
you can take a look to logcat. they should match. its diddent look like that.

Also loading in assets is strange beast in Android. The main issue is SetCurrentDir() does NOT reflect in the Java part as its would in the c++ part. That can cause various issues and fails in many way when not loading them in property.

Sut from the staring, ALLWAYS ONLY use SetCurrentDir("Media") and load  the assets from there ONLY using relative path! This is the property way to load for Android. Its like hell.

Just to been noticed Brick Breacker game did not do its currectly either, and even Greedy Mouse internally fails loading.
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: MrPlow on 2020-Feb-12
Sorry, just confused here...
Did you say SetCurrentdir or not with the new Admob files??

And is this still used or not
IF DOESDIREXIST("Media")=0 THEN CREATEDIR("Media")
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: spacefractal on 2020-Feb-12
Im will change CreateDir, so its only tries to create the folders with no other changes to it. That can help. Then folders might or might not have created.
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: MrPlow on 2020-Feb-12
All good now :)

Just used SETCURRENTDIR and new files in Admob.zip

:good:
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: spacefractal on 2020-Feb-12
im just updated it. CreateDir does now ONLY attempts to create the folders when they are not exists and does NOT modify the file at all. This could caused all those issues.

So its pretty much what its was before.

But SetCurrentDir("Media") is still the recommend way to load assets.
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: spacefractal on 2020-Feb-12
This crappy issue will take some time. Still issues and I'm need to do a way to implementing setcurrentdir correctly. Highly annoying. I'm hold back the update until sorted. I'm iis out of time today.
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: MrPlow on 2020-Feb-12
The setup before for copyassets was working away fine for me.
I had no reports of issues and about 5,000+ users installed without a problem.
If all else fails roll back to old copyasset and get users to load assets with SETCURRENTDIR & GETCURRENTDIR$()

Might be the safest option.
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: spacefractal on 2020-Feb-12
Its should works like Windows, except case letter is senative. So im will fix SETCURRENTDIR(), so c++ and Java follow each other. This require a little fix in the SetCurrentDir() command, so its call Java, so Java also know it. This is the main issue.
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: spacefractal on 2020-Feb-12
seens im have just fixed it. im gonna to bed soon, so im update again tomoorow, finally fixed SetCurrentDir() and both c++ and java follow the path.

Also a strange thing is c++ path and java path is not the same, which is why im was needed to call "setPath" java twice per SetCurrentDir() call. First one is to set "root" dir.

Hopefully that issue has been fixed.
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: SnooPI on 2020-Feb-13
Even though I'm not developing on Android at the moment, I wanted to congratulate Spacefractal for his hard work on this platform for years  :good:
I hope you can solve your problem MrPlow (especially that we may one day have the same).
Title: Re: Failed implementation of Admob - TiltSesnor to rescue
Post by: spacefractal on 2020-Feb-13
The next thing I'm should look into is Google drive or Snapshot implementation. But no hurry. Should also looks into normal admob banners as well, which should works as well.

Also as im previous said SETCURRENTDIR() has been fixed, so its should now no longer matter how the game reads the files as long you spelled the case senetive correct, that even if you used fullpath. Im have still not pushed to steam, but doing that when Gernot have a change to checkout the changes.

Until it, the fix is also on the dropbox folder (hence im added +fixes to the subject).
Title: Re: ongoing implementation of Admob and various other service
Post by: spacefractal on 2020-Feb-15
also we  do still need to find a alternative form for ads as Admob does NOT work for Android TV. Android TV can been detected by PLATFORMINFO$(). Etc its seen im removed "KEYBOARD" as its was newer make sense, but "ANDROIDTV" was.
Title: Re: ongoing implementation of Admob and various other service
Post by: spacefractal on 2020-Feb-16
Now im property gonna use this thread for various google play services.

Im is currectly looking how Google Play Games (Snapshots) works. Its a little bit strange service.

Then im also should looks into how banners as well inapp purchases works, so those can been reimplemented to AS.

The reason is its a  feature im could example use for Greedy Mouse for remove the ads as well enable extractly Snapshots service.

Also please not im will of course no longer touch the old Android SDK anymore.

Of course anything im do with Google Service is all optional. If you dont use any of this, its would been totally removed, so you dont see "this app contains ads" or "Contains inapp purcahse", if you not using those. Im is aware of that!

So here im using AndroidStudioMakeApp tool, and checking what features that is enabled in grandle.build and use the correspons Java file: One with enabled service, the other Java version where im just using empty classes. So calls to them does nothing from the main SDL java file.

PS. Im hold back update to steam until Gernot have a change to take a look as he also might have changed thing.