Created
February 10, 2013 18:51
-
-
Save seungwoonlee/4750594 to your computer and use it in GitHub Desktop.
Android UserInput Logging
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.userinput; | |
import android.os.Bundle; | |
import android.app.Activity; | |
import android.util.Log; | |
import android.view.KeyEvent; | |
import android.view.MotionEvent; | |
public class UserInputActivity extends Activity { | |
private static final String TAG = "UserInputActivity"; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
// setContentView(R.layout.activity_user_input); // View ¸¦ »ý¼ºÇÏÁö ¾Ê´Â´Ù. | |
} | |
@Override | |
public boolean onKeyDown(int keyCode, KeyEvent event) { | |
Log.i(TAG, "onKeyDown:" + keyCode + event.toString()); | |
return super.onKeyDown(keyCode, event); | |
} | |
@Override | |
public boolean onKeyUp(int keyCode, KeyEvent event) { | |
Log.i(TAG, "onKeyUp:" + keyCode + event.toString()); | |
return super.onKeyUp(keyCode, event); | |
} | |
@Override | |
public boolean onTouchEvent(MotionEvent event) { | |
Log.i(TAG, "onTouchEvent:" + event.toString()); | |
return super.onTouchEvent(event); | |
} | |
@Override | |
public boolean onTrackballEvent(MotionEvent event) { | |
Log.i(TAG, "onTrackballEvent:" + event.toString()); | |
return super.onTrackballEvent(event); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment