0

我正在尝试通过 immersion sdk 使用 android 探索触觉。(下载的 jar 版本= 3.6)

参考: http ://www2.immersion.com/developers/index.php?option=com_content&view=category&layout=blog&id=119&Itemid=592

我有以下代码(immersion 提供的示例应用程序)

protected TextView mTxtOut;
protected Launcher mLauncher;

public void onCreate(Bundle savedInstanceState) {
    System.out.println("abc");
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    mTxtOut = (TextView)findViewById(R.id.txtOut);

    try {
        mLauncher = new Launcher(this);
    } catch (Exception e) {
        Log.e("My App", "Exception!: " + e.getMessage());
    }

}

@Override
public void onDestroy() {
    super.onDestroy();
}

public void btnPlayEffectClicked(View view) {       
    mTxtOut.setText("Playing built-in effect:\n. Effect: DOUBLE_STRONG_CLICK_100.");

    try {
        mLauncher.play(Launcher.DOUBLE_STRONG_CLICK_100);
    } catch (Exception e) {
        mTxtOut.append("Error: " + e.getMessage());
    }
}

启动应用程序后,我收到一条错误消息“不幸的是,MyFirstHapticApp 已停止”。

我在 mLauncher = new Launcher(this); 在 LogCat 中。

我看过http://www2.immersion.com/developers/index.php?option=com_kunena&func=view&catid=2&id=170&Itemid=0但没有帮助。

4

1 回答 1

1

你看过触觉指南吗?

具体这个

基本上,您需要确保 UHL.jar 和 libImmEmulatorJ.so 都已加载。第二个链接提供了两者的说明。

于 2013-06-05T20:23:43.343 回答