I want to count the total number of fingers touching that are present on screen at any given time. Is there any C function that can return me the value in number, if I am touching my device screen with 3 fingers, it should return 3 as the answer, and if 1 finger is lifted, and the function is called again, it would return 2 as output.
Count active touches on screen in android using C?
91 views Asked by Abhinav jayaswal At
3
There are 3 answers
0
![Enrico Migliore](/img/user-default.png)
Microsoft Visual Studio allows you to develop and deploy C/C++ native Android applications:
https://visualstudio.microsoft.com/it/vs/features/cplusplus-mdd/
to access user's input events in an Android device, you will need an Android SDK that comes with a function that does what you are looking for.
You should look for and Android's SDK's that comes with:
C toolchain (pre-processor, compiler, linker, debugger, etc)
C library with the function you want
If such a function exists, it will surely be a callback function, that Android calls whenever the input event is triggered by the user.
Good luck!
Beware of the fact that executable files produced by C source code, pose security problems because they are natively executed.
That means, that you won't be able to upload such an executable file to the Playstore.
You can still upload and test your executable file in your smartphone using the USB or WiFi interfaces.
Enrico Migliore
P.S. Since Android is Linux powered, the SDK you will find, will surely contain the GCC toolchain.