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;
}
});
Based on what I could find, Samsung is yet to release an API that supports finger hovering (AirView).
Try ApiDemos in latest version of sdk android-17 (4.2.2) -> Views -> Hover.class. It can give you a heads up on Hover event.