After getting so much help from Stack-Overflow I'd like to share back some of my experience:
I spent hour of debugging with one special
09-18 08:11:37.177: DEBUG/SEC_Overlay(128): overlay_setPosition(-1) 03,680,90,120 => 503,680,90,120
09-18 08:11:37.177: INFO/SEC_Overlay(128): Nothing to do!
This is logged each time the GLSurfaceview is updating. But only when the GLSurfaceview is used in combination with a relative Layout and a camera preview. This is combination is essential for the AndroAngelo App. On the main screen I have the radial OnScreenMenu overlayed onto the GLSurface view and on the calibration screen I put the result of the image detection onto the preview.
It decreases the performance essentially.
What to do?
I really did not went to the ground of it. It appeared two times. The second time it just disappeared after a restart of the eclipse. The first time maybe also, but I played around with camera parameters. And then it disappeared.
It comes back from time to time. It seems to be something in the phone. Each time it appears, i simple reboot the Android device and it is gone afterwards.
Related
Im using bêziers path not vertex one. And in editor(windows) there is
no problem with it. im building for android and trying to play with
galaxy m21. first scene is completely normal. but when it comes for
other scenes it start moving laggy (because of path follower i think).
(im not talking about side walks just movement to forward along the
path)
there is 4 scene and this is looping when click next level in the end.
if we return to first scene that one starts to laggy movement.
game is a little city we move in streets so i was thinking maybe
render based problem so i delete every gameobject about city it became
almost some kind of empty space and tried, same problem.
also i was using different gameobject to follow pathfollower so i
remove that and put my player directly inside pathfollower but it
remains same. when i go next level it starts moving laggy not smooth.
(i understand it because there is trail and shaking time to time)
finaly i add game manager's awake() System.GC.Collect();
Resources.UnloadUnusedAssets(); maybe it helps when nextlevel loaded.
but still it is laggy forward movement.
any idea what is going on? i can take any suggestion thanks for help.
i just find it i was using Dotween for side movement but it was using x,y and z That was my problem.
I dont know how it works when its first loaded. I mean if i load the game and play it works first level but other levels starting >
-sorry i dont know exactly word but its lagging/freezing in the movement.-
But if i close app and start again, that same level works just fine.
Anyway i just tried to disable that script at tried and i see no shaking/freezing in the trail so, i think that was the problem, thats my fault i think like i said, i'm new :)
now i try use tween except the z or try completely diffrent thing.
i'm making my first 2d sidescroller game using a surfaceview and a canvas to draw things on (a lot of primitives put in different path objects).
my game loop uses fixed timesteps with linear interpolation. i don't create any objects during the game. i've been improving my code for 3 weeks now, but my animation is still not all the time smooth. it's ok, but every few seconds there are a lot of little hicks for about 1 or 2 seconds.
what i recognized is when i move my player (this means touching the screen), the little hicks disappear for as long as i touch the screen and move my player.
this means as long as ontouchevent of the surfaceview is called, the animation is smooth.
i dont understand this and i want a smooth animation. can somebody help me?
This sounds like a known issue on certain devices. See e.g.:
Android SurfaceView slows if no touch events occur
Animation glitches while rendering on SurfaceView
Android thread performance/priority on Galaxy Note 2 when screen is touched/released
The problem is that the system is aggressively reducing clock speeds to save power when it doesn't detect interaction with the user. (Qualcomm in particular seems fond of this.) The workaround is to drop frames when necessary. See this article on game loops, and a Choreographer-based trick demonstrated in Grafika's "record GL app" activity (in doFrame()).
I have a GLSurfaceView with a renderer assigned to it. On this view, I draw images which seem to be offset to the left compared to where I have requested that they be drawn on it. This problem has only arisen since I switched from Canvas-based rendering, which rendered the images in their correct positions, to OpenGL 1.0 rendering, which doesn't.
I have read through my code and have found absolutely nothing that could be causing this. What frustrates me is that I know there is nothing wrong with the positions I set using my code, but the problem still persists.
Now, here's the best part of it all. When I pause the application by pressing the home button, and then restart the application through the task manager, the positions are fixed and are exactly how they should be, which leads me to believe that the problem isn't with the positions I set using my code, but how I've set up my surface view. I've checked the dimensions in the onSurfaceChanged() parameters only to find that they are always as they should be, which leaves me even more confused.
Does anyone have any idea what could be causing this problem?
After much digging through my project, I discovered I was setting positions based on the dimensions of the GLSurfaceView before onSurfaceChanged had been called in the onSurfaceCreated method, therefore the width/height of the view at this point was 0 which affected the positions of my objects on the screen.
I feel really stupid now.
I've noticed my whiteboard app becomes 'dormant' after a few seconds of no interaction, so that when something is newly drawn, there is horrible lag. This is without switching away from the app at all - I run it, it's there, I can draw and undo. But if I don't use it for 10 seconds and then try and draw a circle, there can be a second or so of wait before it updates and I get a straight line from start point to current position. So the code to start drawing is instant when the view is touched, but the updates aren't happening for a good while yet.
The code is effectively the Fingerpaint demo drawing onto a custom bitmap, and I copy this bitmap to the view. I undo by copying the bitmap just before drawing starts. I have disabled the undo code to see if that was the issue, but the delay is still there, only far less pronounced. I notice the same lag sometimes happens in the Fingerpaint API demo.
Anyone know why this is? Is there some odd setting I don't know about which causes an active app to go to sleep?
I am writing an Android application that needs to rotate the screen as many times as possible in a certain period of time.
I can rotate the screen fine with setRequestedOrientation(int). The problem I am having is that if I try and rotate the screen in the last call to Activity, onWindowFocusChanged(boolean), the screen cannot keep up with the amount of times setRequestedOrientation is called.
My logcat is showing me that I am getting roughly 5-10 "Setting rotation to [0|1|2|3]" before I get one complete screen rotation.
Here's what I have tried:
Using view to request focus and using a OnRequestFocusChanged Listener
Rotating screen in a child thread to run runOnUiThread to add to main thread message queue
View.post
I know iv'e tried other stuff, but I forget, those are the most recent, and as you can tell I'm getting desperate.
So, is there a way to make sure that the Activity has fully rotated and is accepting user input? Maybe there is a way to check and see if the Activity is looping and waiting for input? Any help here would be absolutely great! Thanks guys.