AdMob is slowing my other view animations - android

When I use AdMob in my activity it is slowing down all my other view animations, introducing artifacts on them and so on. Did anyone have this and was able to somehow solve it?
UPDATE: I have a really old Nexus 7 with Android 4.4.2 and it was running everything perfectly smooth. Then I upgraded it to Android 4.4.4 and it started to show that crappy performance + artifacts. What could have changed there in this small update from 4.4.2 to 4.4.4??

We have had this issue on a couple of our games. The problem in our case was as follows.
The game itself had a bunch of layers to accommodate all the animations, and the Ad later was on top of the game layers, this messed up the renderer as it had to cater for the ad while rendering the scene. We had to hide the ad during game play to ensure full speed animation. An alternative was to adjust the size of the animation layers to ensure that they did not overlap the ad layer, but we did not go that route as our home grown framework did not support that.
Hope that helps.

Related

problem with exporting a game to android in unity

I created a trial 2D game in unity which consists of 4 scenes. In each scene there are several objects. Generally game is not very demanding in terms of components. The problem is exporting the game to android. The application stutters a lot as if it had 5 fps and the graphics deteriorates significantly. I tried to export the application to my computer and the game does not stutter but there are slight blurring of objects in addition I noticed that when I turn on the game the computer starts to howl, I checked what is the reason and it turned out that the application consumes all the graphics prosesor I do not know why. In the application (on android) were also strange errors among other things when scaling the buttons in the menu (they are very small) and the animation of loading the scene (also very small does not cover the entire area). It is possible that it is about "player settings" but I am not sure.
I am focusing more on android so this is the problem I would like to solve the most.

Ripple effect on all clickable items is slow

I do not know what could it be, but does not look like a performance issue (like doing too much work on the background) because there is no message on LogCat saying Slow measurement, Frames skipped or ConstraintLayout issues. The app animations work perfectly. But, unfortunately, all the clickable elements that I added on the xml:
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"
are too slow. That slow, that whenever I click, instead of the smooth animation that moves and starts on the exact pixel I click on, it appears an awful shadow and remains like so for a while (~2 sec).
If it is indeed an android performance issue, how to debug it? Also, I do not know where to start and which information I need to add in order to add valuable information to this question but, if needed, please, ask for it and I will try to add as much information as possible.
The only thing I could say in advance is I am using MVVM and coroutines, so there is no performance issues on that matter, but maybe only UI related?
EDIT:
Samsung J2 Prime and Samsung Galaxy Note 3 work good, all animations are good (even though is a small and old device)
Motorola Zoom and Redmi Note 8 Pro are working with laggy animations (animations are meant only the clickable animation (Ripple effect), the ConstraintLayout animations are working smooth.

Poor performance in animated Flutter widget

I am creating a game in Flutter that is mostly about dices. To make the background of the main menu interesting and dynamic i added a few blurred animated dices. I also use these animated dices elsewhere in the game. Something like this:
I started off using Flare as an animation library, but the performance was very bad. (using this animation).
After that I recreated the animation as a Flutter widget. However the performance is still very poor. On a OnePlus 3 I am getting somewhere around 30-40 fps and on a Galaxy s20 (in 120hz mode) somewhere around 50-60fps. Underneath are the frame rendering times for the OnePlus. Offcourse I am testing in Profile mode. Mainly the Raster thread is doing a lot of work here.
Here is a github repository with the code. This is a minimalistic version to reproduce the performance problem.
As far as i can see there are no unnecessary rebuilds. The only thing that is rebuild very often is the SlideTransition (This line) for the dots.
What can i do to improve the performance? Or what can i try to profile it. I have noticed that removing the Transform.rotate (this line) helps, but it does not solve the problem completely.
I am using Flutter 1.20.2 and Dart 2.9.1 in Android Studio 4.0.1

Unity Android NGUI Components shows smaller on the build version than the Emulator version

So i was building this UI for an app in Unity to be deployed on Android Platform.
Here is the preview from the Game Window :
But when i build and run the app on my device, it shows this :
The header log is anchored on Top, the title is anchored on Center and the buttons are anchored on Bottom.
Here is the hierarchy of the components :
Im new to Unity and NGUI so i really dont know what's wrong with this. Thank you guys.
Different behavior is probably caused by different resolution/ration on your device in compare to your editor window. To emulate such behavior in the unity editor, you can force resolution/ration in your game window, or you can add your specific device resolution (what I actually recommend for you to do as a good start):
When you experiment with few of them, you will see that your interface is behaving in different ways.
To change that behavior on different screens, you can check your UIRoot options, especially Scaling, see UIRoot documentation.
Another good places to start is NGUI forum's topic concerned in handling different resolutions or official video about NGUI anchors.
Hope that this will guide you to perfect cross-device interface design.
I think your problem is configuring how is going to work NGUI with your sprites. There are 2 things you could do:
Use a pixel perfect resolution: This will maintain the perfect size of the sprite, and will look the same on every platform (this causes some things to look smaller if the resolution is higher)
Use a fixed Size of the UI and recalculate the sized based on the device.
The problem you are having here.. is because of that. The background for example, should be larger if the screen is larger.
To achieve that.. NGUI provides you with a UIRoot where you can configure the Scaling style to PixelPerfect, FixedSize and FixedSizeOnMobiles.
Try setting that up and the images will adapt to the different sizes.
Hope this works for you, I'll attach an image so you can check out what I'm talking about

Animated MoPub (AdMob native) ads overlayed on a game black out screen

I've got a game based on AndEngine using MoPub ads with the AdMob adapter, and with v6.1.0 of the AdMob SDK. I'm using the latest mopub-client code pulled from GitHub today. I've also tried this after removing the native adapter.
I display ads using a FrameLayout which contains a SurfaceView and the MoPubView.
The device I'm testing on is a 4.1 (Jelly Bean) Galaxy Nexus.
Problem is, when the ad happens to be one with multiple frames, as the frames change, the rest of the screen goes blank (i.e., the game vanishes and users are left with a black screen with the banner ad still dutifully rendering in the top)
This seems to occur more frequently if I leave the app then return to it.
Also, if I make a dialog appear (with the back button), the game will reappear behind it until I :
1) dismiss the dialog
2) wait for the next frame in the banner ad animation
Any ideas how I can debug this further, or has anyone encountered this before and knows what I need to do? Is there a better alternative method for overlaying a banner on a SurfaceView?
Cheers
i had the same problem on a Nexus 7 and it was solved with:
adView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

Categories

Resources