linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] Fwd: Information about Linphone android


From: 曾維薇
Subject: [Linphone-developers] Fwd: Information about Linphone android
Date: Fri, 4 Jul 2014 18:12:30 +0800

1. 在res/layput/chat.xml(聊天室介面)加入按鈕(id=sendAudio)

2. 在src/org/linphone/ChatFragment.java加入
private TextView sendAudio;
sendAudio = (TextView) view.findViewById(R.id.sendAudio);
sendAudio.setOnClickListener(new OnClickListener()){

@Override
public void onClick(View v){
sendTextMessage("#ding-dong");
}


}
3. 在raw資料夾上新增dingdong.wav音訊檔
   並在src/org/linphone/LinphoneManager.java 的 
   messageReceived(LinphoneCore lc, LinphoneChatRoom cr, LinphoneChatMessage message)函式中加入

if(textMessage.comPareTo("#ding-dong")){
try{
mediaplayer = MediaPlayer.create(context, R.raw.dingdong);
mediaplayer.start();
}catch(Exception e){
e.printStackTrace();
}
}


reply via email to

[Prev in Thread] Current Thread [Next in Thread]