Reputation: 3278
Recent Versions of Android have a feature named 'Show Touches' in 'Settings->Developer Options', enabling which shows a visual feedback for touch interactions.
Is there a way to programmatically implement it in my app. I mean, show visual feedback when user touches a screen on my app (irrespective of the system settings)
Upvotes: 2
Views: 4294
Reputation: 121
To enable show touches:
Settings.System.putInt(context.getContentResolver(),"show_touches", 1);
To disable show touches:
Settings.System.putInt(context.getContentResolver(),"show_touches", 0);
Remember to add android.permission.WRITE_SETTINGS
to your AndroidManifest.xml.
Upvotes: 0
Reputation:
To enable:
Settings.System.putInt(context.getContentResolver(),
"show_touches", 1);
To Disable:
Settings.System.putInt(context.getContentResolver(),
"show_touches", 0);
works on below marshmallow version.
must add <uses-permission android:name="android.permission.WRITE_SETTINGS" />
to manifest.
Upvotes: 1
Reputation: 4643
I am actually looking for the same thing as you do.
I dont find any source so far but you may be interested in checking this site.
I believe this function is implementable.
https://code.google.com/p/android-touchexample/
Upvotes: 1
Reputation: 1233
There is a way to do that: create an overlay which can receive touch events. But then you will not be able to use the background anymore (e.g. the app you're using).
So actually it's not possible, unfortunately. If I'm not mistaking, it's because Google wants to prevent something called TapJacking.
I'm sorry!
Upvotes: 0