안드로이드를 공부중인 학생입니다.
알람 기능을 하는 앱을 짜는데 여러가는 기능들은 구현 성공하였지만
벨소리 기능을 못해 며칠째 고생중이네요...
public class MySoundPlay {
MediaPlayer
mp = null;
public MySoundPlay ( Context context, int id ) {
mp = MediaPlayer.create(context, id);
}
public void play() {
mp.seekTo(0);
mp.start();
}
----------------------------------------------------------------------------------
private static MySoundPlay mplay = null;
@Override
public void onReceive(Context context, Intent intent) {
try {
if(mplay == null) {
mplay = new MySoundPlay(context, R.raw.bellsori1);
}
mplay.play();
}catch( Exception e ) {
Output.e(TAG_LOG, e.toString());
위와 같은 소스를 썻는데요 onReceive 함수는 엑티비티 메인자바에 넣고 위 코드는 따로 클래스를 만들어 넣었습니다.
Androidmanifest에 <receiver android:name=".AlarmReceiver" android:process=":remote" /> 추가하엿구요,..
많이 부족해 응용법을 잘 몰라서 며칠째 헤매고 있느데요...
알람 알림시 raw 폴더에 bellsori1.wav 파일을 울리고싶은데 마음대로 안되네요 ㅠㅠ 고수님들 도와주시면 안될까요...