Android :: 2.1 - MotionEvent Multiple Touch Events Get Mixed Up And Influence Each Other

Sep 24, 2010

Purpose of the app:

A simple app that draws a circle for every touch recognised on the screen and follows the touch events. On a 'high pressure reading' getPressure (int pointerIndex) the colour of the circle will change and the radius will increase. Additionally the touch ID with getPointerId (int pointerIndex), x- and y-coordinates and pressure are shown next to the finger touch.

Following a code snipplet of the important part (please forgive me it is not the nicest code ;) I know)

CODE:.............

The problem:

A HTC Desire running Android 2.1 is the test platform. The app works fine and tracks two finger without a problem. But it seems that the two touch points interfere with each other when they get t0o close -- it looks like they circles 'snap'to a shared x and y axle. Sometimes they even swap the input coordinates of the other touch event. Another problem is that even though getPressure (int pointerIndex) refers to an PointerID both touch event have the same pressure reading.

As this is all a bit abstract, find a video here: http://www.youtube.com/watch?v=bFxjFexrclU

My question:

Is my code just simply wrong? Does Android 2.1 not handle the touch events well enough get things mixed up?Is this a hardware problem and has nothing to do with 1) and 2)?

Android :: 2.1 - MotionEvent multiple touch events get mixed up and influence each other


Android :: Motionevent - Multitouch Events Give Wrong Coordinates

Jan 6, 2010

I have been racking my brain to try to figure out what is going wrong here. I wanted to experiment with multi-touch, so I decided to add the controls for LunarLander to the touchscreen.

Instead of adding buttons, I defined regions on the screen that when touched, would act like the buttons on the keyboard (for example, the gas fires as long as you press the screen in the area defined for the gas button, and stops firing when you release.)

To do this, I added the onTouchEvent override to the LunarView class as follows:

CODE:.....................

View 2 Replies View Related

Android :: MotionEvent - How To Get Coordinates Of Touch/ Pointer/mouse

Sep 26, 2010

I'm trying to get coordinates of the mouse, but there seems to be no easy ways. Can't make the MotionEvent object because the constructor is private. Can anyone please tell me how to get the coordinates of the touch/ pointer/mouse? I only want the touch coordinates of ImageView, but wouldn't mind the touch coordinates anywhere on the screen.

View 2 Replies View Related

Android :: Is Bad MotionEvent/Touch Slowdown Stuff Actually Fixed On First-gen 2.1 Updates

Apr 18, 2010

I'd really like to know what the state of that fix is as 2.1 is rolled out onto first generation (MSM7200-based) devices. As it stands, I don't see much of a problem with touch eating up CPU on the Droid and N1 but those are much faster phones so I don't think it would be quite as pronounced on them. My current 1.6 devices (G1 and Tattoo) cut my framerates in half during any touch (with the sleep hack, even). I optimized my new games so that they would run well-enough (25-40fps) on that hardware but they have very touch-centric interfaces so won't work well with that bug. I talked to a few people who run 2.0/2.1 mods on their G1s and they said the problem isn't any better. They still see the big slowdown. I tested on my 1.6 emulator vs a 2.1 emulator and there is a huge improvement. The 1.6 emulator slows down just like my G1 does and the 2.1 emulator shows only a tiny bit of slowdown, which is what I was hoping for. That's encouraging, but I have yet to see a real 2.1 MSM7200 update in the field so I don't know what to think yet.

View 10 Replies View Related

Android :: MotionEvent HistorySize And Multiple Pointers

Aug 22, 2010

I couldn't find a definite reference for the size of a MotionEvents history, when there are multiple pointers. The reference says that if you use a getHistorical* function, you might pass it a history position which is somewhere between [0..getHistorySize()-1]. But in a lot of examples handling multitouch if there are multiple pointers they only use history positions between [0..getHistorySize()/ getPointers()-1] (so they divide the history's size with the number of pointers). Which one is the correct way?

View 8 Replies View Related

Android :: How 3D Objects Get Touch Events?

May 31, 2009

I am writing a game using OPENGL, there are several 3D objects in my surface view. My question is: Should each 3D object implement view in order to get touch events? Or there is other way to do this?

View 5 Replies View Related

Android :: Why Are Touch Events Destroying My Framerate?

Apr 27, 2009

I'm developing a game for Android. It's got a lot going on but is running reasonably smoothly. That is, of course, until the user touches the screen.While they're touching it, onTouchEvent is called (with action = ACTION_MOVE, x = 0 and y = 0) roughly once every ten milliseconds at what appears to be a fairly high priority, as it absolutely obliterates the framerate. As soon as the touch ends the framerate returns to its nice state.Has anyone encountered this? Is there a way to reduce the rate at which ACTION_MOVE events are generated, or to ensure that they're only generated when there is actual movement, or use a polling method that just gets the current location of the touch? Or even just a way to disable it entirely?

View 4 Replies View Related

Android :: Possible To Detect Touch Events In Droid

Jul 19, 2010

New to android so please bare with me here

Is it possible to detect all touch events in an Activity and capture it and then in return pass that pass event to another View. For example:

Button 1 and Button 2. When Button 1 is pressed I want to capture that touch/click event and automatically pass that touch event to Button 2, basically with one touch/press you get the click generated and that same click is passed on to the second button automatically.

View 1 Replies View Related

Android :: Excessive Number Of Touch Events Slows Down App

Feb 26, 2010

I'm writing an Android game that needs to receive touch events. My problem is that, whenever the user drags their finger along the screen, so many touch events get sent to the touch event handler (which I think runs as a separate thread) that my frame rate plummets! What's the best way I can limit the number of touch events that are handled per second? For example, if my game runs at 60 fps, I really shouldn't need more than 1 touch event being handled every second. Can I do this is a way that doesn't lose any information (i.e. important information about where on the screen the user touched last)?

View 2 Replies View Related

Android :: Monkey - Touch Events Being Dispatched To The Screen

Sep 8, 2010

I start monkey like this:

monkey -p <MY PACKAGE> --port 4321

(I have already done a tcp port forwarding).

I then use PuTTY to telnet to 127.0.0.1:4321

I can issue a command like tap 100 100 I get a response OK but I see nothing happening on the UI. I have placed a button at that location but I does not receive the touch event.

When I run monkey like this

monkey -p <MY PACKAGE> --pct-touch 100 -v 10

I see touch events being dispatched to the screen.

View 1 Replies View Related

Android : Send Touch Events To Foreground Activity

Jul 21, 2010

I'm trying to figure out a way to send touch events to the foreground activity. Essentially I want to write something that allows me to run it from the shell and just say "I touched this co-ordinate", so that I can automate some UI tasks for testing. Essentially what Monkey does, but application agnostic.

I think that android.view.MotionEvent holds the key, but I'm not sure how to run something without view so that I don't interfere with what is on the screen. Perhaps with a service, but I'm unclear how that would work.

View 5 Replies View Related

Android :: Triggering Swipe And Touch Events On Mobile Web App - IPhone

Jul 21, 2010

Wondering here if there is a way I could trigger an event, so that any library listening for these events (e.g. jQTouch, Sencha touch, iUI, ... ).

If I could extend or use jQuery for such task e.g. $(...).trigger('event') that would be great to know.

Usage example:

I need to debug a few web apps by simulating multi touch with my mouse. This seems a little complicated, so if I could trigger the multi-touch events using Javascript I could therefore test the app more efficiently.

View 2 Replies View Related

Android :: Implement Touch Events On Activity And Button On Droid?

Apr 23, 2010

I have an Android activity with an ImageButton. I would like to execute some logic when the button is clicked and show a different image for the pressed state, but also receive the touch event on the activity.

By default only the button receives the touch event. If I set the clickable attribute of the button to false then only the activity receives the touch event.

What's the best way to implement the touch event in the activity and the click in the button?

View 2 Replies View Related

Android : Disable - Handle WebView Touch Events In Phone?

Oct 4, 2010

How do you disable all touch events in an Android WebView (or scrolling in particular)? I would like the activity to handle all touch events.

View 2 Replies View Related

Android : Disable Scrolling Touch Events In ScrollView Programmatically?

Aug 10, 2009

Just wondering if there is an easier way to simply stop ScrollView from being scrolled via touch inputs? I will programmatically get the ScrollView to scroll to top or bottom.

As a last resort, I guess I will have to inherit from ScrollView and capture all the ontouch events. But wondering if there is an easier way before I take this approach?

View 5 Replies View Related

Android :: Use Motion Events With Multiple Layouts

Aug 22, 2009

I'm beginning in android development, and I've stumbled upon a problem. My application has different layouts stored in xml files, and I use motion events such as onFling or onSingleTapup. These motion events seem to apply whatever layout i'm in. My problem is simply identifying which layout i'm currently using so I can define the appropriate action. I guess what i'm trying to do is a bit like this:

@Override public boolean onSingleTapUp(MotionEvent e) { if(using main layout) { //do this } else if (using settings layout) { // do that } return false;

}

View 4 Replies View Related

Android :: Trackball Doesn't Give Me Click Events / But Touch Screen Does

Mar 5, 2009

I have a list activity that creates a header row above the data rows from the adapter. I want to receive click events when the user selects the header or a data row (but my data rows have check boxes in them, so this part is tricky). When I use the touch screen, I get this expected behavior:

1. Tapping on any row causes a click event and a dialog appears.

2. Long-pressing on a data row causes a context menu to appear.

3. Long-pressing on the header row does *not* show the context menu.

However, when I use the arrow keys (emulator) or trackball (G1), I get this unexpected behavior:

1. Selecting any row fails to cause any click events, even though the row's appearance changes like it's being clicked.

2. Long-pressing on the header row *does* show the context menu, which I don't want.

3. Occasionally, it doesn't focus the correct row when I move up or down (e.g. it skips from the header to the last data row).

View 11 Replies View Related

Android :: Incorrect Touch Events From Browser With Dashcode Mobile Projects

Jul 16, 2010

I'm developing an HTML/Javascript mobile web application using Dashcode. Normally I wouldn't use such WYSIWYG stuff, but I've found it a very rapid development process.

Unfortunately it seems like I can't get it to run on Android's browser currently. The main display loads and all the correct data is pulled from web services, but you cannot press on anything to activate it.

I suspect that the android browser is sending different javascript events, which the Dashcode objects are not configured to pick up.

In addition, the adb logcat debugger refuses to output any log messages from the browser on the emulator, and as such I'm having a very hard time sorting this out.

What events I need to be watching for, so I can iterate over all the touch handlers and duplicate them for the android events, or offer help in any other way on this situation?

View 2 Replies View Related

Android :: ACTION_UP And ACTION_MOVE Touch Events Passed Through To Custom Views?

Jan 20, 2010

I have an activity defined as:

CODE:...................

View 3 Replies View Related

Android :: Handling Events From One Service For Multiple Activities

Jun 10, 2010

I have a class A which extends TabActivity and creates Activities B, C and D as tabs in its onCreate() function. Also, class A initializes another service handler class S which is responsible for establishing a connection to a service and implementing callback handlers for the service. Any of the Activities B, C and D should be able to receive events from the service and update accordingly. If I receive any event in class S from the the service then I want to call a function in Activity B which would be responsible to update the UI elements in Activity B based on the event received. You can assume that the user is in Activity B when the event arrives.

Can I call an activity function like the following in the stub handler for the callback in my class S -

CODE:................

View 4 Replies View Related

Android :: View Stops Receiving Touch Events When Parent Scrolls / Continue It?

Sep 8, 2010

I have a custom Android view which overrides onTouchEvent(MotionEvent) to handle horizontal scrolling of content within the view. However, when the ScrollView in which this is contained scrolls vertically, the custom view stops receiving touch events. Ideally what I want is for the custom view to continue receiving events so it can handle its own horizontal scrolling, while the containing view hierarchy deals with vertical scrolling.

Is there any way to continue receiving those motion events on scroll? If not, is there any other way to get the touch events I need?

View 1 Replies View Related

General :: Simulate Touch Events Via ADB Bridge

Jul 4, 2012

My phones' display has been broken and I would like to know if there is a pc software that allows me to simulate touch events via adb bridge.

View 1 Replies View Related

General :: Xperia SP - SD Card Influence Android Speed?

Feb 4, 2014

I have been using HTC Desire X for 1 year. Now I have bought Xperia SP, because HTC wasnt so fast (not games etc., but in normal use, long delay before app start, twitching at main screan rolling etc. ). So Xperia is faster, not as I expected, but still faster until I put my SD Card from HTC. After that Xperia bacame slow like HTC. My SD card is the expensive one Kingstom 32 GB. Is it all only because of SD card? Can you say me some info about SD cards and Android?

View 3 Replies View Related

Android :: Find List View Choice Mode Multiple Events

Nov 18, 2010

How to find checked events in choice mode multiple.

I am using ontemselected method it is not working for me

CODE:...............

View 1 Replies View Related

Android :: Do Android / WebOS Devices Support Multi-touch Javascript Events?

Mar 17, 2010

On iPhone, iPod touch and (presumably) iPad, Apple has multi-touch event handling available via JavaScript in Mobile Safari. I know the Nexus One recently added multi-touch support via an update, and I believe webOS is also multi-touch enabled. Do Android 2.1 and/or webOS have access to multi-touch in the browser, or is this currently exclusive to Apple devices?

View 6 Replies View Related

Android :: How To Listen For Touch Events From Lock Screen And Home Screen

Jul 24, 2009

I want to listen for the touch events from Lock Screen and Home Screen, is there any way i can tap those to my applications.

View 4 Replies View Related

Android :: Passing Touch Events From One Gallery Widget To Another Widget

Feb 18, 2010

I am trying to pass the same touch events on one widget to the other so they both scroll at the same time and in same way. I have two Gallery widgets one above and one below. If the above one is scrolled then I want to pass the same touch event to the bottom widget so it also scrolls the same way.I have tried to use dispatchtouchevent events but I am facing an issue where in if the bottom gallery widget has some edit text then the edit text gets the key event and both widgets doesnt scroll anymore.I have tried to set focussable and editable to false on edittext even then it gets the touch events.I think I am going in the right direction. However I need some assistance in doing the right way.

View 3 Replies View Related

Android : Achieve Mixed Layout With ListView?

Apr 19, 2010

Things go fine, and i am able to design a layout like this...

View 3 Replies View Related

Android :: Make Dynamic Layout Which Contains Mixed Elements - Checkboxes And Buttons?

Mar 2, 2010

I want to make a dynamic layout which contains mixed elements

[text] [checkbox] [button]
[text] [checkbox] [button]
[text] [checkbox] [button]

View 3 Replies View Related

Motorola Droid :: Email Coming In Mixed Up?

Jan 8, 2010

receiving my emails no problem - from exchange server. Now, all of a sudden when I get a new email, it will say who the email is from, but when I open it, the body of the email is not from that person. It may be from someone elses email that morning or someone elses 1 week ago. But if I pull up my email on my laptop, everything is normal.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved