Android :: 2D Game On SurfaceView Runs Slowly On Touch
Aug 30, 2010
I am building a 2D game with Android SurfaceView. When I touch the screen the game animation runs slowly. Why, and how can I avoid this?
The touch events are stubs just like onTouchEvents(MotionEvents ev){ empty };. All of the game logic and graphics draw code are in run() in an extends Thread class.
View 3 Replies
Oct 10, 2009
I am developing a chess game, what view should I use for the chessboard, Canvas or SurfaceView? I want to implement some animations like moving a piece, fading the chessboard or maybe rotating the chessboard.
View 4 Replies
View Related
Jun 18, 2009
My game runs fairly well on my phone, but i want to increase the performance by using opengl. However currently i use the Canvas. I am a beginner in opengl. I have to port all my drawing code to opengl. However can somebody give me directions. For example how do i do the following in opengl:
c.save();c.scale(0.3f+scale, 0.3f+scale, width/2, height/2) c.drawBitmap( bMsg.bitmap, width/2 - bMsg.bitmap.getWidth()/2,dy+height/2 - bMsg.bitmap.getHeight()/2, MESSAGE_PAINT);c.restore();
And why cant i just use Canvas as an abstraction layer (facade) for opengl. An implementation of canvas could call the correct opengl methods in order to render. Why do i have to port all my code. I thought the canvas was a good abstraction interface to a drawing surface, why do i have to bother with opengl? It looks like this is possible, when is see the following contructor: "public Canvas (GL gl)" Also the this seems usefull. SURFACE_TYPE_GPU Surface type: creates a surface suited to be used with the GPU So what should i do? Re implementing the GamePainter completely and call opengl functions directly? Or is there some kind of abstraction mechanism, so that i can use OpenGL with just a few lines of code?
View 4 Replies
View Related
Apr 18, 2010
I'm developping a simple realtime action game 4 Android. It works nice. but now i want deal with animation FPS and i'm facing a big problem i can't solve since couple days now.
I started from the famous Lunar Android sample using facebook. got 55-60 frame per second on my G1. it smelt good for my game i thought ... BUT when i plugged the surface view in my game i got a poor 6-9 Frame per second making the game unplayable.
After debugging removing all content of my doDraw used by the thread controlling the surface view i found the problem.
The problem is not the quantity of sprites i displayed but the concurrency between threads used for receiving my game data over TCP and the UI thread i use to control surface view.
If when i start displaying the game i stop the my socket protocol threads (reader, writer) the game is refreshed at 25 FPS which is not 50 FPS but large enought to make the game playable.
So my question is how in realtime game for android i can send / received data (and not delayed of course) without killing the game refresh rate.
Last thing i use canvas and not open gl but i don't need open gl and i really see the problem comes from the multithreading.
View 6 Replies
View Related
May 21, 2010
I have an Android game that has an activity for the menu, and then another activity for the game that creates a SurfaceView and Thread to deal with canvas drawing and game logic. When you exit the game and start it up again too much or if you open and close the keyboard (thus restarting the activity), the game runs out of memory, usually when loading a bitmap: java.lang.OutOfMemoryError: bitmap size exceeds VM budget keeping all my images in memory without loading them again.
View 3 Replies
View Related
Aug 20, 2010
One using a Surfaceview, and the other using a custom view. According to the android SDK development guide, using a surface view is better because you can spawn a separate thread to handle graphics. Th SDK development guide claims that using a custom view with invalidate calls is only good for slower animations, less intense graphics.However, in my simple app, I can clearly see that using a custom view with calls to invalidate seems to render faster.What do you guys know/think about this?My touchEvent code is exactly the same, and my drawing code is exactly the same. The only difference is that one is all in the UI thread, and the other is using a tread to handle the drawing.
View 1 Replies
View Related
Feb 25, 2010
It would end up looking something like the PSP. You would think that this would be an incredible feature for gamers and any platform that was serious about gaming. Then we wouldn't have to use touchscreen controls, barely passable d-pads, or optical trackballs?
View 3 Replies
View Related
Sep 9, 2010
I want to slowly fade out my main view Xml and go to another XML?Please anyone give me an example with a sample code.
View 1 Replies
View Related
Jul 31, 2010
Can we load an XML file by slowly hiding the previous XML? I want a splash screen effect.
View 1 Replies
View Related
May 22, 2010
I have a square grid, for a turn based game ( grid is similar to the chess board ), but the moves in the games are different based on whether you have lapped your opponent pawn at least once or not.i.e if you have not lapped (beaten any of the opponents pawns) in the outer most grid as below.if you have lapped your opponent pawn once at least, then you get to reach home,this way.Any player having all his pawns reaching "home" first wins.The ones in yellow are safe-houses, i.e both the opponent pawn and the player's pawn get to stay in the same grid, this is not considered to be lapping ( the opponent ).The lapped pawn will return to its start point.Now the question is, what is the effective way to store the paths for the all the pawns.we will have 4 pawns for the player and 4 opponent pawns.Is there any pattern to store such static information, in a elegant way?
View 1 Replies
View Related
Nov 12, 2010
I have a puzzle game with a 7x7 grid of graphics, and a timer, its just about ready to go. But I am stuck on how to go about saving/continuing game. For example when someone exits I want them to be able to save and exit, then come back and click continue to pick up where they left off with all of the graphics in the right place, timer and score. I looked at onSaveInstanceState android examples, but not sure if this is what I need or how to implement it in my case.
View 8 Replies
View Related
Nov 4, 2010
I have written some code for autocompletetextview in custom dialog box.When typing some text that text dynamically search into the hashmap.This hashmap is with large lines of text.It works.But slowly giving me result.
CODE:............
If I take thread for above code it is giving me thread handler exception.Please give me an idea for quick response of list on autocomplettext.
View 1 Replies
View Related
Oct 1, 2010
In my android app I call the voice recognition in my onCreate method of my startup activity. I have made it a preference to start up with the voice control or not. However, the app takes about 5-7 seconds to load when voice recognition is on. When it is off, the app starts almost instantly. Below is sample code, I have added Free_Form, max_results 1, and a custom prompt to mine.Why would calling the normal android speech recognition take sooo long to load in my OnCreate method?
View 1 Replies
View Related
Mar 10, 2010
Web pages seem to load very slowly on my N1, when not using wifi. I use an orange SIM card that I got with my old nokia N82, which was a 3g phone. I always struggled with internet speeds with that phone too. I do get the "G" and the arrows below it flashing away as suggest 3g is working. Maybe I expect too much, but Jesus it can be frustrating!
View 5 Replies
View Related
Feb 12, 2014
I dropped my phone that created a crack (a new crack stemming from an older one which gave me no problems) which lead to me not being able to use the very bottom of my screen (really just the space bar area). The crack was slightly above said area. Then this "blue ink" smudge began forming and took over the bottom 1/4 inch of the screen. When I woke up the next morning, the only portion of the screen still visible was the middle third, as the top and bottom were now dark blue. By the end of my shift that morning, the screen was completely black. I have heard a screen replacement may be all I need, but I am worried that the digitizer (I hope I'm using the right terminology, referring to the touch screen capability of the phone) may have been damaged as again I could not use the bottom part of my screen.
View 2 Replies
View Related
Nov 11, 2010
Today I finally upgraded to 2.2 and installed kaosfroyo. As with many other eris owners the camera app shuts out on me so I installed camera360 and I'm pretty happy with it. The only problem I have is the photo gallery and how stupid slow it is. It takes so long to load my pictures (which is pretty few) that my screen turns off after waiting. And when I go back into it, it attempts to reloads all the pictures again, just to have the screen turn off(again)! I never had this problem with 2.1 (xtrROM).
View 3 Replies
View Related
May 29, 2010
So I'm running eris 2.1 v3, and I've had a overheating problem since I've taken the leap and stopped using a task killer. Now every single time i charge my phone, it will charge extremely slowly and overheat to as high as 133 degrees. I'm assuming that the problem is apps running after i believe I've closed them (closed by menu->close, or the back button until homescreen) but i thought that the apps end up closing themselves, am i doing something wrong?
View 6 Replies
View Related
Jul 8, 2010
So just got the Sprint HTC Hero and tried the Snesoid lite. All the games run pretty slow. Most reviews i've seen for Snesoid that have been positive, the person had something like the Evo or incredible. Is there anything i can do to make Snesoid run well? Does getting the paid version of snesoid help? Getting another phone is not a solution.
View 4 Replies
View Related
Sep 3, 2010
Before Froyo, I was able to charge my phone in my car and use the GPS. Now, with Froyo, my phone charges way too slowly. Infact, my phone actually DISCHARGES while uses the Navigation when plugged in!! I have two questions:
1. Is Froyo designed to slow charge the phone?
2. If so, it makes my GPS setup defective. How do I revert back from 2.2. to 2.1?
View 34 Replies
View Related
Aug 26, 2010
I'm on Droid 2.2 and whenever I slide my finger to switch screens, it takes so long for my Droid to slide to the next screen. When if finally does slide over, I see the apps/icons appearing slowly.
View 2 Replies
View Related
Jul 24, 2010
I'm using apps to sd, and have been noticing my internal memory slowly dropping. If I remember correctly, this is due to apps storing their cache there. Any way to direct it to the sd card?
View 4 Replies
View Related
Oct 22, 2010
Is it just me, or is this forum running very slowly at the moment...? I have a pretty new laptop, which isn't full of rubbish just yet, and other websites seem to be fine...
View 4 Replies
View Related
Sep 22, 2010
One thing I notice about this phone is that it takes a long time to charge. It takes at least 2-3 hours for a full charge verses about an hour for the iPhone 4 or Droid X.
View 4 Replies
View Related
Nov 9, 2009
Is there a way to make highlighting of a row in a listview delayed if the user is simply scrolling the list with their finger? To clarify, when the user puts their finger down to scroll, the intersected row (if any) gets highlighted for a short moment, before it realizes the user is just trying to scroll (then the highlight turns off). It seems like the timeout is too short - iPhone has the same behavior, just seems that the timeout is longer to discern between a real row- select-touch, and just a scroll-touch. Any way to tweak this? You can see the behavior in any of the system apps that have lists..
View 2 Replies
View Related
Apr 9, 2010
I have an app that has a few checkboxes in the settings and then compiles a remote sql based on the checkboxes selected. i ran it in the emulator and it's fine. but then i exported it and published it as an app, and the same checked boxes aren't being passed correctly. i wonder if it's a caching issue or something. tried deleting the apks a few times and republish but to no avail. i "fake-edited" the source java and then export again, still no difference.
I'm kind of new to eclipse but is there a force build option? i only see build-automatically option under project but not sure how i can make sure that the apk exported is the same as run in the emulator
edit the emulator is version 1.5, and my phone is nexus one running 2.1- not sure if that makes a difference
View 1 Replies
View Related
Aug 7, 2010
Ok so here's the deal guys and gals, I am trying to have my phone assist me with my running. There are plenty of apps that will track my run via gps if I bring my phone on the run with me, but I don't wanna do that. I want to be able to map a course out, enter how long it took me, save the map and even share it with friends. Ideally the app would have the gps running features I mentioned above just on case I ever do start bringing my phone with me. Here is an example of what I mean in website form (unfortunately they make a sweet app for the iphone but their android version is pretty awful right now.MapMyRun.com -
View 9 Replies
View Related
Feb 19, 2010
Does anyone know if there is a way to identify (in code, not LogCat) when the GC has run? Perhaps an intent is fired? I could analyze the LogCat output, but it would be ideal if I could determine when the GC has run from my code.
View 2 Replies
View Related
Jul 16, 2009
The emulator does not install with any IM app.For testing purposing, I would like to have an IM application on the emulator.
how can I get one of these IM apps run on emulator? http://www.gandroidmix.com/im-clients-for-android-os/
View 2 Replies
View Related
Aug 16, 2010
If I call to a ContentProvider from a Activity, which thread is ContentProvider running in?
E.g. What happens if the Activity is killed and a query is executing in the ContentProvider? Say that you have a slow network query f.ex.
View 1 Replies
View Related
Jul 3, 2010
After the official 2.1 update, my service has been getting slowly worse. The is a tower a half a mile down the road from me, and at random times the Eris will say I have no service. But I know it's not just the tower because I still don't get service randomly at places it's usually fine.
View 8 Replies
View Related