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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>console track</title> | |
</head> | |
<body> | |
console status: <span id="stat"></span> | |
<script> | |
function isConsoleOpen() { |
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
//need to import android.os.Handler; | |
final Handler h = new Handler(); | |
h.postDelayed(new Runnable() | |
{ | |
private long time = 0; | |
@Override | |
public void run() | |
{ | |
// do stuff then |
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
import android.content.Context; | |
import android.hardware.Sensor; | |
import android.hardware.SensorEvent; | |
import android.hardware.SensorEventListener; | |
import android.hardware.SensorManager; | |
public class ShakeListener implements SensorEventListener { | |
//速度阈值,当摇晃速度达到这值后产生作用 | |
private static final int SPEED_SHRESHOLD = 2500; |