Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Samsung hovering API with finger

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).

like image 831
Stephane Mathis Avatar asked Apr 30 '13 21:04

Stephane Mathis


1 Answers

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;     } }); 
like image 76
Siz Avatar answered Sep 30 '22 14:09

Siz