Questions tagged [motionevent]

MotionEvent object used to report movement (mouse, pen, finger, trackball) events. Motion events may hold either absolute or relative movements and other data, depending on the type of device. Motion events describe movements in terms of an action code and a set of axis values. The action code specifies the state change that occurred such as a pointer going down or up. The axis values describe the position and other movement properties.

468 questions
0
votes
1 answer

Why do touch position coordinates influence each other? (ACTION_MOVE)

I'm having a real issue here which I'm desperately trying to figure out since the last couple of hours. Not getting anywhere... While writing an application in which I need to process the exact positions of two fingers on the screen, I ran into an…
grAPPfruit
  • 2,041
  • 3
  • 20
  • 29
0
votes
1 answer

Canvas MotionEvent, bitmap does not get dragged as expected

I am using MotionEvent and Matrix to drag my bitmap but instead the bitmap gets "translated" to a nearby region (most of the times in the opposite direction of press). I want to be able to drag it using Matrix translations. Here's my code.…
jmishra
  • 2,086
  • 2
  • 24
  • 38
0
votes
1 answer

Using MotionEventCompat in android

I'm looking for an example of how to use MotionEventCompat in Android. I'm using API level 10, which doesn't support if a finger is 'hovering' or 'dragging' onto a view. I need to detect this, preferably from the view itself. Here's some code…
ultra
  • 329
  • 1
  • 4
  • 15
0
votes
1 answer

Android Background Service that will Record/Playback MotionEvents

I am looking for an app that would run a background service that would record MotionEvents at all times (even when not in the app) and store them in some sort of logfile. Then, when requested, would replay these MotionEvents in order to simulate the…
-1
votes
1 answer

How to check whether the user has tapped on a specific part of the screen?

Hi I'm new to android studio and I have an app that draws some shapes. Currently when I tap the screen once the app deletes the last shape drawn. However, I need it to delete the shapes only when the user clicks on the top left 1/16 of the canvas…
Sook Lim
  • 541
  • 6
  • 28
-1
votes
2 answers

Getting last x and y coordinates of ACTION_UP android

i would like to know how to get the last X and Y coordinate value of the ACTION_UP motion event, since this motion event returns the last release point as well as any intermediate points since the last down event. I would like to uniquely store the…
-1
votes
1 answer

I need to make my app support pinch zoom, but not double tap

This is the code I made for my onTouchListener: if(event.getAction() == MotionEvent.ACTION_UP) { Log.i("", "double touch : " + timeLastTouch + "... time passed: " + (System.currentTimeMillis() - timeLastTouch)); if…
rosu alin
  • 5,674
  • 11
  • 69
  • 150
-1
votes
1 answer

Give more accurate result on touch event

I am trying to make a big click on touch screen(e.x when a fat finger press it) smaller, which means to give the more accurate result depending on the center of the click. My problem is i can't find a relevant post or a way how to make a touch event…
We're All Mad Here
  • 1,544
  • 3
  • 18
  • 46
-1
votes
1 answer

NavigationDrawer propagates MotionEvent

I am experiencing the following issue: In an Android application, I use NavigationDrawer for, well ..., navigation. My issue is that even if the user is opening the drawer (by swiping on left screen border) the ACTION_DOWN MotionEvent is not…
F.L.
  • 559
  • 4
  • 11
-1
votes
1 answer

Multitouch: ACTION_POINTER_DOWN & ACTION_POINTER_UP

I'm trying to use multitouch as a method to press 2 things simultaneously. Here's my Code: TouchHandle.setOnTouchListener(new OnTouchListener () { public boolean onTouch(View view, MotionEvent event) { int actions =…
Ziad Akiki
  • 2,601
  • 2
  • 26
  • 41
-2
votes
1 answer

What is the use of MotionEvent.offsetLocation and how it works

i am working on google map. in which i want to perform some click operation on button available on info window. but we can't perform click directly on info window. so i got the link in which we can perform the click on info window. but i am not able…
Umesh Saraswat
  • 560
  • 1
  • 8
  • 22
-2
votes
1 answer

finding the right direction while moving your finger in android devices

I'm currently processing movement on Android and I used MotionEvent.ACTION_MOVE. I calculate currentx =(int) event.getX()/size and currenty=event.gety()/size, which gives me the integer base on the size of grid which I work on. Howevor, I want a…
-2
votes
2 answers

Long Press Android to Java

I'm trying to program a Mouse via Wifi TCP. Client is on Android and Server on Java. I'm trying to detect a LongPress on Android and send this information to Java. Android: I need to implement MotionEvent.ACTION_DOWN but I don´t know what to do…
-2
votes
1 answer

how to detect if iphone is still?

I have to make an app in which user can take photo only when iPhone is still. Can you please tell me how to proceed with that. Any help will be appreciated. Below is the code that I have tried, please Suggest improvement on it, this code is giving…
Mohit Nigam
  • 454
  • 5
  • 10
-3
votes
1 answer

Why does this program crash when I try run it?

I have a basic understanding of Java, but am completely new to Android Studio. I tried making a program that increases a counter when a button is held down. I based it on two bits of code I found (one for a simple click counter and one that used…
Binbows
  • 27
  • 1
  • 5
1 2 3
31
32