[11.3] AdMob support for Android + EU Consent

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
bio1712
Citizen
Posts: 72
Joined: Wed Aug 19, 2015 4:13 pm
Location: Italy

Re: [11.2] AdMob support for Android + EU Consent

Post by bio1712 »

AuahDark wrote: Tue Jul 09, 2019 8:49 am There's also https://github.com/love2d/love-android/tree/0.11.x if you prefer GitHub. Also that's the most up-to-date repository.

You can try to create new git repository of your current fork then merge to it. Make sure to resolve any merge conflicts (in your case there would be much).
I can't even use Github :oops:
Do you think it's a laborious process? I think I'll wait for the next release.
User avatar
pgimeno
Party member
Posts: 3672
Joined: Sun Oct 18, 2015 2:58 pm

Re: [11.2] AdMob support for Android + EU Consent

Post by pgimeno »

bio1712 wrote: Tue Jul 09, 2019 8:07 am Since I'm totally new to Bitbucket and Git, is there any way to update only the interested files, without starting over?
I think you want to do a rebase. Rebasing a branch on top of another consists of taking that branch's commits and applying them on top of the second branch, so that the final branch includes the code that was specific of that branch, but applied to the newer one. There's lots of documentation online on how to do it. In formatted ASCII:

Code: Select all

What you had

                LÖVE version at the time you created the patch (master)
                |
... A - B - C - D
                 \
                  X - Y - Z
                          |
                          your branch with all of your changes (let's call id loveads)

Now LÖVE evolves:

                LÖVE version at the time you created the patch
                |
... A - B - C - D - E - F - G - H
                 \              |
                  X - Y - Z     latest LÖVE version (master)
                          |
                          your branch with all of your changes (let's call id loveads)
The difference between D and your version lies in commits X, Y and Z, which you created. Therefore, if you can apply X, Y and Z on top of H, you will have an updated version of your library. That's what rebase does. After rebasing loveads on top of master, you will have this:

Code: Select all

                                master
                                |
... A - B - C - D - E - F - G - H
                                 \
                                  X'- Y'- Z'
                                          |
                                          new loveads rebased on top of master
where X', Y' and Z' are new commits with the same changes as X, Y and Z (possibly modified to resolve conflicts, if any arise), which I believe is what you want. Now I'm not sure if you can do that in Mercurial without losing the version previous to the rebase. In git you certainly can, because in git, X, Y and Z are not immediately deleted, they just become unreferenced, but you can easily keep them ready to be accessed just by creating a branch in the same place as loveads right before rebasing.

So for example, if you were in a git repository of LÖVE, you can run these commands:

Code: Select all

# Switch to your branch

git checkout loveads

# Create a new branch that we won't move or switch to, just to be able to return to it

git branch loveads-11.2

# We're still in loveads ('git branch' doesn't switch to the new branch).
# Rebase it on top of master.

git rebase master

# Here, conflicts may arise, if there are commits between 11.2 and current master
# that modify code that you have also modified. If that doesn't happen, you're done.
# Otherwise, you need to resolve the conflicts (integrate the upstream changes with
# your own changes into a coherent version). Modify each conflicting file and then
# use 'git add <the-file>'; finally do 'git rebase --continue'.
Note however, that LÖVE in Bitbucket is in Mercurial form, not in Git form. Mercurial has a few advantages and a lot of inconveniences over git, for doing repository manipulation of this kind. In particular, with Git you don't lose your previous commits when you rebase, but I believe you do with Mercurial. Besides, in Mercurial you need to activate an extension if you want to rebase, it doesn't come active by default.

I advise you to learn git. It's hard but it pays off.
bio1712
Citizen
Posts: 72
Joined: Wed Aug 19, 2015 4:13 pm
Location: Italy

Re: [11.2] AdMob support for Android + EU Consent

Post by bio1712 »

pgimeno wrote: Tue Jul 09, 2019 1:34 pm I think you want to do a rebase. Rebasing a branch on top of another consists of taking that branch's commits and applying them on top of the second branch, so that the final branch includes the code that was specific of that branch, but applied to the newer one. There's lots of documentation online on how to do it. In formatted ASCII:

Code: Select all

What you had

                LÖVE version at the time you created the patch (master)
                |
... A - B - C - D
                 \
                  X - Y - Z
                          |
                          your branch with all of your changes (let's call id loveads)

Now LÖVE evolves:

                LÖVE version at the time you created the patch
                |
... A - B - C - D - E - F - G - H
                 \              |
                  X - Y - Z     latest LÖVE version (master)
                          |
                          your branch with all of your changes (let's call id loveads)
The difference between D and your version lies in commits X, Y and Z, which you created. Therefore, if you can apply X, Y and Z on top of H, you will have an updated version of your library. That's what rebase does. After rebasing loveads on top of master, you will have this:

Code: Select all

                                master
                                |
... A - B - C - D - E - F - G - H
                                 \
                                  X'- Y'- Z'
                                          |
                                          new loveads rebased on top of master
where X', Y' and Z' are new commits with the same changes as X, Y and Z (possibly modified to resolve conflicts, if any arise), which I believe is what you want. Now I'm not sure if you can do that in Mercurial without losing the version previous to the rebase. In git you certainly can, because in git, X, Y and Z are not immediately deleted, they just become unreferenced, but you can easily keep them ready to be accessed just by creating a branch in the same place as loveads right before rebasing.

So for example, if you were in a git repository of LÖVE, you can run these commands:

Code: Select all

# Switch to your branch

git checkout loveads

# Create a new branch that we won't move or switch to, just to be able to return to it

git branch loveads-11.2

# We're still in loveads ('git branch' doesn't switch to the new branch).
# Rebase it on top of master.

git rebase master

# Here, conflicts may arise, if there are commits between 11.2 and current master
# that modify code that you have also modified. If that doesn't happen, you're done.
# Otherwise, you need to resolve the conflicts (integrate the upstream changes with
# your own changes into a coherent version). Modify each conflicting file and then
# use 'git add <the-file>'; finally do 'git rebase --continue'.
Note however, that LÖVE in Bitbucket is in Mercurial form, not in Git form. Mercurial has a few advantages and a lot of inconveniences over git, for doing repository manipulation of this kind. In particular, with Git you don't lose your previous commits when you rebase, but I believe you do with Mercurial. Besides, in Mercurial you need to activate an extension if you want to rebase, it doesn't come active by default.

I advise you to learn git. It's hard but it pays off.
Thank you, your explanation was clear.
I will definitely try to learn git, it is certainly a useful tool.
Donut-Dezz
Prole
Posts: 25
Joined: Sat Aug 03, 2019 11:56 am

Re: [11.2] AdMob support for Android + EU Consent

Post by Donut-Dezz »

Can you drop a banner ad snippet code for us. who have problems getting ads in there games. in love2d
bio1712
Citizen
Posts: 72
Joined: Wed Aug 19, 2015 4:13 pm
Location: Italy

Re: [11.2] AdMob support for Android + EU Consent

Post by bio1712 »

Donut-Dezz wrote: Sat Aug 03, 2019 12:31 pm Can you drop a banner ad snippet code for us. who have problems getting ads in there games. in love2d

You can download this game.love.
Donut-Dezz
Prole
Posts: 25
Joined: Sat Aug 03, 2019 11:56 am

Re: [11.2] AdMob support for Android + EU Consent

Post by Donut-Dezz »

Can you do a tutorial on how to put admob banner ads in love2d games. bro for others
bio1712
Citizen
Posts: 72
Joined: Wed Aug 19, 2015 4:13 pm
Location: Italy

Re: [11.2] AdMob support for Android + EU Consent

Post by bio1712 »

Donut-Dezz wrote: Mon Aug 26, 2019 2:18 pm Can you do a tutorial on how to put admob banner ads in love2d games. bro for others

I think that my first post and the example game.love are a good starting point.
Donut-Dezz
Prole
Posts: 25
Joined: Sat Aug 03, 2019 11:56 am

Re: [11.2] AdMob support for Android + EU Consent

Post by Donut-Dezz »

bio where do you put the. love.ads.createBanner() code. in the love.draw() or the love.update() or the love.load() which function. you put it in
User avatar
yetneverdone
Party member
Posts: 448
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: [11.2] AdMob support for Android + EU Consent

Post by yetneverdone »

Donut-Dezz wrote: Fri Sep 06, 2019 8:18 pm bio where do you put the. love.ads.createBanner() code. in the love.draw() or the love.update() or the love.load() which function. you put it in
In load.
bio1712
Citizen
Posts: 72
Joined: Wed Aug 19, 2015 4:13 pm
Location: Italy

Re: [11.2] AdMob support for Android + EU Consent

Post by bio1712 »

Donut-Dezz wrote: Fri Sep 06, 2019 8:18 pm bio where do you put the. love.ads.createBanner() code. in the love.draw() or the love.update() or the love.load() which function. you put it in
I agree with yetneverdone. Since you have to call createBanner() only once, you may put it in your love.load().
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests