CodeWalrus

General => General Help & Troubleshooting => Topic started by: gameblabla on November 06, 2016, 07:11:58 PM

Title: Abmob on Android
Post by: gameblabla on November 06, 2016, 07:11:58 PM
Has anyone here got Admob to work on Android ?
Well, since they released the new version in 2014, i didn't.
Does anyone uses Abmob here ?

My game is an SDL2 app and it has its own Activity, SDLActivity.Java.
Here's my Admob code :
...
        if(Build.VERSION.SDK_INT >= 12) {
            mJoystickHandler = new SDLJoystickHandler_API12();
        }
        else {
            mJoystickHandler = new SDLJoystickHandler();
        }

        mLayout = new AbsoluteLayout(this);
        mLayout.addView(mSurface);

// Create a banner ad. The ad size and ad unit ID must be set before calling loadAd.
mAdView = new AdView(this);
mAdView.setAdSize(AdSize.BANNER);
mAdView.setAdUnitId("adunitid");

// Create an ad request.
AdRequest.Builder adRequestBuilder = new AdRequest.Builder();

// Optionally populate the ad request builder.
adRequestBuilder.addTestDevice(AdRequest.DEVICE_ID_EMULATOR);

// Add the AdView to the view hierarchy.
mLayout.addView(mAdView);

// Start loading the ad.
mAdView.loadAd(adRequestBuilder.build());

setContentView(mLayout);


I also added the following in their respective places :
..
public class SDLActivity extends Activity {
    private static final String TAG = "SDL";
    private AdView mAdView;

import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.MobileAds;
import com.google.android.gms.ads.*;


Sadly, the ad in question does not appear.
(not even an error saying it is misconfigured or anything)

How do you put ads on Android ?
Does anyone here even do it ?
Title: Re: Abmob on Android
Post by: Dream of Omnimaga on November 06, 2016, 09:25:09 PM
I haven't seen anyone here using ads in their Android programs, but I did use some from elsewhere that did before. I can't help, though, since I never heard of Ambob until I read this topic.
Title: Re: Abmob on Android
Post by: gameblabla on November 07, 2016, 03:09:02 AM
Thanks DJ, it really sucks tho.
Last month, i stopped earning money from Rubby Bird (about 100€ each month)... and i have no way to bring back those ads !
Does anyone know a place where i can ask for support ?
Stackoverflow won't do it unfortunely...

EDIT: I have published my build system to the Android port (as well as the source code) :
it's here :
https://github.com/gameblabla/rubbybird100/tree/master/Android_version (https://github.com/gameblabla/rubbybird100/tree/master/Android_version)
I do not have much to lose at this point so...

EDIT2: It seems that Ads do not work on my devices... lol
In fact, some of them even crashes unlike my games.
I need to investigate but so far, this isn't good.

EDIT3: i modified it a bit on my devices and now i can see those errors.
Still no test or real ads tho..
Since i don't get ads from all apps on my devices as well,
i just assume it should work just fine on all the other devices so i tried it with Rubby Bird
and pushed an update.

I will let you know if that works.
Title: Re: Abmob on Android
Post by: Dream of Omnimaga on November 08, 2016, 12:27:50 AM
How were you earning money? From ads? Or did people just stop buying your games or something? I forgot if they were all free or not. It's nice you managed to earn this much, though.
Title: Re: Abmob on Android
Post by: gameblabla on November 08, 2016, 02:13:55 AM
Quote from: DJ Omnimaga on November 08, 2016, 12:27:50 AM
How were you earning money? From ads? Or did people just stop buying your games or something? I forgot if they were all free or not. It's nice you managed to earn this much, though.
Well when Rubby Bird was at its peak, i could earn up to 5$ a day from ads alone. But most of the time, it was 2$ a day.
But my app got flagged by Google because it suffered from the libpng vulnerability and people started to uninstall the game en-masse.
Seriously, it went from 16,000 active installs last month to 5000 active installs, it dropped really fast.
And since the old Admob used by Rubby Bird was discontinued, i no longer earn money from it now.

I just pushed an update that fixes the vulnerability (and the ads) but Google blocked the update, saying it is vulnerable,
even tho i had clearly deleted the libpng shared library.
So now i appealed to Google and we'll see how it goes...

Title: Re: Abmob on Android
Post by: gameblabla on November 30, 2016, 04:55:14 PM
Well good news guys, the ads on Rubby Bird are now back to giving me revenue again !
The solution ? Well, it was my code after all, put this after setContentView(mLayout) :
AdView adView = new AdView(this);
adView.setAdUnitId(myid);
adView.setAdSize(AdSize.BANNER);
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.build();
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.ALIGN_PARENT_TOP);
params.addRule(RelativeLayout.CENTER_HORIZONTAL);
adView.loadAd(adRequest);
adView.setBackgroundColor(Color.TRANSPARENT);
mLayout.addView(adView, params);


Now the ads properly shows up and users can click on it.
Another i had to do tho was to reprogram the game from scratch and switch from BennuGD to C and use Gradle instead of the now-unsupported Ant.
Title: Re: Abmob on Android
Post by: p2 on November 30, 2016, 05:05:30 PM
nice. glad to hear you could fix it :) how much do you expect to make per month (now after its fixed)? :)
Title: Re: Abmob on Android
Post by: gameblabla on November 30, 2016, 05:36:51 PM
Quote from: p2 on November 30, 2016, 05:05:30 PM
nice. glad to hear you could fix it :) how much do you expect to make per month (now after its fixed)? :)
At Rubby bird's peak, i used to earn 100$ a month.
Recovery is going to be a little slow so i estimate i will probably earn 12$ a month.
Title: Re: Abmob on Android
Post by: Dream of Omnimaga on March 07, 2017, 03:53:35 AM
I'm very late @gameblabla but you should feel glad that you earned $100 a month or might earn $12, because the max I made from music in my peak years was around $60 in a month and I sometimes make less than that in an entire year (although now it kinda went up again). And of course, it's actually less than $60 for sure because it costed me about $105 a year to keep three of my albums on iTunes/Spotify/etc before I pulled them out.

I also wonder if EasyRPG can be bundled with games that are ported to Android or if it's just an emulator where you select an RPG Maker game, because it would be nice if I could release my game on Android when finished and maybe put ads in it :P
Title: Re: Abmob on Android
Post by: Yuki on March 07, 2017, 05:25:28 AM
Quote from: DJ Omnimaga on March 07, 2017, 03:53:35 AM
I also wonder if EasyRPG can be bundled with games that are ported to Android or if it's just an emulator where you select an RPG Maker game, because it would be nice if I could release my game on Android when finished and maybe put ads in it :P
The licence permits you to sell your game with EasyRPG as long as you publish your changes to the engine, if any. If you can bundle EasyRPG with your game on Android, that's another story and something to investigate.
Title: Re: Abmob on Android
Post by: gameblabla on March 08, 2017, 05:28:04 AM
Quote from: DJ Omnimaga on March 07, 2017, 03:53:35 AM
I'm very late @gameblabla but you should feel glad that you earned $100 a month or might earn $12, because the max I made from music in my peak years was around $60 in a month and I sometimes make less than that in an entire year (although now it kinda went up again). And of course, it's actually less than $60 for sure because it costed me about $105 a year to keep three of my albums on iTunes/Spotify/etc before I pulled them out.
I'm sorry but it's really stupid for an indie to put their songs on iTunes due to the insane amount of money Apple asks you.
Plus, it's overcrowded and it's just hard to get noticed by anybody.
Artists have other alternatives now though, thankfully.

DJ, i'm complaining because it's my only source of revenue. I don't get any money anywhere else.
Unfortunately, people on mobiles are cheap bastards that have no problems having their calendars being spied on
but complains as soon as the game costs 0,99$.

On the other hand, the very same people are ready to shell out 500$ just for a simple Wordpress website made in one day !
(which is currently what i hope i will be doing, someone is already interested)

In this day and age, i think it's stupid to think that you can make money from games.
All you will end up doing is spend more money on more drama and f***ing trash.

EDIT: Also, like juju said, license allows that as long as you release the source code.
However, you may have to modifiy EasyRPG's source code so that it points to the internal APK and start the game from there.
It's possible but requires you to be able to compile the source, build it, sign it etc...
Title: Re: Abmob on Android
Post by: Yuki on March 08, 2017, 09:38:34 AM
Capitalism is kinda weird, indeed, but eh, that's how it works. I work in that field and people and companies will indeed hire someone to do their website if they don't know how to do it themselves and/or have studied in design. Of course, you can just take a free Wordpress hosting, but some people have special needs only a web designer can do. There's a lot of demand in programming/design.

Money for games, yeah, I kinda agree with you, some kids don't want to ask their parents for app money. Actually, there's a bit of a difference: people are ready to shell out $1000 for a website because they need it for their company, but they often don't want to pay for these apps because they don't really know the developer, it's not popular enough, they don't need it, or they can't pay for it and they'll probably prefer buying some food instead. Or the new Zelda you know every critic unanimously said it's the best game ever. It's a bit of a catch-22.

For EasyRPG, seems the code is already there, but they didn't documented it because it's not stable yet, as of a few months ago. Shouldn't be that hard to build it with the game.

https://community.easyrpg.org/t/apk-with-game-builded-preloaded-inside/294/2
Title: Re: Abmob on Android
Post by: Dream of Omnimaga on March 16, 2017, 04:15:31 AM
@gameblabla I actually made 9 times more money from A Decade of Magic Hardcore on iTunes+other big sites than I did on the free of charge Bandcamp website. It might be stupid to put music on iTunes as indie due to how much it costs and how much they keep for themselves, but your stuff get a considerable amount of exposure there if it's electronic music. However, for all my other albums I made more Money on Bandcamp because most people who uses iTunes or other big distributors only care about hip hop, dance and pop music.

As for music, making a lot of money as indie artist is a full time job as much as it is to work full time at Walmart, if not more, and it still won't even pay close to as much as Walmart. You need to spend 50 hours a week non-stop on social media to promote your stuff, interact with fans, create merch for sale and more importantly, you also need to tour and play live gigs.
Title: Re: Abmob on Android
Post by: p2 on March 23, 2017, 10:02:34 AM
Pleeease tell me you are currently spoilering us on your plans for this summer O.O
I will sooo much come to ur live gig  :love:
Even if I had to come to canada for it  :thumbsup:
Title: Re: Abmob on Android
Post by: Dream of Omnimaga on March 23, 2017, 04:27:15 PM
Lol no I won't play live <_<
Title: Re: Abmob on Android
Post by: tr1p1ea on March 23, 2017, 08:08:10 PM
I'd come from Australia!