41756

Android 1.5 Multitouch

Question:

Does anyone know if it's possible to use Multitouch on an Android 1.5 device?

I have a HTC Hero, and it's still running 1.5 (HTC have been a little slow on getting the 2.1 ROM out).

The Android MotionEvent documentation shows the constants (ACTION_POINTER_1_DOWN, ACTION_POINTER_1_UP.....etc...) I need to implement multitouch as only avaliable from API 5 :(

Is there a way round this other then waiting for HTC to get the update out or buying a 2.1 handset?

Code Snippet:

public boolean onTouchEvent (MotionEvent event) { //TODO: determine if the event object is an ACTION_POINTER_DOWN etc... //for ACTOIN_DOWN it is if(event.getAction() == MotionEvent.ACTION_DOWN) { //do something here..... } }

Answer1:

<a href="http://androidcommunity.com/forums/f28/how-can-i-get-multitouch-for-jf-1-5-cupcake-16995/" rel="nofollow">This post</a> discusses it a bit in the context of users. It would stand to reason that if the browser supports it (I'm assuming your hero has the requisite hardware...) you as a developer could access it. That said, it's possible that it's not part of the public api but even if that's the case, you could just use reflection to call the methods. This isn't a great answer, but you could download the cupcake source from the repo and dig through the browser code to see how they implement the multitouch stuff.

Answer2:

<a href="http://www.alicesbiscuit.com/android-sdk-multitouch-workaround.html" rel="nofollow">here</a> you have an example, it works fine on my Hero, but I still have issues with my onscroll method which is called sometimes, since there is no builtin events to tell my Activity I am zooming.

Recommend

  • Docker - The framework microsoft.AspNetCore.App, version '3.1'0 was not found on build
  • std::memory_order_relaxed and initialization
  • Unable to access local Web API from Visual Studio 2015 WIndows 10 Phone Emulator
  • Unable to get Google API key and GoogleSearch.Wsdl which are required to run a perl script
  • How to display or get an image from Firebase storage
  • Spring Cloud Config - Multiple Composite Repositories?
  • Insert statement not working using execute(array()) of PDO Extension
  • Android NDK refer to external libraries in JNI
  • How to implement JQuery confirm dialog with JSF
  • Running iPhone crash Logs from testers on XCode
  • SQL query for game rental website - game delivery report
  • Implementation of timeout in LDAP
  • Extracting a small subset of data from XMLs
  • Reload Page with Javascript after Database changes
  • How to merge objects within array based on attribute
  • What Exception is thrown on timeout?
  • Problems to understand DXGI DirectX 11 Desktop Duplication to get a Buffer or Array
  • C++ STL stack pop operation giving segmentation fault
  • Unable to create Access token grant type in wso2 API manager store to test API
  • Terminal run dalvikvm with am.jar
  • Will this work on all screen sizes?
  • VSTS work items list through REST API
  • How to handle div that is created dynamically in a table
  • Make checkout phone field optional for specific countries in WooCommerce
  • Why my AngularJS async test in Jasmine 1.3.x is not working?
  • Can someone explain this Java code (formatting the output using System.out.format) to me?
  • Codeigniniter insert data through models and controller
  • Spring Boot not autowiring @Repository
  • ReferenceError: TextEncoder is not defined
  • ARKit code issue {unknown error -1=ffffffffffffffff error: Task failed with exit 1}