Split Motion Events in android 2.3 and below - android

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.

Related

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

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?

When do I need to use layoutInDisplayCutoutMode?

Android added a way to deal with devices that have a notch/cutout at the top of the screen. (See Android and Xamarin.Android.) But as far as I can tell, Android automatically takes care of lowering the views so that they aren't obscured by the notch, so why do we need this new addition?
I tested my Android app on the emulator of a device with a notch and the app automatically goes below the notch without the need to specify layoutInDisplayCutoutMode as LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER.
So my question is, when would I need to use LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER?
In Xamarin that would be:
Window.Attributes.LayoutInDisplayCutoutMode = Android.Views.LayoutInDisplayCutoutMode.Never;
I'm running this on the Android Emulator through Visual Studio on a Windows computer. The emulator is emulating a Pixel 3 XL with Android Pie 9.0 (API 28). The app is an Android app created with Xamarin.Forms.
When you are creating a view, which uses full screen for showing content at that time notch display sometime hide/cut your top content.
To prevent this android provides support for this above android pie.
Refer to this document.
https://source.android.com/devices/tech/display/display-cutouts

Smartwatch with round screen and running regular Android 4.4.2

I have a smartwatch with round display and it is running Android 4.4.2. My app is working fine on smartwatch with square display running Android 4.2.2 but the UI gets cropped in round display. It seems all the APIs for round screens are for Android wear. I would like to adjust the UI of my app to fit on round screens but do not want to create a separate Android Wear project for it.
Is there a way to use the Android wear APIs while developing app for devices running regular Android?
Thanks in advance.

UI not being properly updated on LG device (works on others!)

I'm writing an app that I've been testing on my Nexus 5 with Android 5 and in the emulator on different DPI and API levels. While some UI magic is missing on pre-L Android, everything worked just fine and I know how to work around these missing parts (e. g. implement touch feedback etc.)
I've implemented RecyclerView and CardView from the support library which worked just fine on my device and the emulators. There is data being fetched from the web so the "list" is being filled upon launch.
Now, I've tested the app on a LG G2 mini running Android 4.4.2. The UI is not being updated. The items are added, but I have to leave the Activity and come back again before I can see them.
This sounds like I've been missing runOnUiThread, but I didn't! Furthermore, why is this working on stock Android but not on an OEMs mod?

App crashes on Kindle Fire but not on Nexus 5. Both run 4.2.2 and SDK 17. What is the difference?

I working on my first Android app (published on iOS and Windows Phone before). When testing the app on a Nexu 5 eveything works fine but on a Kindle Fire the app crashes:
java.lang.IllegalStateException: Cannot add header view to list -- setAdapter has already been called.
This is NOT about the exception itself. I could easily solve the problem by simple using listView.addHeaderView(...) before using listView.setAdapter(...). Not a big deal, but why does the same code runs without any problem on one device but crashes on the other?
I would understand the problem if the devices would use different Android/SDK versions but this is not the case. Both devices run Android 4.2.2 with SDK Level 17...
I would understand the problem if it would be related to something close to the hardware or some vendor specific system calls, but this not the case. It is just about setting up a ListView...
So, what is the difference?
Of course I have only a limited set of test devices. How can I be sure that the app will work on all devices that are running a supported SDK Level?
EDIT:
Of course one device is a phone and the other a tablet. To app uses different layouts for large screens at some places but problem also shows up in Activities/Fragments that have the same layout on both devices. Additionally no separated code for large devices is used. Using the same code and the same layout on both devices leads to a crash on the Kindle but runs on the Nexus...

Categories

Resources