Samsung has done something great with the hovering API, and I'm interested in including it in my app. The problem is that the hovering API included in the SPen SDK only work with the SPen and not with the finger detection like the latest apps do on the Samsung Galaxy S4.
Can anyone provide me with a link to the right SDK or even a sample project?
EDIT: Nifhel commented, fallow this link: Floating Touch on Galaxy S4 (requires API 12 and to create a new class that inherit from TextView
for instance)
EDIT: The accepted answer is a better solution and works perfectly well (requires API 14 but easier to use).
I've tried out the method described on the link recommended by Nifhel. The only thing you have to do is adding a new intent filter for your Activity in the manifest, no need to override "dispatchGenericMotionEvent":
<intent-filter> <action android:name="com.sec.android.airview.HOVER" /> </intent-filter>
After that you have to add an onHoverListener to you View and it will work fine. For example in my ListAdapter:
convertView.setOnHoverListener(new OnHoverListener() { @Override public boolean onHover(View v, MotionEvent event) { Log.d("ListAdapter", "Hover: " + item); return false; } });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With