This file contains hidden or 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
SensorManager sensorMgr; | |
booleanhasSensor; | |
//センサーマネージャの取得 | |
sensorMgr = ( SensorManager ) getSystemService( SENSOR_SERVICE ); | |
hasSensor = false; | |
//センサマネージャへリスナーを登録 | |
//ここのTYPE_PROXIMITYというところを置き換えることで、様々なセンサの値が取得可能 |
This file contains hidden or 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
//インスタンス変数の定義 | |
SpeechRecognizer rec; | |
//onCreate()で変数にリスナーをセットする | |
// 音声認識 | |
rec = SpeechRecognizer.createSpeechRecognizer( getApplicationContext() ); | |
rec.setRecognitionListener( new speechListenerAdp() ); | |
//音声認識をスタートする | |
// SpeechRecognizer |
This file contains hidden or 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
// アクティビティからタイマーサービススタート | |
Intent intent = new Intent( mContext, TimerService.class ); | |
intent.putExtra( "counter", result ); | |
startService( intent ); | |
//呼び出されたServiceプログラムでTimerをスタートします。 | |
if ( timer != null ) | |
timer.cancel(); | |
timer = new Timer(); | |
final android.os.Handler handler = new android.os.Handler(); |
NewerOlder