I have a "trivia" kind of game which only allows user to play in "Portrait" orientation. As you know, android activities automatically restarted when the orientation changes.
My game asks 20 questions to user in a randomized order. And there is a button that the user can get "hints" with watching rewarded video ads. However, AdMob sends "Landscape" videos, sometimes. And for that reason, after the video has finished, my activity starts from the 1st question, again.
How can I restrict AdMob from sending "Landscape" orientated video ads? I could not find anything on AdMob help page. Or, can I make it via coding? I am sure that restart thing is about orientation change because when AdMob sends "Portrait" Ads, game goes well from where it was before the video.
Thanks for your help!
Add "configChanges" property in the activity tag in "AndroidManifest" to prevent "activity" from restarting due to orientation change caused by the intersitial video.
watching rewarded video ads start a new Activity then your Activity will be in background and when your video finished or close your Ad then your paused Activity come in foreground.
So don't worry about your App start from beginning. Make sure you're not calling onDestroy() on your Activity and having all appropriate configuration in Manifest file.
https://groups.google.com/forum/#!topic/google-admob-ads-sdk/BJ9XGyDMGHk
Related
I am using AdMob's RewardedVideoAd.
What I've done is when user opens a chat activity, I ask him to view a video to be able to chat to another user (by simply switching visibility of the chat elements). Then, after the video is watched, I make the chat elements visible.
It works well on the emulator. However, when I tested it on my phone, the chat activity is closed after video is watched. I cannot understand why this is happening.
It only happens if a user watches the video till the end (onRewarded() is called).
Any suggestions?
Ok, I worked it out.
It happened, because I did not forward the lifecycle events. After I called resume(context), pause(c), destroy(c) according to my Activity lifecycle, it worked.
God knows why it worked fine on the emulator and did not on my phone.
I am using AdMob banner adds in my game. When I click on the add, I want app to pause while the user is taken to the ad content.
What is happening is that the app is completely destroyed and onCreate is called when I go back to the app.
How to resolve this?
I have similar problem like this.
On start my app displays a splash screen and checks via network if the current user is still premium.
My problem: I started my app right before I went to bed and minimized it by pressing the home button. In the morning I launched the app again and it resumed the activity from the night. The app never really quit, my splash screen was not shown and and it couldn't check if the user is still premium.
So how can I achieve my app to be closed after a certain time (e.g. when the app is minimized)?
But the problem is there is a portion in the app where I can view videos in full screen and here I use android's default player. So when the app is minimized while watching and then again open the app onResume will not be called and cannot check whether it is a registered user or not. The video player will continue to play the video. Is there any method so that I can kill the app when the video is playing and minimised?? is there any method which is called when the app is minimised using home key press?? Is it possible in every device to detect the home keypress event and write some code there?? Please help with some fresh ideas!!!
Now I know why my reputation is always low. Thanks Dan Hulme. You are right I just want to use the app lifecycle correctly. I want to use onRestart not onResume. And that have done the work for me. Thanks all.
I'm developing an Android game with multiplayer using Google Play Game Services. The game is working well, but one thing... An ad banner is displayed while players are playing, and if the user clicks on it, then the browser opens, and "onStop" is executed on my activity, and Game Services disconnects the player :(
Is there any way to solve it? I would like players could see ads without disconnecting :(
Try to capture the onclick event, than pause the app, and forward the event to browser's call
Remove any code relevant to disconnecting from your onStop() method.
If #1 is already solved, then it seems to be an issue with the AD-SDK that you are using.
My game implements AdMob SDK and the client is not disconnected when clicking on an ad even though the browser opens.
Let me know if you want any other help.
I've integrated AdMob with my app. I can't seem to find this in any AdMob references.
Are AdMobs still running and bringing you revenue even if the app is in background or the ad is not visible? (for example
the user pressed the "Home" button
the user turned off the screen
the ad is positioned outside screen bounds
In my opinon this is clearly a wrong behavior if AdMob is still requesting ads and paying money per impressions in any of the above cases.
How does this actually work? Can anyone point me to a link/reference that exaplains this behavior?
Thanks
Clicking back, home, or closing your phone will pause your application but not terminate it. It is possible to run your application as a Service\WakeLock and it will continue to run in the background. Admob requests should not be running in the background if your application is paused. You should not be receiving impressions or revenue while your application is in the background.
Quote from AdMob: background requests?
You can see in LogCat when AdMob is requesting ad. Are you seeing any
requests when your app is in the foreground (you should), and when
your app pauses (you should not see any requests)?
By: Android Dev Guy