Android :: Is Android OnTouchEvent Dispatching Accurate?
Jun 6, 2010
I have a weird bug in my piano app. Sometimes keys (and thus notes) hang. I did a lot of debugging and narrowed it down to what looks like androids inaccuracy of motion event handling.Clearly it can be seen here that out of nowhere I suddenly have an ACTION_UP for another note. Shouldn't I definitely get a ACTION_MOVE first? As shown in the end of the log, it's definitely not an error in region detection, since the ACTION_UP event is clearly in the B4 region. Every onTouchEvent call is logged, so the log is accurate.
View 2 Replies
Aug 12, 2010
In my Android application I am getting a very strange crash, when I press a button (Image) on my UI the entire application freezes and after a couple of seconds I getthe dreaded force close dialog appearing.
Here is what gets printed in the log:
CODE:................
This is the code for the Button (Image):
CODE:..................
If I comment the following out the pressing of the button (image) doesn't cause the crash:
CODE:.................
The above code calls down through several levels of the app and into the native layer (NDK), could the call passing through several objects be leading to the force close? It seems unlikely as several other buttons do the same without issue.
How about the native layer? Could some code I've built with the NDK be causing the issue?
View 1 Replies
View Related
Apr 9, 2009
I am working on an android project where the local and remote image files and their thumbnails are to be displayed. Now i have a problem with displaying the remote images. If i click the back button when the application is connected with the server, It waits for few seconds and forces my application to close. Log has a message "Key dispatching timed out". Once the image has downloaded completely back button is working, Here is my log...............
View 4 Replies
View Related
Aug 12, 2010
In my Android application I am getting a very strange crash, when I press a button (Image) on my UI the entire application freezes and after a couple of seconds I getthe dreaded force close dialog appearing.
View 2 Replies
View Related
Jan 12, 2010
I've been pulling my hair out trying to achieve smooth scrolling in an OpenGL-based app on Eclair. It seems that no matter what I do, I cannot get more than 36 events per second (the rest is sent in history data which is useless in my case). This happens on both the emulator and the Motorola Milestone.Is this a hardcoded limit or am I doing something wrong? I'm implementing onTouchEvent on the activity and recording how many events are received per second and then send that info through Log.v to Eclipse. I also tried implementing onTouchEvent on the view instead of the activity and the results are the same.
View 4 Replies
View Related
Jan 26, 2010
I want to catch any onTouchEvent() on the mapview. After search lots of questions&answers, I found only when I write my own MapView(MyMapView)and define onTouchEvent, then use this MyMapView in main activity.
View 2 Replies
View Related
Aug 5, 2010
I am making an user interface and i want to drag any one of them.how can i with ontouchevent.
View 2 Replies
View Related
Mar 26, 2010
I am stuck in a situation,where I have onClick() method & onTouchEvent method. The situation is the my onTouchEvent is handling the fling gestures (like left,right), after each fling i am changing the Layout & presenting new one for the user. On each layout i have some buttons & they have the onClick() set. Now when i do the gesture nothing happens & sometimes the onClick gets called. how i can make these two methods to work correctly?
View 4 Replies
View Related
Apr 27, 2009
I've got a problem with a flood of touch events destroying my game's framerate while there is a touch active. Basically onTouchEvent is called (with getAction = ACTION_MOVE, x = 0 and y = 0) about a hundred times a second for as long as the finger is touching the screen. I've tried returning from onTouchEvent straight away, and even removing its implementation at all, but it doesn't help - the app slows to a crawl as soon as a finger is down. I asked on the IRC channel and Romain Guy advised me that they're aware of the problem but didn't have time to fix it for Cupcake, so I'm not expecting a full solution!
View 3 Replies
View Related
Dec 16, 2009
I have several complaints from Moto DROID users who experience lags while touching. In my app I implement the recommended workaround with two threads and Thread.Sleep( 35 ) . It worked and works perfectly on my G1 and on some other Google devices. But for DROID I hear many complaints. As I don't have a DROID, could someone please tell me if there is still a need for this workaround? Or shall I have to do anything else?
View 2 Replies
View Related
Jul 7, 2009
i need left, right motion event and a click event . problem is that, if i have onclickEvent then onTouchEvent doesn't fire. onTouchEvent works only if i disable onclickEvent and also it doesn't work what i expect.
1-only ACTION_MOVE fires twice everytime when i move on screen.
2-can't get left and right motion.
View 6 Replies
View Related
Jul 27, 2010
I've got an onTouchEvent boolean on a Surfaceview, I've got openGL objects drawn on the view and I'm wondering is there anyway to detect where on the screen the onTouch happened? e.g (x,y) co-ordinates.
View 1 Replies
View Related
Nov 13, 2010
I'm making an application which will utilize both touchevents and sensorevents. The problem with touchevents is that they fire off very often, and thereby consumes massive amounts of CPU time. The common solution is to do a Thread.sleep to make it cool down.However, if one wants to use both the onTouchEvent and onSensorChanged in the same activity, applying the Thread.sleep hack will also slow down onSensorChanged. This is obviously caused by the two methods being called from the same (ui) thread.Is there some way to call onTouchEvent from a different thread than the ui, so one could do the Thread.sleep trick without slowing down onSensorChanged as well?
View 1 Replies
View Related
Nov 19, 2010
I'm adding 5 ImageView to an linear layout at runtime, so far so good, but what i would like to do is, when the user slide his finger over one of them, i would like to change the image, so my question would be, how can i know what's the current imageview under the user finger.?
View 2 Replies
View Related
Oct 15, 2010
How can I drag a marker on the map?
How to handle it in onTouchEvent()?
I had written one code that actually drags. But it feels like the map is moving instead of the marker. That code is...
View 1 Replies
View Related
Feb 3, 2009
Does anybody have any idea why I get often(but not always) error during the on touch event? Handling touch events is freezed for few seconds(this appears only immediately after application start). Then Error screen appears (choose wait of close). When I choose wait after few seconds screen is starting to process events. I'm using surfaceView with thread for painting. In logcat I get something like : "No window to dispatch pointer action 1".
View 2 Replies
View Related
Dec 29, 2009
what is best way to create app in which I only need to draw simple lines through onTouchEvent? When i use invalidate everytime i draw any line, that erase lines i draw before. But if I use some List structure to store drawed lines it lose performance. Is there any simple way to do it?
View 6 Replies
View Related
Jan 12, 2010
I'm trying to do something in my app where you have to hold your finger on the screen for more than 30 seconds. After about 30 seconds, it stops sending onTouchEvents for that part of the screen, almost like a "dead zone." Tested on a motorola droid, and is there any way to stop this from happening?
View 6 Replies
View Related
Oct 20, 2010
I need to specify the full button images for both the up and down positions. My impression is that the most probable choice is to use an custom button based on the ImageView and specify the image for up and down positions. I am using the OnTouchEvent method to capture the ACTION_DOWN, but I'm not getting the ACTION_UP event.
Is there a better choice for creating a button that controls the full button image, catches the Down/Up and can subdivide the down time into time slices? If not, how do I catch the up event.
My application expects a screen touch on the "button" and not a keyboard action.
View 3 Replies
View Related
Jul 12, 2009
I'm totally new to the G1, coming from an iphone, but my gps when on (and can actually get a signal lock), seems to always have me on the grass or in the water if driving my any. Its rarely ever where I am. and im in a major city. Perhaps that could be why, but i always have clear view to the sky.
View 12 Replies
View Related
Oct 2, 2010
To provide feedback from the user for game I'm writing.This event fires off some game control events that take some time to complete (because there is animation involved).The problem I'm having is during the animation if I keep touching the screen (AKA firing this event),Basically while the animation is running, I do not need this event, although it would be nice to queue it.What can I do to prevent the timeout and either queue the event, or temporarily disable it?
View 2 Replies
View Related
Nov 20, 2010
I've been looking for a battery widget to tell me my remaining charge state as a percentage, but so far all of them go in increments of 10% (i.e. 90% left, to 80%, to 70%, etc). Does anyone know of one that breaks it down a little more finely?
View 8 Replies
View Related
Mar 2, 2009
I need a recommendation from someone for the most accurate way of timing SoundPool sounds. I can't loop them because what's desired is not a loop but very accurate (to the ear at least) timing.
View 3 Replies
View Related
Aug 2, 2010
I'm trying to get my current location and show it on a map. Class com.google.android.maps.MyLocationOverlay.MyLocationOverlay does most of the work for you. But it's coming back with a very coarse result that's off by a couple of clicks. I'm listening for onAccuracyChanged() but that never gets called.
How can I get a more accurate location, when using MyLocationOverlay ?
PS. manifest has
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:debuggable="true">
<uses-library android:name="com.google.android.maps" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
View 1 Replies
View Related
May 30, 2010
I'm writing my first location based android app, but got confused about some of the GPS service api. Here are some questions I have:
1) To get my current location, I called requestLocationUpdates() with a listener in the onCreate() method of one activity. But what happens when another activity starts and the current activity goes invisible? Is the GPS location update going to stop? If so, how do I keep it on after the activity is switched?
2) how accurate is the Location.getSpeed()? How is it computed? Can it tell the difference between on bicycle and on foot?
3) not really a question about android. How to calculate the coordinates of a location, say, 100m away from my current location?
4) To stop the GPS, I only need to remove all the listeners that have been registered to locationmanager?
View 2 Replies
View Related
Apr 9, 2010
I've implemented a Class that extends Overlay and also override the onTap / onTouchEvent (tried both). Right now it seems like that event is triggered when you tap on the map regardless of position.How can I make sure that the event is triggered only when you tap over the overlay you have added?
View 2 Replies
View Related
Jan 2, 2010
I recently posted this question on stackoverflow (http://tinyurl.com/ yzrofne), but maybe someone here can help me. I am using the location manager's requestLocationUpdates() method to receive an intent to my broadcast receiver periodically. The system is correctly firing the intent to my broadcast receiver, and I have been able to use it correctly. The only problem is that the GPS location provider only stays active for a few seconds after the initial location acquisition, and I need it to stay on a little longer so that the location estimates are more accurate. For example, if I tell the location manager that I want an update every 5 minutes, it correctly fires the intent with location information from the GPS. However, the GPS only stays active for about 5 seconds, so it doesn't give much time for the location to reach a high accuracy (say, less than 10-20 meters). My question is how to make the GPS location provider stay active for each periodic request that comes from the LocationManager requestLocationUpdates. Does anyone know how to do this?
View 2 Replies
View Related
Dec 28, 2009
I hope this is the right section to post this, I have an HTC / G2 on a T-Mobile UK contract. I'm after a good weather forecast app that works well for the UK and Europe. I also use WeatherPro on my iPOD Touch (when I can link up to my home WiFi) and it is great - it picks up small towns, gives 5 day forecasts, 24 hour forecasts broken down into 3 hour time slots, shows satellite and radar, temperatures in 'F and 'C, windspeed and direction. It is very accurate too! I can't find it on the Android Market though.
View 5 Replies
View Related
May 4, 2010
I need to build compass for my application.
From reading the documentation it seems there are two reasonable ways of doing this:
Sensor.TYPE_ORIENTATION method: This is the easy way of doing it. The problem with this is it is not accurate. When I compare my reading with Snaptic Compass it is about 10-15 degress off which for my purposes is unacceptable.
Sensor.TYPE_ACCELEROMETER, Sensor.TYPE_MAGNETIC_FIELD and getRotationMatrix() in conjunction with remapCoordinateSystem() and getOrientation() method: The documentation says this "is usually more accurate". The problem is regardless of the delay I register with listener the compass goes crazy even when the device is stationary on flat surface.
View 2 Replies
View Related
Nov 30, 2009
Is anyone who is using 3G Watchdog or NetCounter actually receiving accurate stats compared to what Orange are showing on their OrangeWorld "Your Account" section?
I have been using my new HTC Hero for just over 2 weeks now and Orange are saying that I have used 422MB of data. This seems ridiculous to me as I only automatically check email once per hour, surf to the extent of anyone with such a new gadget, and spend every evening at home connected to WiFi from about 6pm onwards.
I phoned Orange one day last week and they advised that I had used 310MB up to that point, so I immediately downloaded 3G Watchdog and started it running. Since then, it says that I have used 36MB in the same period that Orange say I have used 112MB.
I also use NetCounter, but as I didn't reset it last week, I can't make any specific comparisons. However, on a daily basis it always agrees with 3G Watchdog to within a few KB.
I know I will need to phone Orange to sort this out, and I am certain that they will tell me that downloaded data counter apps cannot be trusted. I'm not sure how I can prove to them that their data readings for me are wrong.
View 1 Replies
View Related