GLBasic forum

Main forum => GLBasic - en => Topic started by: MrPlow on 2015-Jun-13

Title: Admob & AE for landscape app
Post by: MrPlow on 2015-Jun-13
Hi SF et al,

I am noticing very few ad variation for landscape with the adverts setup for Admob...
Is this a known issue or problem with Admob support for landscape  video adverts?

Thks Guys
Title: Re: Admob & AE for landscape app
Post by: MrPlow on 2015-Jun-13
My ads were loading at game intervals but now only once per application run.

Anything jump out on the code of interstitial.gbas?
Using AE 2.9 according to message on compile

Code (glbasic) Select
GLOBAL adService AS ads

// Google Abmob is removed, but inserted Amazon instead.
TYPE ads
isloaded=0
count=0
retryagain=0
retrytime=350
error$=""

FUNCTION load: ID$=""
?IFDEF ANDROID
self.isloaded=1
self.retryagain=0
self.error$=""
JavaCall$("ads:load")
?ENDIF
ENDFUNCTION

FUNCTION numberadsshown:
RETURN self.count
ENDFUNCTION

FUNCTION show:
?IFDEF ANDROID
IF self.isloaded=1
LOCAL result=JavaCall$("ads:isloaded:3")
IF result=-1
IF self.retryagain=0
self.retryagain=1
self.count=self.count-1
IF self.count<-1 THEN self.count=-1
self.error$=JavaCall$("ads:error:3")
DEPRINT("error: "+self.error$+" "+RND(100000))
ENDIF
IF self.retryagain>0
self.retryagain=self.retryagain+1
IF self.retrytime<self.retryagain
self.retryagain=0
JavaCall$("ads:reset:3")
self.load()
RETURN
ENDIF
ENDIF
ENDIF
IF result<1 THEN RETURN
IF self.count<1 THEN self.count=1
self.retryagain=1
result=0
JavaCall$("PauseState:0")
GOSUB GLB_ON_PAUSE
JavaCall$("ads:show")
REPEAT
SLEEP 200
result=JavaCall$("ads:isloaded:3")
SHOWSCREEN
UNTIL result=-2
GOSUB GLB_ON_RESUME
JavaCall$("PauseState:1")
JavaCall$("ads:reset:3")
self.isloaded=0
self.count=self.count+1
RETURN result
ENDIF
self.isloaded=0
RETURN
?ENDIF
ENDFUNCTION
ENDTYPE

Title: Re: Admob & AE for landscape app
Post by: MrPlow on 2015-Jun-13
Hi All

Got it fixed - Using Bluetooth in manifest will only allow 1 ad to show... removing it fixed the ad displays :)

However the landscape question still stands - is admob now showing videos on landscape mode?

MrPlow

[ PLEASE MOVE POSTS TO MAIN GLB Topic - posted here in error ]
Title: Re: Admob & AE for landscape app
Post by: spacefractal on 2015-Jun-13
It's a Admob issue. I'm could newer fix it. They all ways using the default orientation. So can do nothing about it. Here amazon ads worked better.
Title: Re: Admob & AE for landscape app
Post by: MrPlow on 2015-Jun-14
 Okay - how do i ad amazon ads for landscape app? is it just a manifest entry then setup advert?

Do I need all these?

Add the following permissions to your manifest
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

Also what the entry for the ad key (like we do for admob)?
key = 76d468352dd44bfd9f1085699224b1da

Title: Re: Admob & AE for landscape app
Post by: spacefractal on 2015-Jun-14
Amazon ads only works in some countries, so it's should fallback to Google ads Eventuelly.

Is is currently a issue I'm can do nothing. I'm hate that too. This is just what android something is strange. It's seen does not respect the orientation set in manifest for some reasons.

You need to live with it.... I'm don't have time currently to look and have tried one that r two times without luck.
Title: Re: Admob & AE for landscape app
Post by: MrPlow on 2015-Jun-14
Thanks SF! No worries - how do i add Amazon ads to the xml file?
Title: Re: Admob & AE for landscape app
Post by: MrPlow on 2015-Jun-15
Hi Sorry,

Still no answer for these...
Anyone know how to add the Amazon key for adverts  to AE?

Do I need these permissions also?

Add the following permissions to your manifest
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

Also what the entry for the ad key (like we do for admob)?
key = 76d468352dd44bfd9f1085699224b1da

Thanks
Title: Re: Admob & AE for landscape app
Post by: spacefractal on 2015-Jun-15
checkout the help file, im thinks im did added the info about that.

PLEASE NOTE, amazon Ads CANNOT been used world wide and is LIMITED to some countries where Amazon have its activity. Im did not coded a fallback to Google Play when Amazon Ads failed to deviver. Im should have do that, but is not in the near future. But howover some of my games is gonna to been released to Cannaonball in Usa and India (some TV service with Android support).
Title: Re: Admob & AE for landscape app
Post by: MrPlow on 2015-Jun-15
Ah I see - only amazon API installed then?

Is that the case for landscape or both portrait and landscape?

So apps I create Admob ads for on Admob console do not show now? Is that correct?

How does app know to link app with ads and payee?

Just as well I didnt update to this latest change or I may have lost a lot of money :)

Thanks
Gary
Title: Re: Admob & AE for landscape app
Post by: MrPlow on 2015-Jun-15
Okay - I think things are getting clearer...

I am now seeing some movement on the adverts in my Admob console :)

6/14/2015 162 98  80% 11 11% €3.13 €5.18 €0.51
6/13/2015 138 79 96% 6 8% €4.96 €8.67      €0.68
6/12/2015 212 119 97% 23 19% €2.39 €4.26 €0.51
6/11/2015 201 122 96% 7 6% €0.96 €1.58     €0.19
6/10/2015 93 50 85% 3 6% €0.39 €0.72         €0.04
6/9/2015   29 14 100% 1 7% €4.27 €8.84       €0.12

Onwards and upwards :)
Title: Re: Admob & AE for landscape app
Post by: spacefractal on 2015-Jun-15
You can only uses Either Amazon or Google, you can still not use both. There is no TBA when that is done.

The orientation issue is years old bug and one of the Android strangers and newer understoold why its can been that hard to do thing right.

For me its look like, its does not repect the orientation set on Manifest for some odd reason. Im not sure why that is wrong. Im are is aware of its, but really its a lower priotity issue really.
Title: Re: Admob & AE for landscape app
Post by: MrPlow on 2015-Jul-06
Hi Spacefractal,

Do you know if there a difference in ad showing if orientation is set to "landscape" instead of "sensorLandscape"

I might try it to see if the results are different.

Thanks again!!!
Title: Re: Admob & AE for landscape app
Post by: spacefractal on 2015-Jul-06
for some reasons admob allways uses default orientation. Im not sure anything can do other than update the SDK. Its wont do that very soon. "sensorLandscape" would automatic orientation on the either way, while "landscape" does not.

Im just got "sensorLandscape" to work on iOS8 as well as well software auto rotation on older iOS (its is in the beta.
Title: Re: Admob & AE for landscape app
Post by: MrPlow on 2015-Jul-07
thanks SF!

I did an update for my Ping Pong and a user says the new version crashes on their Nexus 6 using 5.1.1 (which is fine on my Nexus 7)

I used "landscape" not "sensorLandscape" so users could play right or left handed.

Also I only gave internet access permission - might that be a problem? Would I be required to allow write access too?

Title: Re: Admob & AE for landscape app
Post by: spacefractal on 2015-Jul-07
can been the issue. Also Admob also uses other required permissions. Without it, its might crashout.

etc uses those as minimum to make sure glbasic dont crash due permission issue:

   <uses-permission android:name="android.permission.INTERNET" />
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
   <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
   <uses-permission android:name="android.permission.WAKE_LOCK" />
   <uses-permission android:name="android.permission.BLUETOOTH" />
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

Im do pretty sure both BLUETOOTH and WAKE_LOCK is not required. But dont remove the rest. ACCESS_NETWORK_STATE is also required by ADMOB.
Title: Re: Admob & AE for landscape app
Post by: spacefractal on 2015-Aug-23
im a gonna to update Google Play services from version 4323000 to 7895000, which hopefully many of those bugs in newer systems.

Im did today updated my HP touchpad to Lollipop, and here its crashed on a Video ad in MediaPlayer, where im have no control over. The new google play size is quite bigger.

EDIT:
Look like this have helped. Im got a video ad and its was played in the correct orientation and no crash.

So until im update AE, do this to update Google Play services to the newest version:
- Download: https://www.dropbox.com/s/0vsnn6vr3ovo1xm/google-play-services.zip?dl=0
- Put it in Compiler\platform\android\templateproj\libs.
- Delete distribute\Android\libs from your game folder.
- In the AndroidManifest.xml the value in the meta-data line (com.google.android.gms.version) should been 7895000

Done. There is no other changes, so its was possible to update the google play jar file without breaking java or glbasic files.
Title: Re: Admob & AE for landscape app
Post by: MrPlow on 2015-Aug-24
So good!

So I can use for my landscape apps now! :)
Title: Re: Admob & AE for landscape app
Post by: MrPlow on 2015-Aug-27
Hi Space Fractal

I notice the new google play jar is 3 times the size of the old one....is that normal?
Title: Re: Admob & AE for landscape app
Post by: MrPlow on 2015-Aug-27
Hi SF,

My Wimblepong should show ad after end of first game...but it now crashes...

https://www.dropbox.com/s/yohg7fv5e417j8i/wimblepong116.apk?dl=0 (https://www.dropbox.com/s/yohg7fv5e417j8i/wimblepong116.apk?dl=0)

Okay, so after adding Access State permission the crashing has stopped...but dont see video adverts still...maybe it takes better region to see them?
https://www.dropbox.com/s/b7nd3epcpkvvw94/wimblepong116c.apk?dl=0 (https://www.dropbox.com/s/b7nd3epcpkvvw94/wimblepong116c.apk?dl=0)
Title: Re: Admob & AE for landscape app
Post by: spacefractal on 2015-Aug-27
checkutout logcat. Logcat is your friend.

some video ads might crash with the old jar version, which is why im looked to update it to the newest version from SDK Manager.

Make sure to the version number match that one using in manifest. If you downloaded that version im linked to, dont forget to update the version number to 7895000 in manifest too. Otherwise its simply just crash out.
Title: Re: Admob & AE for landscape app
Post by: MrPlow on 2015-Aug-28
Hi SF,

Is the Google Analytics part now implemented is this SDK?
Title: Re: Admob & AE for landscape app
Post by: spacefractal on 2015-Aug-28
Property, but is not implemented or planning to do that.