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.os.AsyncTask; | |
public class SampleAsyncTask extends AsyncTask<String, Integer, Integer> { | |
/** | |
* 前処理 | |
*/ | |
@Override | |
protected void onPreExecute() { | |
//開始前の初期化処理等を行う | |
} |
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.media.AudioManager; | |
import android.media.SoundPool; | |
public class SoundPlayer { | |
//フィールド | |
//------------------------------------------------- | |
private SoundPool m_soundPool; //音再生クラス | |
private int m_soundId; //再生音ID | |
private boolean m_isReady = false; //再生準備完了かどうか |
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
<uses-permission android:name="android.permission.VIBRATE" /> |
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
/* | |
* Copyright (C) 2008 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
private ScheduledExecutorService m_clockService; | |
private ScheduledFuture m_clockFuture; | |
/** | |
* 一定間隔で実行するタイマーをセットする | |
* @param period タイマー時間(ミリ秒) | |
*/ | |
private void initTimer(int period) { | |
if (m_clockService != null) { | |
return; |