Android API 30 Cannot Detect multi-touch on the Android Emulator - android

I have a view and I want to implement detection of multi-touch gestures, so I override the onTouch() event and there I implement the logic. I have tested it and it work on actual device with Android API 28, and it works on Android Emulator up to API 29. As seen on the image below, on the emulator when I use [Ctrl+Clicks] to detect multi-touch for two fingers, I receive an event ACTION_POINTER_DOWN indicating that the second finger was down on the screen.
But on Android Emulator using API 30, I never receive the ACTION_POINTER_DOWN event and the multi-touch does not work. When I change the API version to lower version < 30, for the same emulated device it starts working. So the problem only occurs for devices that use API30 (I don't have an actual device that runs Android API30, so I am not sure if this only happens on the emulator or not). Is it somehow disabled by default from the developer options or the settings?

Related

LOCK_TASK_FEATURE_GLOBAL_ACTIONS alternative for API 26

I'm looking for some way to block users from turning kiosk device off with only touch screen. Unfortunately, all devices I'm programming for run on api <= 26, so I can't simply use setLockTaskFeatures, with LOCK_TASK_FEATURE_GLOBAL_ACTIONS. How else can I stop users from powering the kiosk device off using the power button in the navigation bar?
Actually there is no way to do that, the setLockTaskFeatures() is added in API 28.
If it was there in the previous APIs it would be implemented by setGlobalSetting(), which it's almost deprecated now and neither does have any parameter corresponding to power-button.

PhoenGap app not detecting swipe

I have a PhoneGap 2.9 app running on Android 4.4 and it takes several tries to detect a swipe event from jQuery Mobile (v.1.10). This same code runs beautifully on Android 4.3.
I have tried changing the values for
$.event.special.swipe.durationThreshold
$.event.special.swipe.horizontalDistanceThreshold
but these do not seem to help at all. Any suggestions?
Below is how I am hooking up the swipe event:
$(document).on("swipe", '.collapsed', function (e) {
// do something
});
Set the target SDK to 18 instead of 19 to force the new webview in kitkat to operate in compatibility mode.

Split Motion Events in android 2.3 and below

I created an app which handles multiple touches simultaneously. This works perfectly fine in android 4.0 and above.
But when i run the same in android 2.3(having multi-touch support upto 4 touches), the app doesnt detects more than 1 touch.
Is there a way to split motions events in android 2.3.

view.invalidate not working on phone

I have a Custom view, made up of several view and label components. When the user touches the view, I draw a frame around the view to indicate selected status, and the background changes on double tap. The frame is drawn using the overridden draw function of the view by passing the view a frame color different from the background and calling view.invalidate(). Same for the background change.
This used to work perfectly as long as I was developing for API 7. Even on my phone that runs API 16. I recently migrated the code to API 11+ and now the selected frame is not showing anymore and the background does not change on my phone even though it is still working in the emulator (API 14).
A afternoon of trying to trace where the error is, I figured out that on my phone, calling view.invalidate() is not triggering a redraw of the view. I also tried view.requestLayout() and view.postInvalidate() (just to make sure) with the same result. Putting the invalidate command in a separate thread did not work either.
To summarize:
Code API 7 - Phone API 16 - Emulator API 7 to 14 view.invalidate works
Code API 11 - Phone API 16 - Emulator API 11 to 14 view.invalidate does not work on Phone but on emulator.
I have a Motorola RAZR M from Verizon
Is this a known bug or was there a change in handling of things like that in API 11?
Any help is appreciated.

Is it possible to detect pinch zoom start and end gestures in Eclair (2.1)?

My app supports Eclair 2.1, API level 7. I have a need to detect pinch-zoom gestures, both when they start and when they end. Is this possible without using ScaleGestureListener (only available from 2.2, API level 8)?
I don't believe so. It would appear that SimpleGestureDectector is only available in API level 8+.

Categories

Resources